Changeset 206951 in webkit
- Timestamp:
- Oct 8, 2016 1:42:03 AM (7 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r206949 r206951 1 2016-10-08 Antti Koivisto <antti@apple.com> 2 3 Move StyleResolver ownership from Document/ShadowRoot to Style::Scope 4 https://bugs.webkit.org/show_bug.cgi?id=163148 5 6 Reviewed by Andreas Kling. 7 8 Reduce duplication between Document and ShadowRoot. 9 10 * css/CSSComputedStyleDeclaration.cpp: 11 (WebCore::ComputedStyleExtractor::propertyValue): 12 * css/CSSStyleSheet.cpp: 13 (WebCore::CSSStyleSheet::didMutateRules): 14 * css/ElementRuleCollector.cpp: 15 (WebCore::ElementRuleCollector::matchHostPseudoClassRules): 16 (WebCore::ElementRuleCollector::matchSlottedPseudoElementRules): 17 * css/MediaQueryMatcher.cpp: 18 (WebCore::MediaQueryMatcher::documentElementUserAgentStyle): 19 * css/StyleMedia.cpp: 20 (WebCore::StyleMedia::matchMedium): 21 * css/parser/SizesAttributeParser.cpp: 22 (WebCore::SizesAttributeParser::mediaConditionMatches): 23 * dom/Document.cpp: 24 (WebCore::Document::~Document): 25 (WebCore::Document::childrenChanged): 26 (WebCore::Document::isPageBoxVisible): 27 (WebCore::Document::pageSizeAndMarginsInPixels): 28 (WebCore::Document::userAgentShadowTreeStyleResolver): 29 (WebCore::Document::fontsNeedUpdate): 30 (WebCore::Document::didClearStyleResolver): 31 (WebCore::Document::updateViewportUnitsOnResize): 32 (WebCore::Document::createStyleResolver): Deleted. 33 (WebCore::Document::clearStyleResolver): Deleted. 34 * dom/Document.h: 35 (WebCore::Document::styleResolverIfExists): Deleted. 36 (WebCore::Document::ensureStyleResolver): Deleted. 37 * dom/Element.cpp: 38 (WebCore::Element::styleResolver): 39 * dom/ShadowRoot.cpp: 40 (WebCore::ShadowRoot::styleResolver): Deleted. 41 (WebCore::ShadowRoot::styleResolverIfExists): Deleted. 42 (WebCore::ShadowRoot::resetStyleResolver): Deleted. 43 * dom/ShadowRoot.h: 44 * page/DOMWindow.cpp: 45 (WebCore::DOMWindow::getMatchedCSSRules): 46 * page/FrameView.cpp: 47 (WebCore::FrameView::layout): 48 * page/Page.cpp: 49 (WebCore::Page::updateStyleForAllPagesAfterGlobalChangeInEnvironment): 50 * page/PrintContext.cpp: 51 (WebCore::PrintContext::pageProperty): 52 * platform/MemoryPressureHandler.cpp: 53 (WebCore::MemoryPressureHandler::releaseCriticalMemory): 54 * style/AttributeChangeInvalidation.cpp: 55 (WebCore::Style::mayBeAffectedByHostStyle): 56 * style/ClassChangeInvalidation.cpp: 57 (WebCore::Style::mayBeAffectedByHostStyle): 58 * style/IdChangeInvalidation.cpp: 59 (WebCore::Style::mayBeAffectedByHostStyle): 60 * style/StyleScope.cpp: 61 (WebCore::Style::Scope::resolver): 62 (WebCore::Style::Scope::resolverIfExists): 63 (WebCore::Style::Scope::clearResolver): 64 (WebCore::Style::Scope::analyzeStyleSheetChange): 65 (WebCore::Style::Scope::updateActiveStyleSheets): 66 (WebCore::Style::Scope::updateStyleResolver): 67 (WebCore::Style::Scope::styleResolver): Deleted. 68 (WebCore::Style::Scope::styleResolverIfExists): Deleted. 69 * style/StyleScope.h: 70 * style/StyleSharingResolver.cpp: 71 (WebCore::Style::SharingResolver::resolve): 72 (WebCore::Style::SharingResolver::canShareStyleWithElement): 73 * style/StyleTreeResolver.cpp: 74 (WebCore::Style::TreeResolver::Scope::Scope): 75 (WebCore::Style::TreeResolver::resolve): 76 1 77 2016-10-07 Chris Dumez <cdumez@apple.com> 2 78 -
trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
r206839 r206951 71 71 #include "StylePropertyShorthandFunctions.h" 72 72 #include "StyleResolver.h" 73 #include "StyleScope.h" 73 74 #include "WebKitCSSFilterValue.h" 74 75 #include "WebKitCSSTransformValue.h" … … 2495 2496 forceFullLayout = isLayoutDependent(propertyID, style, renderer) 2496 2497 || styledNode->isInShadowTree() 2497 || (document.style ResolverIfExists() && document.styleResolverIfExists()->hasViewportDependentMediaQueries() && document.ownerElement());2498 || (document.styleScope().resolverIfExists() && document.styleScope().resolverIfExists()->hasViewportDependentMediaQueries() && document.ownerElement()); 2498 2499 2499 2500 if (forceFullLayout) { -
trunk/Source/WebCore/css/CSSStyleSheet.cpp
r206917 r206951 178 178 if (mutationType == RuleInsertion && !contentsWereClonedForMutation && !scope->activeStyleSheetsContains(this)) { 179 179 if (insertedKeyframesRule) { 180 if (auto* resolver = scope-> styleResolverIfExists())180 if (auto* resolver = scope->resolverIfExists()) 181 181 resolver->addKeyframeStyle(*insertedKeyframesRule); 182 182 return; -
trunk/Source/WebCore/css/ElementRuleCollector.cpp
r204543 r206951 46 46 #include "ShadowRoot.h" 47 47 #include "StyleProperties.h" 48 #include "StyleScope.h" 48 49 #include "StyledElement.h" 49 50 … … 235 236 matchRequest.treeContextOrdinal++; 236 237 237 auto& shadowAuthorStyle = m_element.shadowRoot()->style Resolver().ruleSets().authorStyle();238 auto& shadowAuthorStyle = m_element.shadowRoot()->styleScope().resolver().ruleSets().authorStyle(); 238 239 auto& shadowHostRules = shadowAuthorStyle.hostPseudoClassRules(); 239 240 if (shadowHostRules.isEmpty()) … … 266 267 // In nested case the slot may itself be assigned to a slot. Collect ::slotted rules from all the nested trees. 267 268 maybeSlotted = slot; 268 if (!hostShadowRoot->style Resolver().ruleSets().isAuthorStyleDefined())269 if (!hostShadowRoot->styleScope().resolver().ruleSets().isAuthorStyleDefined()) 269 270 continue; 270 271 // Find out if there are any ::slotted rules in the shadow tree matching the current slot. 271 272 // FIXME: This is really part of the slot style and could be cached when resolving it. 272 ElementRuleCollector collector(*slot, hostShadowRoot->style Resolver().ruleSets().authorStyle(), nullptr);273 ElementRuleCollector collector(*slot, hostShadowRoot->styleScope().resolver().ruleSets().authorStyle(), nullptr); 273 274 auto slottedPseudoElementRules = collector.collectSlottedPseudoElementRulesForSlot(matchRequest.includeEmptyRules); 274 275 if (!slottedPseudoElementRules) -
trunk/Source/WebCore/css/MediaQueryMatcher.cpp
r202658 r206951 31 31 #include "RenderElement.h" 32 32 #include "StyleResolver.h" 33 #include "StyleScope.h" 33 34 34 35 namespace WebCore { … … 66 67 return nullptr; 67 68 68 return m_document-> ensureStyleResolver().styleForElement(*documentElement, m_document->renderStyle(), MatchOnlyUserAgentRules).renderStyle;69 return m_document->styleScope().resolver().styleForElement(*documentElement, m_document->renderStyle(), MatchOnlyUserAgentRules).renderStyle; 69 70 } 70 71 -
trunk/Source/WebCore/css/StyleMedia.cpp
r202167 r206951 35 35 #include "RenderElement.h" 36 36 #include "StyleResolver.h" 37 #include "StyleScope.h" 37 38 38 39 namespace WebCore { … … 63 64 return false; 64 65 65 auto rootStyle = document-> ensureStyleResolver().styleForElement(*documentElement, document->renderStyle(), MatchOnlyUserAgentRules).renderStyle;66 auto rootStyle = document->styleScope().resolver().styleForElement(*documentElement, document->renderStyle(), MatchOnlyUserAgentRules).renderStyle; 66 67 67 68 auto media = MediaQuerySet::create(); -
trunk/Source/WebCore/css/parser/SizesAttributeParser.cpp
r205905 r206951 37 37 #include "RenderView.h" 38 38 #include "SizesCalcParser.h" 39 #include "StyleScope.h" 39 40 40 41 namespace WebCore { … … 111 112 return false; 112 113 auto& style = renderer->style(); 113 return MediaQueryEvaluator { "screen", m_document, &style }.evaluate(mediaCondition, m_document.styleResolverIfExists());114 return MediaQueryEvaluator { "screen", m_document, &style }.evaluate(mediaCondition, const_cast<Style::Scope&>(m_document.styleScope()).resolverIfExists()); 114 115 } 115 116 -
trunk/Source/WebCore/dom/Document.cpp
r206917 r206951 632 632 extensionStyleSheets().detachFromDocument(); 633 633 634 clearStyleResolver(); // We need to destroy CSSFontSelector before destroying m_cachedResourceLoader.634 styleScope().clearResolver(); // We need to destroy CSSFontSelector before destroying m_cachedResourceLoader. 635 635 m_fontSelector->clearDocument(); 636 636 m_fontSelector->unregisterForInvalidationCallbacks(*this); … … 864 864 m_documentElement = newDocumentElement; 865 865 // The root style used for media query matching depends on the document element. 866 clearStyleResolver();866 styleScope().clearResolver(); 867 867 } 868 868 … … 2098 2098 bool Document::isPageBoxVisible(int pageIndex) 2099 2099 { 2100 std::unique_ptr<RenderStyle> pageStyle( ensureStyleResolver().styleForPage(pageIndex));2100 std::unique_ptr<RenderStyle> pageStyle(styleScope().resolver().styleForPage(pageIndex)); 2101 2101 return pageStyle->visibility() != HIDDEN; // display property doesn't apply to @page. 2102 2102 } … … 2104 2104 void Document::pageSizeAndMarginsInPixels(int pageIndex, IntSize& pageSize, int& marginTop, int& marginRight, int& marginBottom, int& marginLeft) 2105 2105 { 2106 std::unique_ptr<RenderStyle> style = ensureStyleResolver().styleForPage(pageIndex);2106 std::unique_ptr<RenderStyle> style = styleScope().resolver().styleForPage(pageIndex); 2107 2107 2108 2108 int width = pageSize.width(); … … 2140 2140 } 2141 2141 2142 void Document::createStyleResolver()2143 {2144 m_styleResolver = std::make_unique<StyleResolver>(*this);2145 m_styleResolver->appendAuthorStyleSheets(styleScope().activeStyleSheets());2146 }2147 2148 2142 StyleResolver& Document::userAgentShadowTreeStyleResolver() 2149 2143 { … … 2152 2146 2153 2147 // FIXME: Filter out shadow pseudo elements we don't want to expose to authors. 2154 auto& documentAuthorStyle = ensureStyleResolver().ruleSets().authorStyle();2148 auto& documentAuthorStyle = styleScope().resolver().ruleSets().authorStyle(); 2155 2149 if (documentAuthorStyle.hasShadowPseudoElementRules()) 2156 2150 m_userAgentShadowTreeStyleResolver->ruleSets().authorStyle().copyShadowPseudoElementRulesFrom(documentAuthorStyle); … … 2162 2156 void Document::fontsNeedUpdate(FontSelector&) 2163 2157 { 2164 if ( m_styleResolver)2165 m_styleResolver->invalidateMatchedPropertiesCache();2158 if (auto* resolver = styleScope().resolverIfExists()) 2159 resolver->invalidateMatchedPropertiesCache(); 2166 2160 if (pageCacheState() != NotInPageCache || !renderView()) 2167 2161 return; … … 2169 2163 } 2170 2164 2171 void Document::clearStyleResolver() 2172 { 2173 m_styleResolver = nullptr; 2165 void Document::didClearStyleResolver() 2166 { 2174 2167 m_userAgentShadowTreeStyleResolver = nullptr; 2175 2168 … … 3492 3485 return; 3493 3486 3494 ensureStyleResolver().clearCachedPropertiesAffectedByViewportUnits();3487 styleScope().resolver().clearCachedPropertiesAffectedByViewportUnits(); 3495 3488 3496 3489 // FIXME: Ideally, we should save the list of elements that have viewport units and only iterate over those. -
trunk/Source/WebCore/dom/Document.h
r206917 r206951 488 488 bool isSrcdocDocument() const { return m_isSrcdocDocument; } 489 489 490 StyleResolver* styleResolverIfExists() const { return m_styleResolver.get(); }491 492 490 bool sawElementsInKnownNamespaces() const { return m_sawElementsInKnownNamespaces; } 493 491 494 StyleResolver& ensureStyleResolver()495 {496 if (!m_styleResolver)497 createStyleResolver();498 return *m_styleResolver;499 }500 492 StyleResolver& userAgentShadowTreeStyleResolver(); 501 493 … … 1231 1223 void didRemoveAllPendingStylesheet(); 1232 1224 void setNeedsNotifyRemoveAllPendingStylesheet() { m_needsNotifyRemoveAllPendingStylesheet = true; } 1233 void clearStyleResolver();1225 void didClearStyleResolver(); 1234 1226 1235 1227 bool inStyleRecalc() const { return m_inStyleRecalc; } … … 1353 1345 void buildAccessKeyMap(TreeScope* root); 1354 1346 1355 void createStyleResolver();1356 1357 1347 void loadEventDelayTimerFired(); 1358 1348 … … 1398 1388 unsigned m_referencingNodeCount; 1399 1389 1400 std::unique_ptr<StyleResolver> m_styleResolver;1401 1390 std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver; 1402 1391 bool m_hasNodesWithPlaceholderStyle; -
trunk/Source/WebCore/dom/Element.cpp
r206308 r206951 98 98 #include "StyleProperties.h" 99 99 #include "StyleResolver.h" 100 #include "StyleScope.h" 100 101 #include "StyleTreeResolver.h" 101 102 #include "TextIterator.h" … … 1430 1431 { 1431 1432 if (auto* shadowRoot = containingShadowRoot()) 1432 return shadowRoot->style Resolver();1433 1434 return document(). ensureStyleResolver();1433 return shadowRoot->styleScope().resolver(); 1434 1435 return document().styleScope().resolver(); 1435 1436 } 1436 1437 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r206917 r206951 42 42 struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope { 43 43 unsigned countersAndFlags[1]; 44 void* styleResolver;45 44 void* styleScope; 46 45 void* host; … … 81 80 } 82 81 83 StyleResolver& ShadowRoot::styleResolver()84 {85 if (m_type == Mode::UserAgent)86 return document().userAgentShadowTreeStyleResolver();87 88 if (!m_styleResolver) {89 // FIXME: We could share style resolver with shadow roots that have identical style.90 m_styleResolver = std::make_unique<StyleResolver>(document());91 if (m_styleScope)92 m_styleResolver->appendAuthorStyleSheets(m_styleScope->activeStyleSheets());93 }94 return *m_styleResolver;95 }96 97 StyleResolver* ShadowRoot::styleResolverIfExists()98 {99 if (m_type == Mode::UserAgent)100 return &document().userAgentShadowTreeStyleResolver();101 102 return m_styleResolver.get();103 }104 105 void ShadowRoot::resetStyleResolver()106 {107 m_styleResolver = nullptr;108 }109 110 82 Style::Scope& ShadowRoot::styleScope() 111 83 { … … 113 85 m_styleScope = std::make_unique<Style::Scope>(*this); 114 86 return *m_styleScope; 115 }116 117 void ShadowRoot::updateStyle()118 {119 if (!m_styleScope)120 return;121 // FIXME: Make optimized updated work.122 m_styleScope->didChangeContentsOrInterpretation();123 87 } 124 88 -
trunk/Source/WebCore/dom/ShadowRoot.h
r206917 r206951 62 62 using TreeScope::rootNode; 63 63 64 StyleResolver& styleResolver();65 StyleResolver* styleResolverIfExists();66 64 Style::Scope& styleScope(); 67 68 void updateStyle();69 void resetStyleResolver();70 65 71 66 bool resetStyleInheritance() const { return m_resetStyleInheritance; } … … 115 110 Element* m_host { nullptr }; 116 111 117 std::unique_ptr<StyleResolver> m_styleResolver;118 112 std::unique_ptr<Style::Scope> m_styleScope; 119 113 -
trunk/Source/WebCore/page/DOMWindow.cpp
r206917 r206951 1443 1443 PseudoId pseudoId = CSSSelector::pseudoId(pseudoType); 1444 1444 1445 auto matchedRules = m_frame->document()-> ensureStyleResolver().pseudoStyleRulesForElement(element, pseudoId, rulesToInclude);1445 auto matchedRules = m_frame->document()->styleScope().resolver().pseudoStyleRulesForElement(element, pseudoId, rulesToInclude); 1446 1446 if (matchedRules.isEmpty()) 1447 1447 return nullptr; -
trunk/Source/WebCore/page/FrameView.cpp
r206917 r206951 1333 1333 1334 1334 // Viewport-dependent media queries may cause us to need completely different style information. 1335 StyleResolver* styleResolver = document.styleResolverIfExists();1335 auto* styleResolver = document.styleScope().resolverIfExists(); 1336 1336 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1337 1337 LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc"); -
trunk/Source/WebCore/page/Page.cpp
r206917 r206951 492 492 if (!frame->document()) 493 493 continue; 494 if (StyleResolver* styleResolver = frame->document()->style ResolverIfExists())494 if (StyleResolver* styleResolver = frame->document()->styleScope().resolverIfExists()) 495 495 styleResolver->invalidateMatchedPropertiesCache(); 496 496 frame->document()->scheduleForcedStyleRecalc(); -
trunk/Source/WebCore/page/PrintContext.cpp
r201884 r206951 28 28 #include "StyleInheritedData.h" 29 29 #include "StyleResolver.h" 30 #include "StyleScope.h" 30 31 #include <wtf/text/WTFString.h> 31 32 … … 252 253 printContext.begin(800); // Any width is OK here. 253 254 document->updateLayout(); 254 std::unique_ptr<RenderStyle> style = document-> ensureStyleResolver().styleForPage(pageNumber);255 std::unique_ptr<RenderStyle> style = document->styleScope().resolver().styleForPage(pageNumber); 255 256 256 257 // Implement formatters for properties we care about. -
trunk/Source/WebCore/platform/MemoryPressureHandler.cpp
r205275 r206951 40 40 #include "PageCache.h" 41 41 #include "ScrollingThread.h" 42 #include "StyleScope.h" 42 43 #include "StyledElement.h" 43 44 #include "WorkerThread.h" … … 129 130 copyToVector(Document::allDocuments(), documents); 130 131 for (auto& document : documents) 131 document-> clearStyleResolver();132 document->styleScope().clearResolver(); 132 133 } 133 134 -
trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp
r204220 r206951 32 32 #include "StyleInvalidationAnalysis.h" 33 33 #include "StyleResolver.h" 34 #include "StyleScope.h" 34 35 35 36 namespace WebCore { … … 38 39 static bool mayBeAffectedByHostStyle(ShadowRoot& shadowRoot, bool isHTML, const QualifiedName& attributeName) 39 40 { 40 auto& shadowRuleSets = shadowRoot.style Resolver().ruleSets();41 auto& shadowRuleSets = shadowRoot.styleScope().resolver().ruleSets(); 41 42 if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty()) 42 43 return false; -
trunk/Source/WebCore/style/ClassChangeInvalidation.cpp
r204220 r206951 33 33 #include "StyleInvalidationAnalysis.h" 34 34 #include "StyleResolver.h" 35 #include "StyleScope.h" 35 36 #include <wtf/BitVector.h> 36 37 … … 88 89 static bool mayBeAffectedByHostStyle(ShadowRoot& shadowRoot, AtomicStringImpl* changedClass) 89 90 { 90 auto& shadowRuleSets = shadowRoot.style Resolver().ruleSets();91 auto& shadowRuleSets = shadowRoot.styleScope().resolver().ruleSets(); 91 92 if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty()) 92 93 return false; -
trunk/Source/WebCore/style/IdChangeInvalidation.cpp
r204220 r206951 31 31 #include "ShadowRoot.h" 32 32 #include "StyleResolver.h" 33 #include "StyleScope.h" 33 34 34 35 namespace WebCore { … … 37 38 static bool mayBeAffectedByHostStyle(ShadowRoot& shadowRoot, const AtomicString& changedId) 38 39 { 39 auto& shadowRuleSets = shadowRoot.style Resolver().ruleSets();40 auto& shadowRuleSets = shadowRoot.styleScope().resolver().ruleSets(); 40 41 if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty()) 41 42 return false; -
trunk/Source/WebCore/style/StyleScope.cpp
r206917 r206951 72 72 } 73 73 74 StyleResolver& Scope::styleResolver() 75 { 76 if (m_shadowRoot) 77 return m_shadowRoot->styleResolver(); 78 79 return m_document.ensureStyleResolver(); 80 } 81 82 StyleResolver* Scope::styleResolverIfExists() 83 { 84 if (m_shadowRoot) 85 return m_shadowRoot->styleResolverIfExists(); 86 87 return m_document.styleResolverIfExists(); 74 StyleResolver& Scope::resolver() 75 { 76 if (m_shadowRoot && m_shadowRoot->mode() == ShadowRoot::Mode::UserAgent) 77 return m_document.userAgentShadowTreeStyleResolver(); 78 79 if (!m_resolver) { 80 m_resolver = std::make_unique<StyleResolver>(m_document); 81 m_resolver->appendAuthorStyleSheets(m_activeStyleSheets); 82 } 83 return *m_resolver; 84 } 85 86 StyleResolver* Scope::resolverIfExists() 87 { 88 if (m_shadowRoot && m_shadowRoot->mode() == ShadowRoot::Mode::UserAgent) 89 return &m_document.userAgentShadowTreeStyleResolver(); 90 91 return m_resolver.get(); 92 } 93 94 void Scope::clearResolver() 95 { 96 m_resolver = nullptr; 97 98 if (!m_shadowRoot) 99 m_document.didClearStyleResolver(); 88 100 } 89 101 … … 119 131 120 132 if (m_shadowRoot) { 121 m_shadowRoot->updateStyle(); 133 // FIXME: Make optimized updates work. 134 didChangeContentsOrInterpretation(); 122 135 return; 123 136 } … … 249 262 unsigned newStylesheetCount = newStylesheets.size(); 250 263 251 if (! styleResolverIfExists())264 if (!resolverIfExists()) 252 265 return Reconstruct; 253 266 254 StyleResolver& styleResolver = *styleResolverIfExists();267 auto& styleResolver = *resolverIfExists(); 255 268 256 269 // Find out which stylesheets are new. … … 324 337 325 338 if (!m_document.hasLivingRenderTree()) { 326 m_document.clearStyleResolver();339 clearResolver(); 327 340 return; 328 341 } … … 331 344 // and haven't calculated the style resolver for the first time. 332 345 if (!m_shadowRoot && !m_didUpdateActiveStyleSheets && m_pendingStyleSheetCount) { 333 m_document.clearStyleResolver();346 clearResolver(); 334 347 return; 335 348 } … … 379 392 { 380 393 if (updateType == Reconstruct) { 381 if (m_shadowRoot) 382 m_shadowRoot->resetStyleResolver(); 383 else 384 m_document.clearStyleResolver(); 385 return; 386 } 387 auto& styleResolver = this->styleResolver(); 394 clearResolver(); 395 return; 396 } 397 auto& styleResolver = resolver(); 388 398 389 399 if (updateType == Reset) { -
trunk/Source/WebCore/style/StyleScope.h
r206917 r206951 90 90 void flushPendingUpdate(); 91 91 92 StyleResolver& styleResolver(); 93 StyleResolver* styleResolverIfExists(); 92 StyleResolver& resolver(); 93 StyleResolver* resolverIfExists(); 94 void clearResolver(); 94 95 95 96 static Scope& forNode(Node&); … … 114 115 Document& m_document; 115 116 ShadowRoot* m_shadowRoot { nullptr }; 117 118 std::unique_ptr<StyleResolver> m_resolver; 116 119 117 120 Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList; -
trunk/Source/WebCore/style/StyleSharingResolver.cpp
r206916 r206951 35 35 #include "SVGElement.h" 36 36 #include "ShadowRoot.h" 37 #include "StyleScope.h" 37 38 #include "StyleUpdate.h" 38 39 #include "StyledElement.h" … … 98 99 if (elementHasDirectionAuto(element)) 99 100 return nullptr; 100 if (element.shadowRoot() && !element.shadowRoot()->style Resolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty())101 if (element.shadowRoot() && !element.shadowRoot()->styleScope().resolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty()) 101 102 return nullptr; 102 103 … … 288 289 return false; 289 290 290 if (element.shadowRoot() && !element.shadowRoot()->style Resolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty())291 if (element.shadowRoot() && !element.shadowRoot()->styleScope().resolver().ruleSets().authorStyle().hostPseudoClassRules().isEmpty()) 291 292 return false; 292 293 -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r206917 r206951 84 84 85 85 TreeResolver::Scope::Scope(Document& document) 86 : styleResolver(document. ensureStyleResolver())86 : styleResolver(document.styleScope().resolver()) 87 87 , sharingResolver(document, styleResolver.ruleSets(), selectorFilter) 88 88 { … … 90 90 91 91 TreeResolver::Scope::Scope(ShadowRoot& shadowRoot, Scope& enclosingScope) 92 : styleResolver(shadowRoot.style Resolver())92 : styleResolver(shadowRoot.styleScope().resolver()) 93 93 , sharingResolver(shadowRoot.documentScope(), styleResolver.ruleSets(), selectorFilter) 94 94 , shadowRoot(&shadowRoot) … … 441 441 Element* documentElement = m_document.documentElement(); 442 442 if (!documentElement) { 443 m_document. ensureStyleResolver();443 m_document.styleScope().resolver(); 444 444 return nullptr; 445 445 }
Note: See TracChangeset
for help on using the changeset viewer.