Repository navigation
fix: keep nested fixed targets focusable - #615
Open
Amber (YuanboXue-Amber) wants to merge 2 commits into
Open
Amber (YuanboXue-Amber) wants to merge 2 commits into
Amber (YuanboXue-Amber) wants to merge 2 commits into
Conversation
A null parent offsetParent does not establish that a fixed target is hidden. Use the target's rendered client rectangles and preserve existing visibility/accessibility checks. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
📊 Bundle size report🤖 This report was generated against cc60426d5ab690bc33f01fb39144f2afd9d3ef0e |
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Amber (YuanboXue-Amber)
marked this pull request as ready for review
November 12, 2026 14:56
This branch has not been deployed
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.


Summary
Use a fixed-position target's own client rectangles instead of its parent's
offsetParentto detect missing rendered boxes. Visible fixed anddisplay: contentsparents can also have a nulloffsetParent, incorrectly rejecting focusable targets and causing observed focus requests to time out.Existing visibility, body-size and accessibility guards remain unchanged. No API or retry behavior changes.
Before / after
All rows describe fixed-position targets. "Allowed" means passing the visibility gate; other focusability and accessibility checks still apply.
offsetParentdisplay: contentsparentdisplay: noneon target or ancestorhiddenValidation
Performance
Measured before/after results (Chromium 150)
Synthetic benchmark of the exact before/after helper and visibility caller: 1,684-element document, warmed-up code, alternating execution order, 15-30 samples per version, and 50,000 checks per clean-layout sample.
Median time per visibility check, in microseconds:
A scan of 180 ordinary and 20 fixed targets took 0.153 -> 0.156 ms, with substantial timing overlap.
For the corrected cases, fixed-parent checks took 0.83 -> 1.26 microseconds, and
display: contentsparent checks took 0.81 -> 1.26 microseconds. These are not equivalent-work comparisons: the old code incorrectly rejected early; the new code also reaches the existing body-size guard.Chromium layout counters:
Style-recalculation counts matched too. The new read added processing cost but no additional layouts in these cases.
Conclusion: about 0.15 ms extra per 1,000 previously valid fixed-target checks in this benchmark. This is a Chromium/Electron microbenchmark on one machine, not an end-to-end or cross-browser performance guarantee.