Repository navigation
Read ring pixels from a whole-window capture, so stills' next shot is whole - #7456
Merged
Merged
Conversation
… whole `leaf-dev stills` reported a false change on `summary-card` in some runs with identical arms: one arm's still showed the margin card's lower half unpainted, everything in it but the caret. The ring reading that stills takes just before each still (`geometry.read` -> `rings_drawn`) confirms covers against a screenshot clipped to the rings' samples. In Chromium, that clipped capture leaves the tab's next capture able to show a tile row of the card layer unpainted. Measured on one tab at the state, 40 captures each, compared with a settled reference shot: with a clipped shot before each capture, 24-29 of 40 captures showed the card's lower tile row blank or re-rastered; with no clipped shot, 0 of 40. The ring reading now takes the whole window through `browser.screenshot` and reads its samples there: 0 of 40, and `leaf-dev stills --base HEAD --state summary-card` reports it unchanged in 5 of 5 runs (2 of 7 showed a change before). Every state captures through the same path, so the fix covers each one whose page draws a focus ring. `browser.screenshot` now says a capture takes the whole window and why.
leaf-agent
approved these changes
Nov 27, 2026
max-sixty
added a commit
that referenced
this pull request
Nov 27, 2026
#7464) `leaf-dev stills` still reported style changes on identical arms in 3 of 63 card and thread states (detached-thread, threads-returning, thread-picture): one arm read an auto margin as 0px and the other as 217px or 336px. `getComputedStyle` reports a margin's used length, which Chromium sometimes misreports as 0px while the box stays put; on one tab it flipped across a style walk or a ring reading. The style walk now reads computed values through `computedStyleMap`, the cascade's own value the stills header already asks for, so the margin reads `auto`. Firefox has no `computedStyleMap` and keeps `getComputedStyle`. The walk costs the same (about 0.3 s on the feature gallery). The three states and summary-card read unchanged in 3 of 3 identical-arm runs, and a `margin-left: 3%` added to the card is still reported, as `0px -> 3%`. A follow-up to #7456, which Max asked to have fixed before this session closed. `dev/tests/model/test_stills.py` passes. > _This was written by Claude Code on behalf of max-sixty_
leaf-agent
added a commit
that referenced
this pull request
Nov 28, 2026
The frame-edge rules in `browser/styles/components/rendered.css` trim the margin of a frame's first and last block, picking the first or last child that isn't chrome (`.lf-ui`), generated (`data-lf-gen`) or a popover. An element that never renders still counted, so a `<style>`, `<script>` or `<template>` beside the real edge block left that block's margin standing: 13px at each end of an author's frame. The rules now also skip `script`, `style` and `template`, as the group rule in `browser/layouts.css` already does. The specificity is unchanged, since `:not()` takes its most specific argument, which stays a class. This is what broke `test_each_sampled_focus_ring_is_shown_whole_in_its_surface` after #7456. Playwright's `style` screenshot option appends an unmarked `<style>` to every shadow root while it captures. Inside `lf-option`'s shadow root that `<style>` became the last child, so the slotted paragraph kept its bottom margin and every option below moved down 13px in the capture. #7456 made the ring reading sample a whole-window capture taken with that option (`browser.screenshot`), so the reading looked for each lower option's ring 13px above where the capture drew it. With the CSS fixed, #7456's whole-window reading stays as it is. **Verification** - New `test_an_element_that_never_renders_does_not_stand_at_a_frames_edge` (tests/browser/test_render_options.py) fails on main with `the frame leaves {'top': 13, 'bottom': 13}` and passes with the change. It also checks that appending a `<style>` to an option's shadow root leaves the option's height unchanged. - The journey test fails on main with the issue's 16 faults over 42 samples and passes with the change (run by node id on Linux). - The other frame tests in `test_render_options.py` and `test_render_gate.py` pass, and so does `tests/model/test_interact_layer.py`. - `uv run leaf-dev stills` across every state against main: every crop is pixel-identical. The only differences are `page-about`, whose source listing prints the edited CSS, and frame noise in the video states. No shipped example has a never-rendering element beside a block at a frame's edge. Closes #7531 — automated triage --------- Co-authored-by: leaf-agent <[email protected]>
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 stillssometimes reported a change onsummary-cardwith identical arms: one arm's still showed the margin card's lower half unpainted, all but the caret. The ring reading stills runs just before each still confirmed covers against a screenshot clipped to its samples, and in Chromium a clipped capture can leave part of the page unpainted in the tab's next capture. The ring reading now reads its samples out of a whole-window capture (browser.screenshot), whose docstring states the rule.On one tab at the state, 40 captures each against a settled reference: a clipped shot before each capture left the card's lower tile row blank or re-rastered in 24–29 of 40; with the fix, 0 of 40.
uv run leaf-dev stills --base HEAD --state summary-cardreports it unchanged in 5 of 5 runs. Every state captures through this path, so the fix covers each one that draws a focus ring.Dispatched by Max from the fold-label work (#7443). Tests: the ring cover-confirmation journey test, a thread ring test and
dev/tests/model/test_stills.pypass.