location.href set to unparseable URL should throw TypeError
Categories
(Core :: DOM: Core & HTML, defect, P3)
Tracking
()
People
(Reporter: domfarolino, Assigned: avandolder)
Details
Attachments
(1 obsolete file)
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
Steps to reproduce:
Setting location.href to an unparseable URL should throw a TypError, but instead a NS_ERROR_MALFORMED_URI is thrown, which is not even an instanceof Error.
Updated•4 years ago
|
Comment 1•4 years ago
|
||
I guess we're taking the error from necko and not converting it to TypeError.
https://searchfox.org/mozilla-central/rev/9962f512b52f5faba6b5a769b9e89a2a72fb8dbf/dom/base/LocationBase.cpp#198-203,238
| Assignee | ||
Comment 2•4 years ago
|
||
Updated•4 years ago
|
Comment 4•4 years ago
|
||
Backed out for causing failures at url/failure.html.
Backout link: https://hg.mozilla.org/integration/autoland/rev/fbe04b2e33e91528785b1b1baeaa12542e3998aa
Failure log: https://treeherder.mozilla.org/logviewer?job_id=389309133&repo=autoland&lineNumber=4397
| Assignee | ||
Comment 5•4 years ago
|
||
Ah, I didn't see that there was already a WPT for this case. I'll set those to passing now.
| Reporter | ||
Comment 6•4 years ago
|
||
I apologize, but we recently changed the tests (and spec) to throw a "SyntaxError" DOMException instead of a TypeError, since that better matches everything else on the Location object. For more discussion, see https://chromium-review.googlesource.com/c/chromium/src/+/3876468/7#message-00ebca665db5b0e50511416299c9650564813908.
In that case, it is possible that you'll need to update the implementation again. Sorry!
Comment 7•4 years ago
|
||
There's a r+ patch which didn't land and no activity in this bug for 2 weeks.
:avandolder, could you have a look please?
If you still have some work to do, you can add an action "Plan Changes" in Phabricator.
For more information, please visit auto_nag documentation.
| Assignee | ||
Comment 9•4 years ago
|
||
Looking back into this, it seems the test case that broke the autoland (wpt/url/failure.html) is currently broken and crashing, and so is set to pass no matter what. Should the patch just be relanded then? After I fix the new lint error on it.
Updated•4 years ago
|
| Assignee | ||
Comment 11•4 years ago
|
||
Yeah - there's a tracking issue for it: https://bugzilla.mozilla.org/show_bug.cgi?id=1790287. I've been unable to get the test to run locally as well. Either way, it seems a recent WPT update (https://bugzilla.mozilla.org/show_bug.cgi?id=1791857) changed the meta file for the test and it should pass now with my previous fix, assuming it doesn't crash.
| Assignee | ||
Comment 12•1 year ago
|
||
This issue is no longer relevant, as the specified behaviour was changed from throwing a TypeError to a SyntaxError and this was implemented in bug 1817591.
| Assignee | ||
Updated•1 year ago
|
Description
•