Changeset 206990 in webkit
- Timestamp:
- Oct 10, 2016 1:19:03 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r206981 r206990 1 2016-10-09 Antti Koivisto <antti@apple.com> 2 3 Enable optimized stylesheet updates in shadow trees 4 https://bugs.webkit.org/show_bug.cgi?id=163180 5 6 Reviewed by Darin Adler. 7 8 * fast/shadow-dom/scoped-style-invalidation-expected.txt: Added. 9 * fast/shadow-dom/scoped-style-invalidation.html: Added. 10 1 11 2016-10-09 Gyuyoung Kim <gyuyoung.kim@navercorp.com> 2 12 -
trunk/Source/WebCore/ChangeLog
r206989 r206990 1 2016-10-09 Antti Koivisto <antti@apple.com> 2 3 Enable optimized stylesheet updates in shadow trees 4 https://bugs.webkit.org/show_bug.cgi?id=163180 5 6 Reviewed by Darin Adler. 7 8 When we get a new stylesheet (for example when load completes) we invalidate only 9 those elements in DOM that are affected by the new sheet. This patch makes the 10 optimization also work in shadow trees. 11 12 Test: fast/shadow-dom/scoped-style-invalidation.html 13 14 * css/StyleInvalidationAnalysis.cpp: 15 (WebCore::StyleInvalidationAnalysis::invalidateStyle): 16 * css/StyleInvalidationAnalysis.h: 17 * dom/Document.cpp: 18 (WebCore::Document::didRemoveAllPendingStylesheet): 19 * style/StyleScope.cpp: 20 (WebCore::Style::Scope::removePendingSheet): 21 (WebCore::Style::Scope::analyzeStyleSheetChange): 22 (WebCore::Style::Scope::updateActiveStyleSheets): 23 1 24 2016-10-10 Youenn Fablet <youenn@apple.com> 2 25 -
trunk/Source/WebCore/css/StyleInvalidationAnalysis.cpp
r196864 r206990 170 170 } 171 171 172 void StyleInvalidationAnalysis::invalidateStyle(ShadowRoot& shadowRoot) 173 { 174 ASSERT(!m_dirtiesAllStyle); 175 176 for (auto& child : childrenOfType<Element>(shadowRoot)) { 177 SelectorFilter filter; 178 invalidateStyleForTree(child, &filter); 179 } 180 } 181 172 182 void StyleInvalidationAnalysis::invalidateStyle(Element& element) 173 183 { -
trunk/Source/WebCore/css/StyleInvalidationAnalysis.h
r204466 r206990 36 36 class RuleSet; 37 37 class SelectorFilter; 38 class ShadowRoot; 38 39 class StyleSheetContents; 39 40 … … 46 47 bool hasShadowPseudoElementRulesInAuthorSheet() const { return m_hasShadowPseudoElementRulesInAuthorSheet; } 47 48 void invalidateStyle(Document&); 49 void invalidateStyle(ShadowRoot&); 48 50 void invalidateStyle(Element&); 49 51 -
trunk/Source/WebCore/dom/Document.cpp
r206975 r206990 3084 3084 m_needsNotifyRemoveAllPendingStylesheet = false; 3085 3085 3086 styleScope().didChangeCandidatesForActiveSet();3087 3088 3086 if (m_pendingSheetLayout == DidLayoutWithPendingSheets) { 3089 3087 m_pendingSheetLayout = IgnoreLayoutWithPendingSheets; -
trunk/Source/WebCore/style/StyleScope.cpp
r206951 r206990 130 130 } 131 131 132 if (m_shadowRoot) { 133 // FIXME: Make optimized updates work. 134 didChangeContentsOrInterpretation(); 135 return; 136 } 137 138 m_document.didRemoveAllPendingStylesheet(); 132 didChangeCandidatesForActiveSet(); 133 134 if (!m_shadowRoot) 135 m_document.didRemoveAllPendingStylesheet(); 139 136 } 140 137 … … 301 298 if (invalidationAnalysis.dirtiesAllStyle()) 302 299 return styleResolverUpdateType; 303 invalidationAnalysis.invalidateStyle(m_document); 300 301 if (m_shadowRoot) 302 invalidationAnalysis.invalidateStyle(*m_shadowRoot); 303 else 304 invalidationAnalysis.invalidateStyle(m_document); 305 304 306 requiresFullStyleRecalc = false; 305 307 … … 347 349 return; 348 350 } 349 350 // FIXME: Support optimized invalidation in shadow trees.351 if (m_shadowRoot)352 updateType = UpdateType::ContentsOrInterpretation;353 351 354 352 m_didUpdateActiveStyleSheets = true;
Note: See TracChangeset
for help on using the changeset viewer.