Closed Bug 1788588 Opened 3 years ago Closed 3 years ago

[wpt-sync] Sync PR 35720 - Navigation rewrite: Add invalid URL test

Categories

(Core :: DOM: Core & HTML, task, P4)

task

Tracking

()

RESOLVED FIXED
106 Branch
Tracking Status
firefox106 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

(Depends on 1 open bug, )

Details

(Whiteboard: [wptsync downstream])

Sync web-platform-tests PR 35720 into mozilla-central (this bug is closed when the sync is complete).

PR: https://github.com/web-platform-tests/wpt/pull/35720
Details from upstream follow.

Dominic Farolino <dom@chromium.org> wrote:

Navigation rewrite: Add invalid URL test

According to today's HTML Standard for the location.href setter 1,
and the standard after our navigation and session history rewrite for
hyperlinks 2, navigations to invalid URLs should throw TypeErrors and
do nothing, respectively.

Testing this is tracked as row 3 [3] in our testing spreadsheet, and
this CL adds tests for these cases.

At the time of writing this CL, browsers are behaving as follows:

Location setter:

  • Chrome: Throws a SyntaxError
  • Safari: Throws a TypeError (CORRECT)
  • Firefox: Throws a "NS_ERROR_MALFORMED_URI" which is not even an instanceof Error

Hyperlink navigations:

  • Chrome: Invokes #navigate --> ends up on about:blank#blocked
  • Safari: Similar, but changes the URL back to the unparseable URL
  • Firefox: Does nothing (CORRECT)

Chrome's behavior is trivial to fix for both of these, which would give us every browser except one aligned with the spec.

R=domenic@chromium.org

Bug: 1358338, 1358340
Change-Id: Ia39329e5570e1502e30e2f4af610c3702f8bade5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3866312
Commit-Queue: Dominic Farolino \<dom@chromium.org>
Reviewed-by: Domenic Denicola \<domenic@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1041518}

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core
Whiteboard: [wptsync downstream] → [wptsync downstream error]
Whiteboard: [wptsync downstream error] → [wptsync downstream]

CI Results

Ran 9 Firefox configurations based on mozilla-central, and Safari on GitHub CI

Total 1 tests and 2 subtests

Status Summary

Firefox

OK : 1
PASS: 1
FAIL: 1

Safari

OK : 1
PASS: 2

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Pushed by wptsync@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/501858cddf18 [wpt PR 35720] - Navigation rewrite: Add invalid URL test, a=testonly https://hg.mozilla.org/integration/autoland/rev/f85804b19dc3 [wpt PR 35720] - Update wpt metadata, a=testonly
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 106 Branch
You need to log in before you can comment on or make changes to this bug.