Repository navigation
[Gecko Bug 1788741] Test and fix timing of focus fixup rule. - #38062
Merged
Merged
Conversation
wpt-pr-bot
approved these changes
Jan 19, 2023
wpt-pr-bot
left a comment
Collaborator
There was a problem hiding this comment.
The review process for this patch is being conducted in the Firefox project.
moz-wptsync-bot
force-pushed
the
gecko/1788741
branch
from
February 10, 2023 23:23
f0d6158 to
7c25bea
Compare
The timing was fixed in bug 1959927. Differential Revision: https://phabricator.services.mozilla.com/D156219 bugzilla-url: https://bugzilla.mozilla.org/show_bug.cgi?id=1788741 gecko-commit: f7774e608dc9d30e4fae50bd183aaed6a4598b4a gecko-reviewers: smaug
moz-wptsync-bot
force-pushed
the
gecko/1788741
branch
from
June 3, 2025 16:30
7c25bea to
875ced5
Compare
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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