-
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.
[view-transitions] Resolving styles with a large set of named view-tr…
…ansition elements is slow. https://bugs.webkit.org/show_bug.cgi?id=274739 <rdar://128774070> Reviewed by Antti Koivisto. For every named element in a view transition, 4 styles are inserted in the UA style sheet. View transitions currently restyle the entire view transition pseudo tree for changes to any of them (since mutations are keyed to the owning element, which is the document element for the whole tree). There are 4 named pseudo elements per view transition name, resulting in pretty slow O(n^2) restyling. We can improve this somewhat by putting pseudo element selectors with a name argument (like ::view-transition-group(name)) into a hash map, so that we only need to iterate the somewhat-relevant ones. * Source/WebCore/style/ElementRuleCollector.cpp: (WebCore::Style::ElementRuleCollector::collectMatchingRules): * Source/WebCore/style/RuleSet.cpp: (WebCore::Style::RuleSet::addRule): (WebCore::Style::RuleSet::traverseRuleDatas): (WebCore::Style::RuleSet::shrinkToFit): * Source/WebCore/style/RuleSet.h: (WebCore::Style::RuleSet::namedPseudoElementRules const): Canonical link: https://commits.webkit.org/279484@main
- Loading branch information
1 parent
bd4296e
commit 4a0a447
Showing
3 changed files
with
19 additions
and
0 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