Repository navigation
fix: name the contents map's label class so focus and Go-to restyle no page link - #7505
Merged
Merged
Conversation
…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
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.
Focus entering
mainand Go-to arming each restyled every link on the page again, sotest_entering_the_column_or_go_to_restyles_no_cell_or_link_it_passeshas failed on every push tomainsince #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: contentswrappers. #7457 replaceda[data-lf-toc-shown]witha:not([data-lf-toc-off])in the twotoc.cssrules that let the map's labels take the pointer (one underlf-toc:is(:hover, [data-lf-focus-within]), one in thebody[data-lf-go-to-active]scope). A:not()gives Chromium nothing to narrow its invalidation by, so the subject came down to the typea. Whenmaingainsdata-lf-focus-withinorbodygainsdata-lf-go-to-active, Chromium restyles everyabeneath 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'slink) 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:
mainwith the counts above and passes with this change.lf-toclabel 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 oftest_a_contents_spine_rests_beside_the_prose_and_reveals_its_labels_over_it.No other rule under
browser/orpackages/reads either mark before a type-only subject.Closes #7499 — automated triage