Skip to content

fix: name the contents map's label class so focus and Go-to restyle no page link - #7505

Merged
leaf-agent merged 2 commits into
mainfrom
fix/issue-7499
Nov 28, 2026
Merged

leaf-agent merged 2 commits into
mainfrom
fix/issue-7499

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

Focus entering main and Go-to arming each restyled every link on the page again, so test_entering_the_column_or_go_to_restyles_no_cell_or_link_it_passes has failed on every push to main since #7457 ({'20 rows': {'entering': 434, 'Go-to': 549}, '120 rows': {'entering': 534, 'Go-to': 649}}: exactly one more restyle per row's link).

The cause is the selector, not the port's display: contents wrappers. #7457 replaced a[data-lf-toc-shown] with a:not([data-lf-toc-off]) in the two toc.css rules that let the map's labels take the pointer (one under lf-toc:is(:hover, [data-lf-focus-within]), one in the body[data-lf-go-to-active] scope). A :not() gives Chromium nothing to narrow its invalidation by, so the subject came down to the type a. When main gains data-lf-focus-within or body gains data-lf-go-to-active, Chromium restyles every a beneath it, whether or not the rule matches there. browser/AGENTS.md, "What a style rule costs", names this case and asks for a class only the targets carry. The subjects now read .lf-toc-link:not([data-lf-toc-off]). That class is on every label link the view draws (lf-toc.ts's link) and on nothing else in the labels layer, so the rules match the same links and nothing on screen changes.

Verification on the Tend runner:

  • The restyle test fails on main with the counts above and passes with this change.
  • The lf-toc label and reveal tests pass: test_a_route_too_long_for_its_labels_leaves_its_deepest_level_off_the_map, test_the_outline_beside_the_body_marks_its_introduction_on_its_label, and both directions of test_a_contents_spine_rests_beside_the_prose_and_reveals_its_labels_over_it.

No other rule under browser/ or packages/ reads either mark before a type-only subject.

Closes #7499 — automated triage

…o page link

#7457 rewrote the rules that let the contents map's labels take the
pointer as `.lf-toc-labels a:not([data-lf-toc-off])`. With only a type
and a `:not()` in the subject, Chromium answers a change to
`data-lf-focus-within` (set on `main` as focus enters it) or
`data-lf-go-to-active` (set on `body`) by restyling every `a` beneath
the changed element, so each gesture restyled one more element per link
on the page. The subject now names `.lf-toc-link`, which every label
link carries and nothing else does, as browser/AGENTS.md, "What a style
rule costs", asks. The rules match the same links, so nothing drawn
changes; test_entering_the_column_or_go_to_restyles_no_cell_or_link_it_passes
fails before and passes after.

Closes #7499
@leaf-agent
leaf-agent merged commit 3f692ba into main Nov 28, 2026
8 checks passed
@leaf-agent
leaf-agent deleted the fix/issue-7499 branch November 28, 2026 08:03
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_entering_the_column_or_go_to_restyles_no_cell_or_link_it_passes: entering restyles hundreds of nodes since #7457 ported lf-toc

1 participant