Repository navigation
fix: credit a choice's label with its focused checkbox's ring in the ring probe - #5497
Conversation
…ring probe #5230 made visual review's "Looks right" a `.choice`, whose label wears the focus ring for its checkbox (`--lf-wears-ring: 1`, controls.css). The test probe's `carriesFocus` didn't know that declaration, so it read the label's ring as not the focused control's and `current_location_ring` found none, although the ring was painted. The probe now credits the nearest box around the focused control that declares `--lf-wears-ring: 1`, the box the runtime's `ringBox` (focus.js) already names. No behavior a user sees changed. Closes #5460
|
@leaf-agent The ring probe now credits the right label, but its new
|
…ringBox The ring probe's own walk for `--lf-wears-ring` copied `ringBox` (focus.js). check-api.js now exports `ringBox`, and `ringsDrawn` credits the box it names with the focused control's ring. The probe still measures ring paint itself, and its proxy and projected-ring cases are unchanged. `seenStop` keeps its ancestor walk, which already reaches a wearing label.
|
Done in 3de453e: The claimed journey ( |
#5230 made visual review's "Looks right" checkbox a
.choice, and a choice's label wears the focus ring for its input (:is(.lf-choice, .choice):has(> input[data-lf-focus-visible])sets--lf-wears-ring: 1,browser/styles/components/controls.css). The ring is painted on the label, but the test probe'scarriesFocus(tests/page_scripts/focus_rings.js) didn't recognise that declaration, so it marked the label's ring as not the focused control's andcurrent_location_ringreturnedNone.ringsDrawnnow credits the box the runtime'sringBox(browser/runtime/focus.js, exported throughbrowser/runtime/check-api.js) names for the focused control, so the probe and the runtime share one reading of which box wears a ring. Only the test probe and the diagnostic check API change; nothing a user sees changes.git bisect runover the scheduled-run range19757c94c59b..8b759a5663b5found #5230 (b63836193) as the first commit where the journey fails withthe focused destination paints no keyboard ring.test_an_authenticated_navigation_journey_becomes_credential_free_review_evidence(--run-nightly) fails on main and passes with this change.The same step also unblocks
test_visual_review_keeps_its_inline_comment_editor_in_view_after_phone_resize[600|760]. Its earlierassert_keyboard_focuscalls now pass, and it fails later, at line 206, with{'unobscured': False, 'inViewport': False}. #5475 (#5228) already owns that failure.Other probe consumers run
Passed with the change:
tests/browser/controls/test_rings.py, the rest oftests/browser/test_render_visual_review_journey.py,test_a_key_onto_a_control_at_a_scrollers_edge_shows_its_ring,test_escape_on_a_declaring_control_does_exactly_what_it_says,test_a_label_press_keeps_the_controls_current_keyboard_location, twotest_render_pages.pyring tests, andtests/journeys/test_render_controls.py(Chromium). Two tests failed both with and without the change, so the change didn't cause them:test_trace_pointer_annotation_stays_inside_the_panned_image_viewport(ring 5px outside the image viewport) andtest_each_sampled_focus_ring_is_shown_whole_in_its_surface(the diff file's inline response, which #5496 targets).Closes #5460 — automated triage