Repository navigation
Seat every key chip by one reading test, and seat a chip for an SVG drawing's HTML where Chromium can't anchor it - #5897
Merged
Merged
Conversation
…eat, and seat a chip for an SVG drawing's HTML where Chromium can't anchor it A survey of every example, gallery and docs page in Go-to and the target picker, at three window sizes and up to five scroll positions, found two key-chip defects: - A picker chip placed before a target with another target beside it, as in a row of cards or buttons or a film's slots, stood on that neighbour and read as the neighbour's. It now stands above its own target, as a control's does, where no other target stands there; where one does, as in a grid of buttons, it keeps its target's corner as before. Standing above unconditionally was tried and put chips over neighbours' words, such as alert-thresholds' radio labels. - Chromium resolves no anchor() to an element inside a foreignObject, so wt-merge's Go-to chip for its terminal line stood at -9999px while its code still worked. anchorReaches reads such an anchor as out of reach, so the box stands where its target was measured. Two picker tests counted every chip after a typed letter. Since #5845 a letter hides the chips it rules out, so they count visible chips.
leaf-agent
previously approved these changes
Nov 12, 2026
…above where the window lets it stand Review found the anchorReaches refusal missed a foreignObject inside a shadow tree and left margin rows and floating cards, which anchor without asking it, at -9999px. anchorElement now anchors any element in a foreignObject through the drawing's svg, as it does the drawing's own shapes, so every consumer gets an anchor Chromium resolves and the box follows the drawing through a scroll. The refusal goes. The seat above was checked before the window's edge moved it, so a chip pushed in from the right edge could land on the target above and left of its own. It is now checked where it will stand.
leaf-agent
previously approved these changes
Nov 12, 2026
…side it anchorElement checked nameability before climbing to the drawing's svg, so a drawing in a shadow tree with an authored anchor-name lost that name to Leaf's. The climb now comes first. The note records that a scroller inside a drawing's HTML doesn't carry boxes anchored through the drawing.
leaf-agent
previously approved these changes
Nov 12, 2026
seatHints judged a seat by two tests: whether it stood on another target (coversAnother), which chose between the seat before and the seat above and sent a before chip that failed it to its target's corner height, and whether a moved chip stood nearer another row (readsAs). Every seat a chip may take now passes one test, readsAs: its middle stands on no other target but where it stands on its own, and no target in its column, or its own target's, has rows nearer its middle. Each placement offers its seats in order, before then above for an owner, above then before for a control, and a chip whose outside seats both fail stands on its own target's corner, as a Go-to chip does. Behavior that changes: a picker chip in the gutter beside a card stands level with its target instead of half a row up; a control chip whose seat above reads as the control above stands before it; alert-review's option cards keep their chips on their own corners, not the left card's; a chip that could stand only on a narrower neighbour, as on rust-sort's film in narrow windows, is withheld. The unused "below" placement is gone. A Euclidean nearest-target test was tried first and read worse on a blind review of 14 views; it moved gutter chips onto radio buttons and headings.
# Conflicts: # tests/browser/test_render_semantic_selection.py
`readsAs` rejected a seat only where the chip's middle stood on another target and not on its own. A crowded column's chip could then step out past a narrow target beside the column and stand before it, its middle clear of that target but the target between the chip and its own (Codex review of the previous commit). Now a seat off its own target fails where any other target stands between the chip's middle and the nearest point of its own target. The test is strict, so targets sharing an edge with that stretch, such as footnote markers side by side, tie rather than block; two chips on alert-thresholds that were withheld for that tie now stand. Across the 45-page survey this moves 13 picker chips against the previous commit, and none in Go-to. A test pins the crowded-column case as withheld. The comments on `nearestOpenTop`, the corner fallback and the target picker's placements now say what the code does: `nearestOpenTop` offers only the preferred top, the window's edges and each barrier's edges.
leaf-agent
previously approved these changes
Nov 14, 2026
A hint code draws each letter as its own keycap, 1px from the next, and chips could touch side by side. On rust-sort's film the picker's two-letter chips stood flush above their slots, so `na` `nd` `ng` read as `n a n d n g`, and the user read the letters down the rows instead. Placed chips now count as barriers 6px to either side, so two chips level with each other stand at least 6px apart; stacked chips keep the 2px gap, since a code reads across. A crowded column's outer chips step out by the same 6px. The user chose this over drawing each code as one keycap, which would have lost the pressed face of a code's first typed letter, and accepted that more chips are withheld. Tests: the crowded-column lefts move 4px further out, the film case's first slot chip stands below the film's chip rather than touching it, and a new case pins the gap (it fails at 0px).
leaf-agent
previously approved these changes
Nov 14, 2026
leaf-agent
previously approved these changes
Nov 14, 2026
A target narrower than a key (a chip's height), with another as narrow beside it on its line less than a key away, now gets no chip in either map. Rust-sort's film slots in the two smaller windows are 13px wide: every chip seat beside one stood over a neighbouring slot, so the picker withheld some and scattered the rest, and the user judged them too small and bunched to be worth chips. Each such member stays in the map, so its code still takes it and a walk onto it shows its chip. Across the 45-page survey the rule matches only those film slots, in the picker; no Go-to target, and no contents list, whose rows stack one under another rather than side by side. It also withholds adjacent footnote markers' chips, which were stacked above and below the markers, where no chip said which marker it named; no shipped page has them, and the crowded fixture's test now checks they keep their codes without chips. A narrow target beside a wide one, as an icon beside a field, keeps its chip.
leaf-agent
approved these changes
Nov 14, 2026
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.
A survey of every example, gallery and docs page (45), at three window sizes and up to five scroll positions, in Go-to (
g) and the target picker (s), found two key-chip defects that #5845 left. This fixes both.A picker chip stood on its neighbour. A picker chip stands before its target, and where targets sit side by side, as cards in a row, buttons or a film's slots, that seat is on the target to the left, so the chip read as that one's.
seatHintsnow judges every seat a chip may take by one test,readsAs: the chip stands within a chip's height of its own target; off its own target, no other target stands between the chip's middle and the nearest point of its own; and no target in its column, or in its own target's, has rows nearer its middle. Each placement offers its seats in order, before then above for an owner and above then before for a control, and a chip whose outside seats both fail stands on its own target's corner, as a Go-to chip does. This replaces the split betweencoversAnotherandreadsAs, the corner-height fallback (levelTop) and the unusedbelowplacement. Chips level with each other also stand at least 6px apart: a code draws each letter as its own keycap 1px from the next, so touching two-letter chips read as single letters (nangasn a n g). A target narrower than a keycap, with another as narrow beside it on its line, gets no chip, since no seat beside it says which of the run it names; its code still takes it and a walk onto it shows its chip. Across the 45 pages, picker chips standing on another target fell from 184 on main to 1, and eight of Go-to's 2,768 chips moved.To weigh: 96 more picker chips than on main are withheld (hidden until Tab reaches them), 80 of them every slot of rust-sort's film in the two smaller windows, whose 13px slots fall under the narrow-run rule; the user judged those too small and bunched to be worth chips. The narrow-run rule matches nothing else in the survey: contents lists stack their rows one under another, and no Go-to target qualifies. It would also withhold adjacent footnote markers' chips, which were stacked around the markers; no shipped page has them, and the crowded fixture's test now checks they keep their codes. And 27 more chips overlap another target at their edge though their middle stands clear, 14 of them two-letter chips on rust-sort's film at 1440px, which overhang the next slot. The user chose the gap over drawing a code as one keycap, which would lose the pressed face of its first typed letter. A nearest-target test (distance from the chip's middle to each target) was tried first and read worse: it counts a card's edge across a gutter as nearer than the choice beside it, and moved gutter chips onto radio buttons and headings. In a blind review of 14 changed views, an earlier form of this test was ranked best in 6 and worst in 4, against 4 and 5 for the survey's first fix.
nearestOpenToptries only the preferred top, the window's edges and each barrier's edges, so a chip clamped at the window's edge can be withheld where a lower top would read as its own; before this change that chip stood on the other target. Stills are on the Leaf page.A chip for an element inside an SVG
<foreignObject>stood at -9999px. Chromium resolves noanchor()to such an element (Firefox and WebKit do), so wt-merge's Go-to chip for its terminal line was off the window while its code still worked; review reproduced a margin row there at -9999px too.anchorElementnow anchors any element in aforeignObjectthrough the drawing's<svg>, which every engine resolves, as it already did the drawing's own shapes, with insets measured from the drawing. It climbs the rendered tree, so a drawing inside a shadow tree counts too, and asks whether the document can name the drawing rather than the element inside it. A scroller inside a drawing's HTML doesn't move the drawing, so a mark there stays put while it scrolls until it is placed again; no shipped page does that. The gap is recorded innotes/browser-support.md.The user asked for the survey as a follow-up to #5845, and for the single test after it; Codex reviewed the test twice. Tests: runtime suite,
check:browser, a new Go-to test for the foreignObject chip (fails without the fix), seating cases for the gutter, a pixel-overlapped corner, a crowded column's chip stepping past a narrow neighbour, the 6px gap and a narrow run against stacked narrow rows (each fails with its rule removed), and the picker and Go-to browser tests.