Repository navigation
Leave root attributes a revision does not change where they stand - #1370
Merged
Merged
Conversation
Activating a revision took every authored attribute, class token and inline declaration off `html` and `body` and put the arriving revision's back on, including the ones both revisions write. A class taken off `body` and put back restyles the whole document, so every corpus revision paid a full restyle for attributes that had not changed: about 150 ms of style and a 63 ms attribute pass per revision, measured with scripts/profile_page.py (install task 313-357 ms before, 160-188 ms after, 3 runs each). replaceAuthoredAttributes now takes off only what the outgoing revision wrote and the arriving one does not, and writes only what differs, through the layer's identical-write rule (`keeps`). Runtime-owned attributes and inline properties still survive, as before. New test: a revision that changes only the title makes no authored attribute write on either root. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
reviewed
Sep 27, 2026
leaf-agent
left a comment
Collaborator
There was a problem hiding this comment.
An unchanged empty CSS custom property is removed during revision activation; the inline suggestion checks whether the property is declared.
An empty custom property (--x: ;) reads back as "", so the removal pass took an unchanged one for undeclared, and setProperty with "" removes rather than declares, so a newly declared one never went on (as before this branch). Declarations are now compared by name, and an empty one is written as the single space that parses to it. The root-attribute test covers both. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
leaf-agent
approved these changes
Sep 27, 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.
Activating a revision took every authored attribute, class token and inline declaration off
htmlandbodyand put the arriving revision's back on, including the ones both revisions write. A class taken offbodyand put back restyles the whole document, so every corpus revision paid a full restyle for attributes that hadn't changed. This came out of re-profiling revisions after the recent performance PRs (#1321, #1324, #1334).replaceAuthoredAttributesnow takes off only what the outgoing revision wrote and the arriving one doesn't, and writes only what differs, through the layer's identical-write rule (keeps). Declarations are compared by name, so an empty custom property (--x: ;, which reads back as"") stays, and a newly declared empty one is written as the single space that parses to it, sincesetPropertywith""removes; the old code dropped both. Runtime-owned attributes and inline properties survive, as before; the existing live-revision test covers adding, retiring and the runtime-owned--lf-thread-panel-width.Measured on the corpus with
scripts/profile_page.py corpus revision(3 runs each, current main, load ~20):Most of what's left in that task is
reachScrollers, which #1340 takes down separately; the two together bring style per revision to about 15 ms.New test: a revision that changes only the title makes no authored attribute write on either root. It fails on the old code.
🤖 Generated with Claude Code