This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 28091 - URLUtils.protocol setter when changing to or from a relative scheme
Summary: URLUtils.protocol setter when changing to or from a relative scheme
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: All All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-24 12:57 UTC by Simon Sapin
Modified: 2015-06-18 10:01 UTC (History)
3 users (show)

See Also:
annevk: needinfo? (simon.sapin)


Attachments

Description Simon Sapin 2015-02-24 12:57:32 UTC
Interesting things happen when the URLUtils.protocol setter changes an URL’s scheme to a relative scheme from a non-relative scheme, or vice-versa.

See https://github.com/servo/rust-url/pull/83

Test case: http://software.hixie.ch/utilities/js/live-dom-viewer/?saved=3428

    <a href="mailto:a@b.net">
    <script>
    var a = document.body.firstChild; 
    console.log(a.href);
    a.protocol = "http";
    console.log(a.href)
    </script>

In Chromium:
    log: mailto:a@b.net
    log: http://a@b.net/

In old Opera (Presto):
    log: mailto:a@b.net
    log: http:///a@b.net

In Firefox:
    log: mailto:a@b.net
    log: http://software.hixie.ch/utilities/js/live-dom-viewer/a@b.net
Comment 1 Anne 2015-02-24 13:01:53 UTC
It's not clear why this is a problem with the specification.
Comment 2 Anne 2015-06-18 10:01:35 UTC
I ended up changing this as part of https://github.com/whatwg/url/commit/b266a43fc9df0e8607074bd4d336a517e2010009 Hopefully that can be supported since the current situation is not great.

Resolving WORKSFORME though since there was not an actual bug report here.