Changeset 128128 in webkit
- Timestamp:
- Sep 10, 2012 4:26:34 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r128127 r128128 1 2012-09-10 Dimitri Glazkov <dglazkov@chromium.org> 2 3 Reduce the number of treeScope queries when matching rules. 4 https://bugs.webkit.org/show_bug.cgi?id=96315 5 6 Reviewed by Eric Seidel. 7 8 In the worst case, treeScope() requires a HashMap lookup, which could be slow. Since the value is always the same for the element, 9 we can just ask for it once. 10 11 No new tests, no change in behavior. 12 13 * css/StyleResolver.cpp: 14 (WebCore::StyleResolver::collectMatchingRulesForList): Moved the call to treeScope out of the loop. 15 1 16 2012-09-10 Adam Barth <abarth@chromium.org> 2 17 -
trunk/Source/WebCore/css/StyleResolver.cpp
r127869 r128128 1072 1072 if (!rules) 1073 1073 return; 1074 1075 TreeScope* treeScope = m_element->treeScope(); 1076 1074 1077 // In some cases we may end up looking up style for random elements in the middle of a recursive tree resolve. 1075 1078 // Ancestor identifier filter won't be up-to-date in that case and we can't use the fast path. … … 1094 1097 // c) the rules comes from a scoped style sheet within the same tree scope 1095 1098 // d) the rule contains shadow-ID pseudo elements 1096 TreeScope* treeScope = m_element->treeScope();1097 1099 if (!MatchingUARulesScope::isMatchingUARules() 1098 1100 && !treeScope->applyAuthorStyles()
Note: See TracChangeset
for help on using the changeset viewer.