Skip to content

fix(runtime): make drifted hit-testing, scroll, focus and accessibility paths use the canonical rule - #1219

Merged
Hona merged 2 commits into
devfrom
fix-runtime-drift
Nov 19, 2026
Merged

Hona merged 2 commits into
devfrom
fix-runtime-drift

Conversation

@Hona

@Hona Hona commented Nov 19, 2026

Copy link
Copy Markdown
Member

An audit of hit testing, scrolling, focus and accessibility found ten places where a second code path had its own copy of a rule and the copy had drifted. Each now calls the canonical rule, and each has a test that fails on dev.

On screen before Cause Now shares
Web: elements after a container vanish from the accessibility mirror, or move under it, while its child exits exiting nodes at the tail point back at live parents, which stretched an earlier subtree over later siblings one forward pass that closes live spans first
A click in a centred, end-aligned or right-to-left text field puts the caret toward the wrong end seven input paths subtracted the left inset and added single-line scroll themselves input_text_point, built on the text origin drawing uses
Horizontal wheel, touch pan, fling and middle-click autoscroll scroll a viewport under a raised panel or popover they scanned nodes in reverse instead of the paint-ordered hit list scroll_in_chain, the walk wheel_target uses
A tooltip shows through an interactive element directly over it k > seq where the other occlusion tests use k >= seq the same comparison
Assistive text bounds inside El::scale stay at 1x and do not update when the scale changes unscaled insets and widths; the scale was missing from the change hash a11y_text_origin, built on the text origin drawing uses
Right-to-left: scroll-left does nothing from rest; the web mirror moves items by twice the scroll raw offset used where the signed shift is meant shift() and toward()
ElementInfo::target for a link or highlight in a scaled subtree is scaled the scale applied to a rect that is already in layout coordinates span_boxes
Tx::keep_on_screen on a virtual row in a scaled viewport jumps the scroll saved in drawn points, restored in layout points one unit (layout points), as the hold inset already used
Exiting elements still answer key lookups, hide live replacements from active_descendant, and their children still hover each lookup had its own filter, some after the search live_named, and subtree_exiting for hover
A control nested in a focusable tab is announced as an unselected member of the tab's group; focus can fall back to a collapsed control accessibility walked past intermediate focusable items; the fallback skipped the size check focus_group and one can_take_focus

Each row has its own entry in changelog/unreleased/.

Left out

  • Layout reads on a stuck element. The audit also proposed making Cx::window_layout and El::on_layout report a stuck header's pinned position, to agree with anchored popovers. El::sticky_top documents the opposite (layout does not move; on_drawn_layout and ElementInfo::rect follow the drawn place), and an app can compare the two to tell when a header is stuck, so this is unchanged.
  • page_scroll_x in right-to-left web documents. The DOM bridge creates its scroll containers without dir="rtl" and reads scrollLeft directly; fixing the sign needs a matching change in bridge.js.

Hona added 2 commits November 19, 2026 14:17
…p hit guard as they were, and give each fix its own changelog entry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant