Skip to content

test: read the forced-colors focus outline on the box that wears the panel field's ring - #5997

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-3985-forced-colors-ring
Nov 15, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-3985-forced-colors-ring

Conversation

@leaf-agent

@leaf-agent leaf-agent commented Nov 15, 2026 •

Copy link
Copy Markdown
Collaborator

#5963 moved the floating panel field's focus ring from .lf-compose-field to its slot, .lf-fp-field, which declares --lf-wears-ring: 1. test_forced_colors_restore_a_real_outline_to_shadow_focused_fields still read the outline on .lf-compose-field, which is now none, so it failed on main even though forced-colors mode still draws the ring (solid 2px on .lf-fp-field). This PR changes only the test. It now reads the outline of the box the runtime rings for the focused field, through the check API's ringBox (focus.js), so it follows the ring wherever a surface's styles put it without a second copy of that rule. It still checks the same behavior: in forced colors, the focused comment field has a real outline.

The test passes on #5963's parent 06948a8d6, fails on 03c0f70a6 (#5963) and on current main with {'style': 'none', 'width': '3px'}, and passes on this branch. All runs were local Chromium with -n0. It failed in push run 43644692490, tracked in #3985. Other failures in that run have their own owners, so this PR doesn't close the report.

Refs #3985 — automated triage

…panel field's ring

#5963 moved the panel field's focus ring from .lf-compose-field to its
slot, .lf-fp-field, which declares --lf-wears-ring: 1. The forced-colors
test still read .lf-compose-field, whose outline is now none, so it
failed although the ring is drawn (solid 2px on .lf-fp-field). It now
reads the nearest box declaring --lf-wears-ring: 1, the box focus.js's
ringBox paints, so it follows the ring wherever a surface's styles put
it. The protected behavior, a real outline on the focused comment
field in forced colors, is unchanged.

Refs #3985

@leaf-agent leaf-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new climb copies ringBox (focus.js) instead of calling it, and the copy already differs: it walks parentElement, where ringBox walks renderedParent and only climbs from a focused node. If the two disagree, the test checks a box the runtime doesn't ring, and tests/page_scripts/focus_rings.js notes that copies of this reading have drifted before. The check API exports ringBox, so calling (await window.__lfCheckApi()).ringBox(el) gives the same assertion with no second copy of the rule. I'll push that change. It passes locally, and the box it reads is .lf-fp-field.

The test climbed for --lf-wears-ring itself with parentElement, a second copy
of focus.js's ringBox that already walked differently (renderedParent, focused
nodes only). Asking ringBox reads the box the runtime rings. Same assertion.
@leaf-agent
leaf-agent merged commit 17cb051 into main Nov 15, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-3985-forced-colors-ring branch November 15, 2026 00:40
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