Skip to content

[Gecko Bug 1788741] Test and fix timing of focus fixup rule. - #38062

Merged
moz-wptsync-bot merged 1 commit into
masterfrom
gecko/1788741
Jun 4, 2025
Merged

moz-wptsync-bot merged 1 commit into
masterfrom
gecko/1788741

Conversation

@moz-wptsync-bot

Copy link
Copy Markdown
Collaborator

To do this we change the timing at which ResizeObserver fires with
respect to the refresh driver last layout update, which is what the spec
says to do, in order for the focus fixup rule to fire after
ResizeObserver.

Bug 1790150 would make this more explicit.

Differential Revision: https://phabricator.services.mozilla.com/D156219

bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1788741
gecko-commit: b85b6264ef4b87c0353b2a50b2d47ef74399397c
gecko-reviewers: smaug

@wpt-pr-bot wpt-pr-bot left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The review process for this patch is being conducted in the Firefox project.

@moz-wptsync-bot
moz-wptsync-bot merged commit 5caadac into master Jun 4, 2025
@moz-wptsync-bot
moz-wptsync-bot deleted the gecko/1788741 branch June 4, 2025 02:13
domenic added a commit that referenced this pull request Sep 21, 2026
HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in 5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in #38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, #62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases while leaving precise scheduling assertions to the dedicated focus-fixup tests.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <[email protected]>
domenic added a commit that referenced this pull request Sep 21, 2026
HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in 5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in #38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, #62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <[email protected]>
domenic added a commit that referenced this pull request Sep 24, 2026
HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in 5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in #38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, #62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <[email protected]>
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Sep 29, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <[email protected]>

--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827
lando-worker Bot pushed a commit to mozilla-firefox/firefox that referenced this pull request Oct 1, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <[email protected]>

--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this pull request Oct 5, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <codexopenai.com>

--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827

UltraBlame original commit: d0174234741490e96f935047be72d1cd22ef3b71
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this pull request Oct 5, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <codexopenai.com>

--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827

UltraBlame original commit: d0174234741490e96f935047be72d1cd22ef3b71
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this pull request Oct 5, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.

Co-authored-by: codex <codexopenai.com>

--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827

UltraBlame original commit: d0174234741490e96f935047be72d1cd22ef3b71
zerox80 pushed a commit to zerox80/firefox that referenced this pull request Oct 16, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.


--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827
zerox80 pushed a commit to zerox80/firefox that referenced this pull request Oct 16, 2026
…ng tests, a=testonly

Automatic update from web-platform-tests
Wait for focus fixup in fieldset disabling tests

HTML clarified focus fixup in whatwg/html#8392, merged on January 27, 2023. It split the old rule into synchronous fixup when the focused node is removed, without blur events, and asynchronous fixup during "update the rendering" when the focused area becomes non-focusable. Disabling a fieldset falls into the latter case: the rendering update runs the focusing steps for the document's viewport.

disabled-003.html was added on April 7, 2023 in web-platform-tests/wpt@5857a9b as a regression test for Chromium's exponential-time fieldset traversal and a crash caused by reentrant blur handling. Although it postdates the HTML change, its assertions require Chromium's synchronous focus change after disabling a fieldset. They therefore fail implementations that defer the change until a rendering update.

The dedicated focus-fixup timing tests were updated in web-platform-tests/wpt#38062, merged on June 4, 2025, to check that focus remains unchanged synchronously and is fixed up after rendering. More recently, web-platform-tests/wpt#62292, merged on August 31, 2026, changed the moveBefore() focus-fixup tests to use waitForAtLeastOneFrame() before checking document.activeElement.

Use the same rendering wait here by converting both nested-fieldset cases to promise tests. Assert that each input initially receives focus before disabling the fieldset, then check that focus has moved away after rendering. This preserves the original shallow and deeply nested crash/hang cases.

Do not add exact-timing assertions here that would fail Chromium for changing focus synchronously. Timing after disabling a fieldset is already covered by the #button4 subtest in https://github.com/web-platform-tests/wpt/blob/532766fee262a2b41054665505b9dc37bd7c0a25/html/interaction/focus/processing-model/focus-fixup-rule-one-no-dialogs.html. That case focuses a button and disables its parent fieldset; the shared helper checks that focus remains unchanged synchronously, during the first animation-frame callback, and during ResizeObserver delivery, then checks that focus is fixed up after rendering.

Both subtests change from failing to passing in Firefox 151 and WebKit 26.5, and continue to pass in Chromium 149.


--

wpt-commits: 8e9f3e2199fca135a62526a75410ecf10d3f9e3d
wpt-pr: 62827
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants