Changeset 163263 in webkit
- Timestamp:
- Feb 2, 2014, 9:27:02 AM (11 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 deleted
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r163225 r163263 1105 1105 css/StyleRule.cpp 1106 1106 css/StyleRuleImport.cpp 1107 css/StyleScopeResolver.cpp1108 1107 css/StyleSheet.cpp 1109 1108 css/StyleSheetContents.cpp -
trunk/Source/WebCore/ChangeLog
r163262 r163263 1 2014-02-02 Antti Koivisto <antti@apple.com> 2 3 Remove StyleScopeResolver 4 https://bugs.webkit.org/show_bug.cgi?id=128069 5 6 Reviewed by Anders Carlsson. 7 8 This is dead code. 9 10 * CMakeLists.txt: 11 * GNUmakefile.list.am: 12 * WebCore.xcodeproj/project.pbxproj: 13 * css/DocumentRuleSets.cpp: 14 (WebCore::DocumentRuleSets::appendAuthorStyleSheets): 15 (WebCore::DocumentRuleSets::collectFeatures): 16 * css/DocumentRuleSets.h: 17 * css/ElementRuleCollector.h: 18 (WebCore::ElementRuleCollector::ElementRuleCollector): 19 * css/RuleSet.cpp: 20 (WebCore::RuleSet::addChildRules): 21 * css/StyleResolver.cpp: 22 (WebCore::StyleResolver::pushParentElement): 23 (WebCore::StyleResolver::popParentElement): 24 (WebCore::StyleResolver::locateSharedStyle): 25 (WebCore::StyleResolver::styleForElement): 26 * css/StyleResolver.h: 27 (WebCore::StyleResolver::document): 28 * css/StyleScopeResolver.cpp: Removed. 29 * css/StyleScopeResolver.h: Removed. 30 * style/StyleResolveTree.cpp: 31 (WebCore::Style::attachShadowRoot): 32 (WebCore::Style::resolveShadowTree): 33 1 34 2014-02-02 Zalan Bujtas <zalan@apple.com> 2 35 -
trunk/Source/WebCore/GNUmakefile.list.am
r163253 r163263 2695 2695 Source/WebCore/css/StyleRuleImport.cpp \ 2696 2696 Source/WebCore/css/StyleRuleImport.h \ 2697 Source/WebCore/css/StyleScopeResolver.cpp \2698 Source/WebCore/css/StyleScopeResolver.h \2699 2697 Source/WebCore/css/StyleSheet.cpp \ 2700 2698 Source/WebCore/css/StyleSheet.h \ -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r163253 r163263 3725 3725 A7AD2F880EC89D07008AB002 /* LinkHash.h in Headers */ = {isa = PBXBuildFile; fileRef = A7AD2F860EC89D07008AB002 /* LinkHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3726 3726 A7B6E69F0B291A9600D0529F /* DragData.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B6E69D0B291A9600D0529F /* DragData.h */; settings = {ATTRIBUTES = (Private, ); }; }; 3727 A7B761A1161EE526002083D3 /* StyleScopeResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = A7B7619F161EE526002083D3 /* StyleScopeResolver.h */; };3728 3727 A7BBE26611AFB3F20005EA03 /* JSHTMLMeterElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = A7BBE26411AFB3F20005EA03 /* JSHTMLMeterElement.cpp */; }; 3729 3728 A7BBE26711AFB3F20005EA03 /* JSHTMLMeterElement.h in Headers */ = {isa = PBXBuildFile; fileRef = A7BBE26511AFB3F20005EA03 /* JSHTMLMeterElement.h */; }; … … 10702 10701 A7B4EA7914C9348400C8F5BF /* JSInternalSettings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSInternalSettings.h; sourceTree = "<group>"; }; 10703 10702 A7B6E69D0B291A9600D0529F /* DragData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DragData.h; sourceTree = "<group>"; }; 10704 A7B7619F161EE526002083D3 /* StyleScopeResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleScopeResolver.h; sourceTree = "<group>"; };10705 10703 A7BBE26411AFB3F20005EA03 /* JSHTMLMeterElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLMeterElement.cpp; sourceTree = "<group>"; }; 10706 10704 A7BBE26511AFB3F20005EA03 /* JSHTMLMeterElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHTMLMeterElement.h; sourceTree = "<group>"; }; … … 21524 21522 E4946EAC156E64DD00D3297F /* StyleRuleImport.cpp */, 21525 21523 E4946EAD156E64DD00D3297F /* StyleRuleImport.h */, 21526 A7B7619F161EE526002083D3 /* StyleScopeResolver.h */,21527 21524 A8EA80050A19516E00A8EF5F /* StyleSheet.cpp */, 21528 21525 A8EA80040A19516E00A8EF5F /* StyleSheet.h */, … … 25340 25337 E4BBED4D14FCDBA1003F0B98 /* StyleRule.h in Headers */, 25341 25338 E4946EAF156E64DD00D3297F /* StyleRuleImport.h in Headers */, 25342 A7B761A1161EE526002083D3 /* StyleScopeResolver.h in Headers */,25343 25339 A8EA800C0A19516E00A8EF5F /* StyleSheet.h in Headers */, 25344 25340 0F54DCE61881051D003EEDBB /* TextAutoSizing.h in Headers */, -
trunk/Source/WebCore/css/CSSAllInOne.cpp
r159856 r163263 85 85 #include "StylePropertyShorthand.cpp" 86 86 #include "StyleResolver.cpp" 87 #include "StyleScopeResolver.cpp"88 87 #include "ViewportStyleResolver.cpp" -
trunk/Source/WebCore/css/DocumentRuleSets.cpp
r163073 r163263 94 94 if (cssSheet->mediaQueries() && !medium->eval(cssSheet->mediaQueries(), resolver)) 95 95 continue; 96 StyleSheetContents& sheet = cssSheet->contents(); 97 #if ENABLE(SHADOW_DOM) 98 if (const ContainerNode* scope = StyleScopeResolver::scopeFor(cssSheet)) { 99 // FIXME: Remove a dependency to calling a StyleResolver's member function. 100 // If we can avoid calling resolver->ensureScopeResolver() here, we don't have to include "StyleResolver.h". 101 // https://bugs.webkit.org/show_bug.cgi?id=108890 102 resolver->ensureScopeResolver()->ensureRuleSetFor(scope)->addRulesFromSheet(&sheet, *medium, resolver, scope); 103 continue; 104 } 105 #endif 106 m_authorStyle->addRulesFromSheet(&sheet, *medium, resolver); 96 m_authorStyle->addRulesFromSheet(&cssSheet->contents(), *medium, resolver); 107 97 inspectorCSSOMWrappers.collectFromStyleSheetIfNeeded(cssSheet); 108 98 } 109 99 m_authorStyle->shrinkToFit(); 110 collectFeatures(isViewSource , resolver->scopeResolver());100 collectFeatures(isViewSource); 111 101 } 112 102 113 void DocumentRuleSets::collectFeatures(bool isViewSource , StyleScopeResolver* scopeResolver)103 void DocumentRuleSets::collectFeatures(bool isViewSource) 114 104 { 115 105 m_features.clear(); … … 124 114 m_features.add(CSSDefaultStyleSheets::viewSourceStyle()->features()); 125 115 126 if (scopeResolver)127 scopeResolver->collectFeaturesTo(m_features);128 116 if (m_userStyle) 129 117 m_features.add(m_userStyle->features()); -
trunk/Source/WebCore/css/DocumentRuleSets.h
r157653 r163263 39 39 class MediaQueryEvaluator; 40 40 class RuleSet; 41 class StyleScopeResolver;42 41 43 42 class DocumentRuleSets { … … 56 55 void appendAuthorStyleSheets(unsigned firstNew, const Vector<RefPtr<CSSStyleSheet>>&, MediaQueryEvaluator*, InspectorCSSOMWrappers&, bool isViewSource, StyleResolver*); 57 56 58 void collectFeatures(bool isViewSource , StyleScopeResolver*);57 void collectFeatures(bool isViewSource); 59 58 60 59 private: -
trunk/Source/WebCore/css/ElementRuleCollector.h
r162773 r163263 38 38 class RuleSet; 39 39 class SelectorFilter; 40 class StyleScopeResolver;41 40 42 41 class ElementRuleCollector { … … 46 45 , m_ruleSets(styleResolver->ruleSets()) 47 46 , m_selectorFilter(styleResolver->selectorFilter()) 48 , m_scopeResolver(styleResolver->scopeResolver())49 47 , m_isPrintStyle(false) 50 48 , m_regionForStyling(0) … … 92 90 DocumentRuleSets& m_ruleSets; 93 91 SelectorFilter& m_selectorFilter; 94 StyleScopeResolver* m_scopeResolver;95 92 96 93 bool m_isPrintStyle; -
trunk/Source/WebCore/css/RuleSet.cpp
r157653 r163263 307 307 } 308 308 #endif 309 #if ENABLE(SHADOW_DOM)310 else if (rule->isHostRule())311 resolver->addHostRule(static_cast<StyleRuleHost*>(rule), hasDocumentSecurityOrigin, scope);312 #endif313 309 #if ENABLE(CSS_DEVICE_ADAPTATION) 314 310 else if (rule->isViewportRule() && resolver) { -
trunk/Source/WebCore/css/StyleResolver.cpp
r163079 r163263 329 329 else 330 330 m_selectorFilter.pushParent(parent); 331 332 // Note: We mustn't skip ShadowRoot nodes for the scope stack.333 if (m_scopeResolver)334 m_scopeResolver->push(parent, parent->parentOrShadowHostNode());335 331 } 336 332 … … 341 337 if (m_selectorFilter.parentStackIsConsistent(parent)) 342 338 m_selectorFilter.popParent(); 343 if (m_scopeResolver)344 m_scopeResolver->pop(parent);345 }346 347 void StyleResolver::pushParentShadowRoot(const ShadowRoot* shadowRoot)348 {349 ASSERT(shadowRoot->hostElement());350 if (m_scopeResolver)351 m_scopeResolver->push(shadowRoot, shadowRoot->hostElement());352 }353 354 void StyleResolver::popParentShadowRoot(const ShadowRoot* shadowRoot)355 {356 ASSERT(shadowRoot->hostElement());357 if (m_scopeResolver)358 m_scopeResolver->pop(shadowRoot);359 339 } 360 340 … … 398 378 } 399 379 400 inline bool StyleResolver::styleSharingCandidateMatchesHostRules()401 {402 #if ENABLE(SHADOW_DOM)403 return m_scopeResolver && m_scopeResolver->styleSharingCandidateMatchesHostRules(m_state.element());404 #else405 return false;406 #endif407 }408 409 380 bool StyleResolver::classNamesAffectedByRules(const SpaceSplitString& classNames) const 410 381 { … … 776 747 if (styleSharingCandidateMatchesRuleSet(m_ruleSets.uncommonAttribute())) 777 748 return 0; 778 // Can't share if @host @-rules apply.779 if (styleSharingCandidateMatchesHostRules())780 return 0;781 749 // Tracking child index requires unique style for each node. This may get set by the sibling rule match above. 782 750 if (parentElementPreventsSharing(state.element()->parentElement())) … … 840 808 CSSDefaultStyleSheets::ensureDefaultStyleSheetsForElement(element, needsCollection); 841 809 if (needsCollection) 842 m_ruleSets.collectFeatures(document().isViewSource() , m_scopeResolver.get());810 m_ruleSets.collectFeatures(document().isViewSource()); 843 811 844 812 ElementRuleCollector collector(this, state); -
trunk/Source/WebCore/css/StyleResolver.h
r162770 r163263 37 37 #include "SelectorFilter.h" 38 38 #include "StyleInheritedData.h" 39 #include "StyleScopeResolver.h"40 39 #include "ViewportStyleResolver.h" 41 40 #include <memory> … … 78 77 class RuleSet; 79 78 class Settings; 80 class StyleScopeResolver;81 79 class StyleImage; 82 80 class StyleKeyframe; … … 148 146 void pushParentElement(Element*); 149 147 void popParentElement(Element*); 150 void pushParentShadowRoot(const ShadowRoot*);151 void popParentShadowRoot(const ShadowRoot*);152 #if ENABLE(SHADOW_DOM)153 void addHostRule(StyleRuleHost* rule, bool hasDocumentSecurityOrigin, const ContainerNode* scope) { ensureScopeResolver()->addHostRule(rule, hasDocumentSecurityOrigin, scope); }154 #endif155 148 156 149 PassRef<RenderStyle> styleForElement(Element*, RenderStyle* parentStyle = 0, StyleSharingBehavior = AllowStyleSharing, … … 169 162 Element* element() { return m_state.element(); } 170 163 Document& document() { return m_document; } 171 StyleScopeResolver* scopeResolver() const { return m_scopeResolver.get(); }172 164 bool hasParentNode() const { return m_state.parentNode(); } 173 165 … … 179 171 const DocumentRuleSets& ruleSets() const { return m_ruleSets; } 180 172 SelectorFilter& selectorFilter() { return m_selectorFilter; } 181 182 #if ENABLE(SHADOW_DOM)183 StyleScopeResolver* ensureScopeResolver()184 {185 ASSERT(RuntimeEnabledFeatures::sharedFeatures().shadowDOMEnabled());186 if (!m_scopeResolver)187 m_scopeResolver = std::make_unique<StyleScopeResolver>();188 return m_scopeResolver.get();189 }190 #endif191 173 192 174 private: … … 194 176 RenderStyle* locateSharedStyle(); 195 177 bool styleSharingCandidateMatchesRuleSet(RuleSet*); 196 bool styleSharingCandidateMatchesHostRules();197 178 Node* locateCousinList(Element* parent, unsigned& visitedNodeCount) const; 198 179 StyledElement* findSiblingForStyleSharing(Node*, unsigned& count) const; … … 546 527 const DeprecatedStyleBuilder& m_deprecatedStyleBuilder; 547 528 548 std::unique_ptr<StyleScopeResolver> m_scopeResolver;549 529 CSSToStyleMap m_styleMap; 550 530 InspectorCSSOMWrappers m_inspectorCSSOMWrappers; -
trunk/Source/WebCore/style/StyleResolveTree.cpp
r162726 r163263 467 467 static void attachShadowRoot(ShadowRoot& shadowRoot) 468 468 { 469 StyleResolver& styleResolver = shadowRoot.document().ensureStyleResolver();470 styleResolver.pushParentShadowRoot(&shadowRoot);471 472 469 attachChildren(shadowRoot); 473 474 styleResolver.popParentShadowRoot(&shadowRoot);475 470 476 471 shadowRoot.clearNeedsStyleRecalc(); … … 727 722 if (!shadowRoot) 728 723 return; 729 StyleResolver& styleResolver = shadowRoot->document().ensureStyleResolver();730 styleResolver.pushParentShadowRoot(shadowRoot);731 724 732 725 for (Node* child = shadowRoot->firstChild(); child; child = child->nextSibling()) { 733 726 if (child->isTextNode()) { 734 // Current user agent ShadowRoots don't have immediate text children so this branch is never actually taken.735 727 updateTextStyle(*toText(child)); 736 728 continue; 737 729 } 738 resolveTree(*toElement(child), change);739 }740 741 styleResolver.popParentShadowRoot(shadowRoot); 730 if (child->isElementNode()) 731 resolveTree(*toElement(child), change); 732 } 733 742 734 shadowRoot->clearNeedsStyleRecalc(); 743 735 shadowRoot->clearChildNeedsStyleRecalc();
Note:
See TracChangeset
for help on using the changeset viewer.