Repository navigation
Name the declarations behind each computed-style difference in leaf-dev stills - #4713
Merged
Merged
Conversation
…ev stills For the first element of each style group, `styles.txt` now lists the declarations Chromium's inspector reads as matching it in only one arm, or in another order, each labelled with its sheet, layers, scope and selector. That names the rule a change added, removed, edited or moved, which sessions had been finding by hand with their own CDP scripts. Both arms' tabs now stay open through the comparison so the inspector can read them. It lists declarations rather than naming a winner. Working out which declaration wins would take a partial cascade: shorthands whose longhands wait on var(), logical properties, !important across layers, and shadow-tree contexts. Replayed against #4637's base (ae2e3f3) on the corpus state, it names both causes that session found by hand: `:where(:root) { color: revert; font-family: revert }` behind html's colour and font, and `lf-options:has(> lf-option > strong) > .lf-another { font: inherit }` behind the Another option form's change to the reading face.
…ate capture as a Generator #4686 launched stills' browser with ignore_default_args, which the test's headless_shell stand-in refused, so all three stills tests failed on main. ty (#4647) asks a @contextmanager to return Generator.
leaf-agent
approved these changes
Oct 30, 2026
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.
leaf-dev stillsnow says which rule is behind each computed-style difference it reports. Under the grouped differences instyles.txt, it takes each group's first element and lists the declarations that match it in only one arm, or in a different order, each labelled with its sheet,@layer,@scopeand selector. The declarations come from Chrome's DevTools protocol (CSS.getMatchedStylesForNode). Two of the sessions surveyed for #4648 wrote this lookup by hand to find a cause.What it shows
Replayed against #4637's base (
leaf-dev stills ae2e3f34f --state on-me, about 2 minutes), it names both causes that session found by hand:It also names a later commit's
:nth-child(1 of :not(.lf-ui, [data-lf-gen])) { margin-block-start: 0 }behind a paragraph's margin change. Where an element's declarations match on both arms, such as the hidden-widget noise, it saysnone: it inherits the difference or reads it from a custom property. A separate probe read an element inside lf-diff's shadow tree on pr-walkthrough, which is where the.lf-uireorder regression appeared.Design
font: var(...)leave their longhands blank in the protocol, and on top of that it would need logical properties,!importantacross layers, and shadow-tree ordering. Listing what changed, in the protocol's order, avoids all of that, and the reader infers the winner. A declaration that moved shows as a-line and a+line with the same text.constructed,<style>oruser-agent. Never a URL, since an inline sheet's URL is its document's and includes the arm's port.captureis now a context manager, so the comparison can read both tabs afterstyle_changeshas found which elements differ.Also here
main's stills tests have failed since #4686, which launches the browser withignore_default_args; the test's stand-in forheadless_shellnow accepts launch options.captureis annotated as aGenerator, as ty (#4647) asks.