[webkit-changes] [WebKit/WebKit] 904f0a: Cache results of selector matching (MatchResult)
Antti Koivisto
noreply at github.com
Fri Jul 5 10:46:36 PDT 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 904f0ad00263d681191e064154cf732f3e6cb6ee
https://github.com/WebKit/WebKit/commit/904f0ad00263d681191e064154cf732f3e6cb6ee
Author: Antti Koivisto <antti at apple.com>
Date: 2024-07-05 (Fri, 05 Jul 2024)
Changed paths:
M LayoutTests/fast/css/style-invalidation-inline-csstext.html
M Source/WebCore/dom/Node.h
M Source/WebCore/dom/StyledElement.cpp
M Source/WebCore/rendering/style/RenderStyle.cpp
M Source/WebCore/rendering/style/RenderStyle.h
M Source/WebCore/style/StyleInvalidator.cpp
M Source/WebCore/style/StyleRelations.cpp
M Source/WebCore/style/StyleRelations.h
M Source/WebCore/style/StyleResolver.cpp
M Source/WebCore/style/StyleResolver.h
M Source/WebCore/style/StyleScope.cpp
M Source/WebCore/style/StyleScope.h
M Source/WebCore/style/StyleTreeResolver.cpp
M Source/WebCore/style/StyleTreeResolver.h
M Source/WebCore/style/StyleValidity.h
M Source/WebCore/testing/Internals.cpp
Log Message:
-----------
Cache results of selector matching (MatchResult)
https://bugs.webkit.org/show_bug.cgi?id=276123
rdar://126281259
Reviewed by Alan Baradlay.
We can avoid selector matching on inline style change by caching the last results of selector matching.
* LayoutTests/fast/css/style-invalidation-inline-csstext.html:
* Source/WebCore/dom/Node.h:
* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):
Add a new InlineStyleInvalid style invalidity state.
* Source/WebCore/rendering/style/RenderStyle.cpp:
(WebCore::RenderStyle::copyPseudoElementBitsFrom):
(WebCore::RenderStyle::outOfFlowPositionStyleDidChange const):
Fix this function (position bits are not in m_nonInheritedData). It was causing failures in achor tests with this patch.
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/style/StyleInvalidator.cpp:
(WebCore::Style::Invalidator::invalidateIfNeeded):
* Source/WebCore/style/StyleRelations.cpp:
(WebCore::Style::copyRelations):
Copy style relations from the existing style.
* Source/WebCore/style/StyleRelations.h:
* Source/WebCore/style/StyleResolver.cpp:
(WebCore::Style::Resolver::initializeStateAndStyle):
Factor into a function.
(WebCore::Style::Resolver::builderContext):
(WebCore::Style::Resolver::styleForElement):
(WebCore::Style::Resolver::styleForElementWithCachedMatchResult):
New version for lookups with cached results.
* Source/WebCore/style/StyleResolver.h:
* Source/WebCore/style/StyleScope.cpp:
(WebCore::Style::Scope::cachedMatchResult):
(WebCore::Style::Scope::updateCachedMatchResult):
Cache in a map in Scope.
* Source/WebCore/style/StyleScope.h:
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::styleForStyleable):
Save and restore per-element match result cache entries.
(WebCore::Style::TreeResolver::resolveElement):
(WebCore::Style::TreeResolver::determineResolutionType):
Use new resolution type for inline-only style changes.
(WebCore::Style::TreeResolver::resolveComposedTree):
* Source/WebCore/style/StyleTreeResolver.h:
* Source/WebCore/style/StyleValidity.h:
* Source/WebCore/testing/Internals.cpp:
(WebCore::styleValidityToToString):
Canonical link: https://commits.webkit.org/280692@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list