Use resolveProperty callback for lazy computed style resolution#4085
Closed
Use resolveProperty callback for lazy computed style resolution#4085
Conversation
3886d9f to
a9052d8
Compare
0db0c9d to
511e5bf
Compare
48a0cb9 to
9fdae31
Compare
e674b6b to
2dd0321
Compare
Member
Author
Contributor
|
I'm thinking of going in the direction of #4119. |
Member
Author
|
Great! Maybe I should do a release without either first, to get the minor bug fixes released. Regarding which approach is better, I am happy to let you take the lead. Maybe we can combine them. I think we can judge which is based based on:
|
6a8f97d to
98a3ae9
Compare
Replace the hardcoded property table in computed-style.js with a dynamic getPropertyMetadata() function that reads from the generated css-property-definitions.js. Instead of eagerly pre-computing all property values, pass a resolveProperty callback to CSSStyleDeclaration that lazily resolves values on-demand when getPropertyValue is called. Benchmarks show 6-22x improvement on getComputedStyle operations, with the biggest gains on the warm-cache path (13-14x) since properties are now resolved only when accessed rather than all up front. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
98a3ae9 to
45fff87
Compare
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.
Lazy computed style resolution via a
resolvePropertycallback, replacing the hardcoded property table with metadata derived from the generated property definitions.