Skip to content

test: expect a box's own outline over focus alone in the target-boundary test - #5668

Merged
leaf-agent merged 1 commit into
mainfrom
fix/issue-5647
Nov 7, 2026
Merged

leaf-agent merged 1 commit into
mainfrom
fix/issue-5647

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#5524 made focus alone (data-lf-mark="focus") draw Leaf's ring at no weight, so the box's own outline wins. Its comment in surfaces.css says so: "the box's own focus treatment wins, an author's outline or a carrier's". The rounded target in test_target_brackets_and_focus_share_the_visible_boundary has an authored outline: 1px dashed. After Escape it now shows that outline, but the test still expected Leaf's solid 2px ring. That expectation came from before #5524, so this updates it instead of rolling #5524 back.

Behavior the test now protects: focus alone on a box with an authored outline shows the page's outline. The square target has no outline of its own, and it still checks Leaf's focus ring, whole, on the region's perimeter. The aim and a draft's mark still stand over the page's outline on both targets, and the page's outline comes back once no mark stands there.

What stays open: the fixture's dashed outline is decorative, not a focus style. So on a box like this, keyboard focus no longer gets a ring of its own. That follows from #5524's rule, which treats this the same way the focus floor treats every other control. #5525 already asks max-sixty whether focus should keep a ring the page can't remove. This PR doesn't decide that, and if the answer is yes, this subtest's focus step goes back to expecting the ring.

Verification: the test fails on main at a54c1bcea in its rounded subtest ('dashed' == 'solid' at test_render_aim.py:3658) and passes with this change. ruff check and ruff format --check are clean.

Closes #5647 — automated triage

…ary test

#5524 made focus alone (`data-lf-mark="focus"`) draw Leaf's ring at no
weight, so an outline the page gives the box wins. The `rounded` fixture
carries an authored dashed outline, so after Escape it now shows that
outline instead of Leaf's solid 2px ring, and the test still expected the
ring. The behavior the test protects changes: focus alone on a box with an
authored outline shows the page's outline. The square target, which has
none, still checks Leaf's focus ring on the region's perimeter, and every
other mark still stands over the page's outline. Whether focus should keep
a ring a page can't remove stays open in #5525.

Closes #5647
@leaf-agent
leaf-agent merged commit a9db654 into main Nov 7, 2026
6 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-5647 branch November 7, 2026 15:24
max-sixty pushed a commit that referenced this pull request Nov 18, 2026
…ing on a commentable box (#6397)

Records #5525's decision in the header of
`browser/styles/components/surfaces.css`: on a commentable control,
focus alone stands at no weight, so a page's `:focus { outline: none }`
or decorative outline replaces Leaf's ring, as an author's outline
replaces the browser's own focus ring. The header now says the user
chose this and why the `!important` alternative fails (it overrides the
author's focus outline and a ring overlay's `outline: none`, drawing a
second ring outside the overlay's clipping box). This is a comment-only
change. The tests from #5524 and #5668 already expect this behavior.

Refs #5525

Co-authored-by: leaf-agent <[email protected]>
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.

test_target_brackets_and_focus_share_the_visible_boundary fails on main since #5524 let a box's own focus style outrank Leaf's ring

1 participant