Closed Bug 1788513 Opened 4 years ago Closed 1 year ago

location.href set to unparseable URL should throw TypeError

Categories

(Core :: DOM: Core & HTML, defect, P3)

Firefox 106
defect

Tracking

()

RESOLVED INVALID

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.

Component: Untriaged → DOM: Core & HTML
Product: Firefox → Core
Severity: -- → S3
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P3
Assignee: nobody → avandolder
Status: NEW → ASSIGNED
Pushed by avandolder@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fa7c85ece2b3 Setting location.href to a malformed URI throws a TypeError. r=smaug

Ah, I didn't see that there was already a WPT for this case. I'll set those to passing now.

Flags: needinfo?(avandolder)

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!

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.

Flags: needinfo?(smaug)
Flags: needinfo?(avandolder)

up to adam to sort out :)

Flags: needinfo?(smaug)

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.

Flags: needinfo?(avandolder) → needinfo?(smaug)
Attachment #9292758 - Attachment description: Bug 1788513 - Setting location.href to a malformed URI throws a TypeError. r?smaug → Bug 1788513 - Setting location.href to a malformed URI throws a TypeError. r=smaug

Crashing?

Flags: needinfo?(smaug)

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.

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.

Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → INVALID
Attachment #9292758 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: