-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Inline style should always be cacheable in matched declarations cache
https://bugs.webkit.org/show_bug.cgi?id=260254 rdar://113960228 Reviewed by Alan Baradlay. Mutable inline style (created by modification via JS wrapper) prevents style caching in the matched declarations cache. This patch turns any mutable style immutable during style resolution so we can cache it. Due to deduplication the cache entries can be reused accross elements and mutations. * Source/WebCore/dom/ElementData.cpp: (WebCore::UniqueElementData::UniqueElementData): * Source/WebCore/dom/ElementData.h: Save the immutable style in UniqueElementData. * Source/WebCore/dom/StyledElement.cpp: (WebCore::StyledElement::styleAttributeChanged): (WebCore::StyledElement::invalidateStyleAttribute): Take care to invalidate the cached immutable copy. (WebCore::StyledElement::inlineStyleForStyleResolution const): The accessor constructs ImmutableStyleProperties lazily on demand. * Source/WebCore/dom/StyledElement.h: * Source/WebCore/style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::addElementInlineStyleProperties): Allow caching. Canonical link: https://commits.webkit.org/267035@main
- Loading branch information
Showing
5 changed files
with
34 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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