Skip to content

Guard the chrome's elements only, dropping its pseudo-element parts and the zoom workaround - #4664

Merged
max-sixty merged 2 commits into
mainfrom
zoom-crash
Oct 29, 2026
Merged

max-sixty merged 2 commits into
mainfrom
zoom-crash

Conversation

@max-sixty

Copy link
Copy Markdown
Owner

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

…nd the zoom workaround

The 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 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, toggling the guard's selector in place:
- Authored CSS of 194 sources (the page directories under ~/.local/state/leaf/pages, examples and docs, those with a <style>) over review-a-plan's chrome: none changes any rendered chrome pseudo-element. Only five have a pseudo-element rule that isn't scoped to the page's own classes, and the one universal rule is `!important`, which the guard never stopped.
- Leaf's own rules, no page CSS, across 88 stills states covering the panel, cards, composer, menus, image viewer and command reference: no rendered chrome pseudo-element changes.
# Conflicts:
#	browser/styles/chrome-guard.css
@max-sixty
max-sixty merged commit 87c34f5 into main Oct 29, 2026
4 checks passed
@max-sixty
max-sixty deleted the zoom-crash branch October 29, 2026 08:07
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.

2 participants