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 21179 - Query string not serialized for non-relative URLs; the relative flag
Summary: Query string not serialized for non-relative URLs; the relative flag
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-03 15:33 UTC by Peter Occil
Modified: 2013-03-04 09:51 UTC (History)
1 user (show)

See Also:


Attachments

Description Peter Occil 2013-03-03 15:33:01 UTC
The URL serializer doesn't add the query string for URLs with non-relative schemes (those with scheme data instead of paths), even though the "scheme data" state switches to the query state and parses the query string as appropriate for those URLs.  This affects mailto URLs in particular; the query string containing the subject and so on is parsed, but the query string doesn't appear when it's serialized.

Also, what's the purpose of the relative flag?  Since, it seems to me, the flag is set only "if url's scheme is a relative scheme", and isn't set otherwise, I think it may serve to simplify implementations if those words ("if url's scheme is a relative scheme") appear instead of "if url's relative flag is set", etc. whenever possible. Although doing so may also complicate how setting the "protocol" attribute works, since the path, host, and so on may need to be converted to scheme data or vice versa, so I'll let you decide.
Comment 1 Anne 2013-03-04 09:44:55 UTC
https://github.com/whatwg/url/commit/a421bbc781d923e6cfb84f10bc5c21cd4a164882

The relative flag is there indeed solely for the protocol attribute because browsers do not do that conversion. I've been thinking we should restrict setting the protocol attribute in some way to prevent this mismatch, but this is not really high on any implementor's priority list.
Comment 2 Anne 2013-03-04 09:51:24 UTC
Explained the relative flag at a better point in the document:

https://github.com/whatwg/url/commit/aea63f6d3382ed296b02ccf6776a249900b88351