Repository navigation
test: read the forced-colors focus outline on the box that wears the panel field's ring - #5997
Merged
Merged
Conversation
…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
commented
Nov 15, 2026
leaf-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
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.
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.
#5963 moved the floating panel field's focus ring from
.lf-compose-fieldto its slot,.lf-fp-field, which declares--lf-wears-ring: 1.test_forced_colors_restore_a_real_outline_to_shadow_focused_fieldsstill read the outline on.lf-compose-field, which is nownone, so it failed onmaineven though forced-colors mode still draws the ring (solid 2pxon.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'sringBox(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 on03c0f70a6(#5963) and on currentmainwith{'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