Closed Bug 2066491 Opened 3 months ago Closed 3 months ago

[wpt-sync] Sync PR 62189 - Fix microtask race in src-repeated-in-ancestor.html test

Categories

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

task

Tracking

()

RESOLVED FIXED
156 Branch
Tracking Status
firefox156 --- fixed

People

(Reporter: wpt-sync, Unassigned)

References

()

Details

(Whiteboard: [wptsync downstream])

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

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

Dominic Farolino <dom@chromium.org> wrote:

Fix microtask race in src-repeated-in-ancestor.html test

The test previously used:

Promise.race([
  subjectNavigation.then(...),
  controlNavigation]
);

... to detect if an iframe associated with subjectNavigation navigated
to a URL that matches an ancestor URL. In Chromium, when beforeunload
fired synchronously in both iframes, wrapping subjectNavigation in a
.then() created a pending promise whose microtask ran after
controlNavigation had already settled.

This caused Promise.race to resolve with controlNavigation first,
accidentally masking any navigation/beforeunload events on the subject
iframe, which is used to assert that a navigation didn't take place in
that iframe at all.

This CL replaces the Promise.race() race with an explicit check
ensuring no beforeunload event was dispatched on the subject iframe by
the time the control iframe finishes loading. Chromium fails the fixed
test which reveals that we never implemented step 3 of
https://html.spec.whatwg.org/C#shared-attribute-processing-steps-for-iframe-and-frame-elements in the HTML Standard:

If the inclusive ancestor navigables of element's node navigable contains a navigable whose active document's URL equals url with exclude fragments set to true, then return null.

This was found during investigation in
https://github.com/whatwg/html/issues/12800.

R=nrosenthal

Bug: N/A
Change-Id: I03c205aef55db2daf1cfa6fde8ef0df7d08a79ac

Reviewed-on: https://chromium-review.googlesource.com/8281045
WPT-Export-Revision: ce194cc26e77b3653e63b3f70b8c9d9600ee63a8

Component: web-platform-tests → DOM: Core & HTML
Product: Testing → Core

CI Results

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

Total 163 tests

Status Summary

Firefox

OK : 1[GitHub] 148[Gecko-windows11-64-25h2-debug] 149[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-opt]
PASS: 1[GitHub] 8[Gecko-linux2204-64-wayland-debug, Gecko-linux2204-64-wayland-opt] 215[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 218[Gecko-windows11-64-25h2-debug] 219[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-64-25h2-opt]
FAIL: 3[GitHub] 13[Gecko-android-em-14-x86_64-debug-geckoview, Gecko-android-em-14-x86_64-lite-opt-geckoview, Gecko-android-em-14-x86_64-opt-geckoview, Gecko-linux2404-64-debug, Gecko-linux2404-64-opt, Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt, Gecko-windows11-64-25h2-debug, Gecko-windows11-64-25h2-opt]

Chrome

OK : 1
PASS: 1
FAIL: 3

Safari

OK : 1
PASS: 1
FAIL: 3

Links

Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base

Details

New Tests That Don't Pass

Tests Disabled in Gecko Infrastructure

Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 156 Branch
You need to log in before you can comment on or make changes to this bug.