Firefox strips \t\n\r characters from location.hash, but not from about:blank and data: iframes' hashes
Categories
(Core :: DOM: Window and Location, defect)
Tracking
()
People
(Reporter: cpeterson, Assigned: jjaschke)
References
Details
Attachments
(1 file, 1 external file)
|
658 bytes,
text/html
|
Details |
Firefox strips \t\n\r characters from location.hash, but not from about:blank and data: iframes' hashes.
Chrome and Safari strip \t\n\r characters from location.hash and about:blank and data: iframes' hashes.
Steps to reproduce
- Load
about:blankordata:text/html,testin a tab - In the web console, enter
location.hash = "foo \t\n\rbar" - Check the value of
location.hash
Expected value
#foo%20bar like in Chrome and Safari.
Actual value
#foo%20%09%0A%0Dbar
I found this bug while debugging location.hash bug 1733797. I'll add a WPT test case for this issue in that bug, marked as expected to fail and to be fixed in this bug.
Updated•8 months ago
|
| Assignee | ||
Comment 1•8 months ago
|
||
nsSimpleURI::SetRef was not stripping \t, \n, \r characters from the input,
unlike nsStandardURL::SetRef. This caused data: and about:blank URLs to
percent-encode these characters instead of removing them.
Per the URL spec, the hash setter invokes the basic URL parser
(https://url.spec.whatwg.org/#concept-basic-url-parser) which unconditionally
strips all ASCII tab or newline (https://infra.spec.whatwg.org/#ascii-tab-or-newline)
from the input in step 3, before any state-specific processing.
Updated•8 months ago
|
| Assignee | ||
Updated•8 months ago
|
Comment 4•8 months ago
|
||
The patch landed in nightly and beta is affected.
:jjaschke, is this bug important enough to require an uplift?
- If yes, please nominate the patch for beta approval.
- See https://wiki.mozilla.org/Release_Management/Requesting_an_Uplift for documentation on how to request an uplift.
- If no, please set
status-firefox149towontfix.
For more information, please visit BugBot documentation.
Updated•8 months ago
|
| Assignee | ||
Updated•8 months ago
|
Updated•8 months ago
|
Description
•