Skip to content

Restate zoom in the chrome guard so Chrome 155 renders pages at any zoom - #4640

Merged
max-sixty merged 1 commit into
mainfrom
zoom-crash
Oct 28, 2026
Merged

max-sixty merged 1 commit into
mainfrom
zoom-crash

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

Since #4480, .lf-chrome ::after { all: revert-layer } crashed Chrome's renderer on load whenever page zoom or device scale wasn't 1. The issue narrowed it to zoom and view-timeline-inset both reverting on the floating panel's ::after. No Leaf rule sets zoom, so normal is the value the revert reached anyway; the guard now restates zoom: normal after the reset, which keeps every computed value and stops the crash.

Verified in Chrome for Testing 155.0.8059.79 on macOS, serving ideas-to-implement with a profile default zoom: before the change the tab crashed at 0.9, 1.1 and 1.5 and rendered at 1; after it, all four render. Stable Chrome 156.0.8078.49 doesn't crash on either side, so no regression test can see this on current Chrome or in the headless shell the suite uses. The guard's existing tests (test_layout.py -k "stop_at_the_chrome or coined_class") pass.

Closes #4536

This was written by Claude Code on behalf of max-sixty

…any zoom

`all: revert-layer` on the floating panel's ::after crashed Chrome 155's renderer whenever page zoom or device scale wasn't 1. No Leaf rule sets zoom, so `zoom: normal` is the value the revert reached; restating it keeps the computed style and avoids the crash.

Closes #4536
@max-sixty
max-sixty merged commit 13b1289 into main Oct 28, 2026
4 checks passed
@max-sixty
max-sixty deleted the zoom-crash branch October 28, 2026 22:29
max-sixty added a commit that referenced this pull request Oct 29, 2026
…nd the zoom workaround (#4664)

The chrome guard's `::before`, `::after` and `::placeholder` parts came
with #4480 as parity with `page-sheets.js`, which excluded the chrome
from every page selector, pseudo-elements included. They were the part
that crashed Chrome 155's renderer at any zoom but 100% (#4536), which
#4640 worked around with `zoom: normal`. Without them the guard needs no
workaround: Chrome for Testing 155.0.8059.79 renders at 0.9, 1.1 and 1.5
with `.lf-chrome, .lf-chrome * { all: revert-layer }`, and still crashes
with the pseudo parts kept and the zoom line removed.

Behavior that changes: a page rule aimed at a pseudo-element with a bare
or universal subject now reaches the chrome, such as `::placeholder {
font-style: italic }` on the composer's placeholder, `button::after {
content }` on its buttons, or a `*::after` margin/padding reset on its
hit areas. Inherited faces still stop, since a pseudo-element inherits
from its guarded element. `test_a_pages_light_rules_stop_at_the_chrome`
no longer asserts the placeholder case.

Measured on 2026-10-28 by toggling the guard's selector in place:
- The authored CSS of 194 sources (the page directories under
`~/.local/state/leaf/pages`, the examples and the docs, those with a
`<style>`), laid over review-a-plan's chrome, changes no rendered chrome
pseudo-element. Only five have a pseudo-element rule not scoped to the
page's own classes, and the one universal rule is `!important`, which
the guard never stopped.
- Leaf's own rules, with no page CSS, change no rendered chrome
pseudo-element across 88 `leaf-dev stills` states covering the panel,
cards, composer, menus, image viewer and command reference.

> _This was written by Claude Code on behalf of max-sixty_
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.

Every page crashes Chrome's renderer at any page zoom other than 100% since #4480

2 participants