[wpt-sync] Sync PR 63336 - Fix timeout flake in focus-pseudo-matches-on-shadow-host.html
Categories
(Core :: DOM: Core & HTML, task, P4)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox160 | --- | fixed |
People
(Reporter: wpt-sync, Unassigned)
References
()
Details
(Whiteboard: [wptsync downstream])
Sync web-platform-tests PR 63336 into mozilla-central (this bug is closed when the sync is complete).
PR: https://github.com/web-platform-tests/wpt/pull/63336
Details from upstream follow.
Joey Arhar <jarhar@chromium.org> wrote:
Fix timeout flake in focus-pseudo-matches-on-shadow-host.html
In focus-pseudo-matches-on-shadow-host.html, \<input id="defaultFocus"
autofocus> appears in \<body> before the \<script> element that registers
defaultFocus.addEventListener('focus', handleFocus) and calls
testInMode().Once HTMLDocumentParser::PumpTokenizer() exits \<head> and parses the
\<input autofocus> element, the parser can yield before parsing \<script>
(for example, when scheduler_->ShouldYieldForHighPriorityWork() returns
true for a pending BeginMainFrame, or when the parser time budget
expires). During that yield, BeginMainFrame runs
PageAnimator::ServiceScriptedAnimations() and calls
Document::FlushAutofocusCandidates(), which focuses defaultFocus and
dispatches its focus event before \<script> executes. When \<script>
subsequently runs and registers handleFocus(), the focus event has
already fired, so handleFocus() never runs, no promise_test() subtests
are registered, and the test times out.Reproduce the timeout deterministically by forcing HTML parser yields
with HTMLParserYieldAndDelayOftenForTesting:
third_party/blink/tools/run_wpt_tests.py -t Default
--additional-driver-flag=--enable-blink-features=HTMLParserYieldAndDelayOftenForTesting
external/wpt/shadow-dom/focus/focus-pseudo-matches-on-shadow-host.htmlInitialize focusedDefault to (document.activeElement == defaultFocus) so
prepare() resolves immediately if autofocus already completed before
\<script> execution. Call testInMode() synchronously at the top level of
\<script>, and use step_timeout(didFocusDefault, 0) in handleFocus() to
avoid nested focusing steps when autofocus runs after \<script>.Fixed: 567076198
Change-Id: I0cd06c03e90cc0bcc99523543247aaa5590b3907
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/8498979
Reviewed-by: Joey Arhar \<jarhar@chromium.org>
Commit-Queue: Joey Arhar \<jarhar@chromium.org>
Reviewed-by: David Grogan \<dgrogan@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1712699}
| Assignee | ||
Updated•1 month ago
|
| Assignee | ||
Comment 1•1 month ago
|
||
Pushed to try (stability) https://treeherder.mozilla.org/jobs?repo=try&landoInstance=lando-prod-2025&landoCommitID=101286
| Assignee | ||
Comment 2•1 month ago
|
||
CI Results
Ran 9 Firefox configurations based on mozilla-central, and Firefox, Chrome, and Safari on GitHub CI
Total 40 tests and 2 subtests
Status Summary
Firefox
OK : 1[GitHub] 37[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]
PASS: 20[GitHub] 108[Gecko-windows11-32-25h2-debug, Gecko-windows11-32-25h2-opt] 111[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-debug, Gecko-windows11-64-25h2-opt]
FAIL: 1
Chrome
OK : 1
PASS: 20
Safari
OK : 1
PASS: 20
Links
Gecko CI (Treeherder)
GitHub PR Head
GitHub PR Base
Details
New Tests That Don't Pass
- /shadow-dom/focus/click-focus-slot-ancestor.html [wpt.fyi]
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
FAIL
- Select on non-focusable non-editable slot in a contenteditable shadow DOM and inside focusable div will select text:
Comment 4•1 month ago
|
||
| bugherder | ||
Description
•