Changeset 206917 in webkit
- Timestamp:
- Oct 7, 2016 9:55:11 AM (8 years ago)
- Location:
- trunk/Source
- Files:
-
- 30 edited
- 2 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/CMakeLists.txt
r206904 r206917 1385 1385 dom/AnimationEvent.cpp 1386 1386 dom/Attr.cpp 1387 dom/AuthorStyleSheets.cpp1388 1387 dom/BeforeTextInsertedEvent.cpp 1389 1388 dom/BeforeUnloadEvent.cpp … … 2651 2650 style/StyleRelations.cpp 2652 2651 style/StyleResolveForDocument.cpp 2652 style/StyleScope.cpp 2653 2653 style/StyleSharingResolver.cpp 2654 2654 style/StyleTreeResolver.cpp -
trunk/Source/WebCore/ChangeLog
r206916 r206917 1 2016-10-07 Antti Koivisto <antti@apple.com> 2 3 Rename AuthorStyleSheets to Style::Scope 4 https://bugs.webkit.org/show_bug.cgi?id=163108 5 6 Reviewed by Andreas Kling. 7 8 It represents the style scope in DOM. 9 Also move the file under style/. 10 11 * CMakeLists.txt: 12 * WebCore.xcodeproj/project.pbxproj: 13 * css/CSSStyleSheet.cpp: 14 (WebCore::CSSStyleSheet::styleSheetScope): 15 * css/CSSStyleSheet.h: 16 * css/InspectorCSSOMWrappers.cpp: 17 (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets): 18 * css/InspectorCSSOMWrappers.h: 19 * css/StyleSheetList.cpp: 20 (WebCore::StyleSheetList::styleSheets): 21 (WebCore::StyleSheetList::detachFromDocument): 22 * dom/AuthorStyleSheets.cpp: Removed. 23 * dom/AuthorStyleSheets.h: Removed. 24 * dom/Document.cpp: 25 (WebCore::Document::Document): 26 (WebCore::Document::setContentLanguage): 27 (WebCore::Document::recalcStyle): 28 (WebCore::Document::needsStyleRecalc): 29 (WebCore::Document::updateStyleIfNeeded): 30 (WebCore::Document::updateLayoutIgnorePendingStylesheets): 31 (WebCore::Document::createStyleResolver): 32 (WebCore::Document::didRemoveAllPendingStylesheet): 33 (WebCore::Document::usesStyleBasedEditability): 34 (WebCore::Document::processHttpEquiv): 35 (WebCore::Document::preferredStylesheetSet): 36 (WebCore::Document::selectedStylesheetSet): 37 (WebCore::Document::setSelectedStylesheetSet): 38 (WebCore::Document::haveStylesheetsLoaded): 39 * dom/Document.h: 40 (WebCore::Document::styleScope): 41 (WebCore::Document::authorStyleSheets): Deleted. 42 * dom/ExtensionStyleSheets.cpp: 43 (WebCore::ExtensionStyleSheets::clearPageUserSheet): 44 (WebCore::ExtensionStyleSheets::updatePageUserSheet): 45 (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache): 46 (WebCore::ExtensionStyleSheets::addUserStyleSheet): 47 (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting): 48 (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired): 49 * dom/InlineStyleSheetOwner.cpp: 50 (WebCore::InlineStyleSheetOwner::insertedIntoDocument): 51 (WebCore::InlineStyleSheetOwner::removedFromDocument): 52 (WebCore::InlineStyleSheetOwner::clearDocumentData): 53 (WebCore::InlineStyleSheetOwner::createSheet): 54 (WebCore::InlineStyleSheetOwner::sheetLoaded): 55 (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet): 56 * dom/InlineStyleSheetOwner.h: 57 (WebCore::InlineStyleSheetOwner::styleScope): 58 (WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted. 59 * dom/ProcessingInstruction.cpp: 60 (WebCore::ProcessingInstruction::~ProcessingInstruction): 61 (WebCore::ProcessingInstruction::checkStyleSheet): 62 (WebCore::ProcessingInstruction::sheetLoaded): 63 (WebCore::ProcessingInstruction::insertedInto): 64 (WebCore::ProcessingInstruction::removedFrom): 65 * dom/ShadowRoot.cpp: 66 (WebCore::ShadowRoot::styleResolver): 67 (WebCore::ShadowRoot::styleScope): 68 (WebCore::ShadowRoot::updateStyle): 69 (WebCore::ShadowRoot::authorStyleSheets): Deleted. 70 * dom/ShadowRoot.h: 71 * html/HTMLLinkElement.cpp: 72 (WebCore::HTMLLinkElement::~HTMLLinkElement): 73 (WebCore::HTMLLinkElement::setDisabledState): 74 (WebCore::HTMLLinkElement::parseAttribute): 75 (WebCore::HTMLLinkElement::process): 76 (WebCore::HTMLLinkElement::insertedInto): 77 (WebCore::HTMLLinkElement::removedFrom): 78 (WebCore::HTMLLinkElement::addPendingSheet): 79 (WebCore::HTMLLinkElement::removePendingSheet): 80 * html/HTMLStyleElement.cpp: 81 * inspector/InspectorCSSAgent.cpp: 82 (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets): 83 (WebCore::InspectorCSSAgent::forcePseudoState): 84 (WebCore::InspectorCSSAgent::buildObjectForRule): 85 (WebCore::InspectorCSSAgent::resetPseudoStates): 86 * inspector/InspectorPageAgent.cpp: 87 (WebCore::InspectorPageAgent::setEmulatedMedia): 88 * page/DOMWindow.cpp: 89 (WebCore::DOMWindow::getMatchedCSSRules): 90 * page/Frame.cpp: 91 (WebCore::Frame::setPrinting): 92 * page/FrameView.cpp: 93 (WebCore::FrameView::layout): 94 (WebCore::FrameView::setPagination): 95 (WebCore::FrameView::setViewportSizeForCSSViewportUnits): 96 * page/Page.cpp: 97 (WebCore::Page::setViewMode): 98 (WebCore::Page::setNeedsRecalcStyleInAllFrames): 99 (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames): 100 * style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp. 101 (WebCore::Style::Scope::Scope): 102 (WebCore::Style::Scope::styleResolver): 103 (WebCore::Style::Scope::styleResolverIfExists): 104 (WebCore::Style::Scope::forNode): 105 (WebCore::Style::Scope::removePendingSheet): 106 (WebCore::Style::Scope::addStyleSheetCandidateNode): 107 (WebCore::Style::Scope::removeStyleSheetCandidateNode): 108 (WebCore::Style::Scope::collectActiveStyleSheets): 109 (WebCore::Style::Scope::analyzeStyleSheetChange): 110 (WebCore::Style::Scope::updateActiveStyleSheets): 111 (WebCore::Style::Scope::updateStyleResolver): 112 (WebCore::Style::Scope::activeStyleSheetsForInspector): 113 (WebCore::Style::Scope::activeStyleSheetsContains): 114 (WebCore::Style::Scope::flushPendingUpdate): 115 (WebCore::Style::Scope::clearPendingUpdate): 116 (WebCore::Style::Scope::scheduleActiveSetUpdate): 117 (WebCore::Style::Scope::didChangeCandidatesForActiveSet): 118 (WebCore::Style::Scope::didChangeContentsOrInterpretation): 119 (WebCore::Style::Scope::pendingUpdateTimerFired): 120 (WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted. 121 (WebCore::AuthorStyleSheets::styleResolver): Deleted. 122 (WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted. 123 (WebCore::AuthorStyleSheets::forNode): Deleted. 124 (WebCore::AuthorStyleSheets::removePendingSheet): Deleted. 125 (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted. 126 (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted. 127 (WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted. 128 (WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted. 129 (WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted. 130 (WebCore::AuthorStyleSheets::updateStyleResolver): Deleted. 131 (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted. 132 (WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted. 133 (WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted. 134 (WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted. 135 (WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted. 136 (WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted. 137 (WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted. 138 (WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted. 139 * style/StyleScope.h: Copied from dom/AuthorStyleSheets.h. 140 * style/StyleTreeResolver.cpp: 141 * svg/SVGFontFaceElement.cpp: 142 (WebCore::SVGFontFaceElement::rebuildFontFace): 143 (WebCore::SVGFontFaceElement::removedFrom): 144 * xml/XMLTreeViewer.cpp: 145 (WebCore::XMLTreeViewer::transformDocumentToTreeView): 146 * xml/parser/XMLDocumentParser.cpp: 147 (WebCore::XMLDocumentParser::end): 148 * xml/parser/XMLDocumentParserLibxml2.cpp: 149 (WebCore::XMLDocumentParser::doEnd): 150 1 151 2016-10-07 Zalan Bujtas <zalan@apple.com> 2 152 -
trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj
r206901 r206917 6213 6213 E461802D1C8DD2900026C02C /* StyleRelations.h in Headers */ = {isa = PBXBuildFile; fileRef = E461802C1C8DD2900026C02C /* StyleRelations.h */; }; 6214 6214 E461802F1C8DD4D20026C02C /* StyleRelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461802E1C8DD4D20026C02C /* StyleRelations.cpp */; }; 6215 E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */; };6216 E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; };6215 E461D65D1BB0C7F000CB5645 /* StyleScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */; }; 6216 E461D65F1BB0C80D00CB5645 /* StyleScope.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* StyleScope.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6217 6217 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; }; 6218 6218 E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; }; … … 13829 13829 E461802C1C8DD2900026C02C /* StyleRelations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleRelations.h; sourceTree = "<group>"; }; 13830 13830 E461802E1C8DD4D20026C02C /* StyleRelations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRelations.cpp; sourceTree = "<group>"; }; 13831 E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthorStyleSheets.cpp; sourceTree = "<group>"; };13832 E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthorStyleSheets.h; sourceTree = "<group>"; };13831 E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleScope.cpp; sourceTree = "<group>"; }; 13832 E461D65E1BB0C80D00CB5645 /* StyleScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleScope.h; sourceTree = "<group>"; }; 13833 13833 E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; }; 13834 13834 E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedElementDescendantIterator.h; sourceTree = "<group>"; }; … … 22327 22327 E4D58EB217B4DBDC00CBDCA8 /* StyleResolveForDocument.cpp */, 22328 22328 E4D58EB317B4DBDC00CBDCA8 /* StyleResolveForDocument.h */, 22329 E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */, 22330 E461D65E1BB0C80D00CB5645 /* StyleScope.h */, 22329 22331 E47A3AC21C5EABBE00CCBFA7 /* StyleSharingResolver.cpp */, 22330 22332 E47A3AC41C5EAC7900CCBFA7 /* StyleSharingResolver.h */, … … 22963 22965 93EEC1E509C2877700C515D1 /* Attr.idl */, 22964 22966 A8C4A7F909D563270003AC8D /* Attribute.h */, 22965 E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */,22966 E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */,22967 22967 760847CD19A6A27700428CCC /* AutocompleteErrorEvent.h */, 22968 22968 760847CF19A6A28600428CCC /* AutocompleteErrorEvent.idl */, … … 23926 23926 E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */, 23927 23927 514C764C0CE9234E007EF3CD /* AuthenticationMac.h in Headers */, 23928 E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */,23928 E461D65F1BB0C80D00CB5645 /* StyleScope.h in Headers */, 23929 23929 A501920E132EBF2E008BFE55 /* Autocapitalize.h in Headers */, 23930 23930 760847CE19A6A27800428CCC /* AutocompleteErrorEvent.h in Headers */, … … 27691 27691 934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */, 27692 27692 514C764D0CE9234E007EF3CD /* AuthenticationMac.mm in Sources */, 27693 E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */,27693 E461D65D1BB0C7F000CB5645 /* StyleScope.cpp in Sources */, 27694 27694 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */, 27695 27695 5597F8261D91C3130066BC21 /* ImageFrameCache.cpp in Sources */, -
trunk/Source/WebCore/css/CSSStyleSheet.cpp
r206880 r206917 22 22 #include "CSSStyleSheet.h" 23 23 24 #include "AuthorStyleSheets.h"25 24 #include "CSSCharsetRule.h" 26 25 #include "CSSFontFaceRule.h" … … 45 44 #include "StyleResolver.h" 46 45 #include "StyleRule.h" 46 #include "StyleScope.h" 47 47 #include "StyleSheetContents.h" 48 48 49 #include <wtf/text/StringBuilder.h> 49 50 … … 171 172 ASSERT(m_contents->hasOneClient()); 172 173 173 auto* scope = styleS heetScope();174 auto* scope = styleScope(); 174 175 if (!scope) 175 176 return; … … 192 193 void CSSStyleSheet::didMutate() 193 194 { 194 auto* scope = styleS heetScope();195 auto* scope = styleScope(); 195 196 if (!scope) 196 197 return; … … 416 417 } 417 418 418 AuthorStyleSheets* CSSStyleSheet::styleSheetScope()419 Style::Scope* CSSStyleSheet::styleScope() 419 420 { 420 421 auto* ownerNode = rootStyleSheet().ownerNode(); 421 422 if (!ownerNode) 422 423 return nullptr; 423 return & AuthorStyleSheets::forNode(*ownerNode);424 return &Style::Scope::forNode(*ownerNode); 424 425 } 425 426 -
trunk/Source/WebCore/css/CSSStyleSheet.h
r206880 r206917 32 32 namespace WebCore { 33 33 34 class AuthorStyleSheets;35 34 class CSSCharsetRule; 36 35 class CSSImportRule; … … 45 44 class StyleRuleKeyframes; 46 45 class StyleSheetContents; 46 47 namespace Style { 48 class Scope; 49 } 47 50 48 51 typedef int ExceptionCode; … … 88 91 CSSStyleSheet& rootStyleSheet(); 89 92 const CSSStyleSheet& rootStyleSheet() const; 90 AuthorStyleSheets* styleSheetScope();93 Style::Scope* styleScope(); 91 94 92 95 MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); } -
trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp
r190169 r206917 30 30 #include "InspectorCSSOMWrappers.h" 31 31 32 #include "AuthorStyleSheets.h"33 32 #include "CSSDefaultStyleSheets.h" 34 33 #include "CSSImportRule.h" … … 39 38 #include "CSSSupportsRule.h" 40 39 #include "ExtensionStyleSheets.h" 40 #include "StyleScope.h" 41 41 #include "StyleSheetContents.h" 42 42 #include "WebKitCSSRegionRule.h" … … 97 97 } 98 98 99 CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, AuthorStyleSheets& authorStyleSheets, ExtensionStyleSheets& extensionStyleSheets)99 CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, Style::Scope& styleScope, ExtensionStyleSheets& extensionStyleSheets) 100 100 { 101 101 if (m_styleRuleToCSSOMWrapperMap.isEmpty()) { … … 109 109 collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::plugInsStyleSheet); 110 110 111 collectFromStyleSheets( authorStyleSheets.activeStyleSheets());111 collectFromStyleSheets(styleScope.activeStyleSheets()); 112 112 collect(extensionStyleSheets.pageUserSheet()); 113 113 collectFromStyleSheets(extensionStyleSheets.injectedUserStyleSheets()); -
trunk/Source/WebCore/css/InspectorCSSOMWrappers.h
r190169 r206917 32 32 namespace WebCore { 33 33 34 class AuthorStyleSheets;35 34 class CSSStyleRule; 36 35 class CSSStyleSheet; … … 39 38 class StyleSheetContents; 40 39 40 namespace Style { 41 class Scope; 42 } 43 41 44 class InspectorCSSOMWrappers { 42 45 public: 43 46 // WARNING. This will construct CSSOM wrappers for all style rules and cache them in a map for significant memory cost. 44 47 // It is here to support inspector. Don't use for any regular engine functions. 45 CSSStyleRule* getWrapperForRuleInSheets(StyleRule*, AuthorStyleSheets&, ExtensionStyleSheets&);48 CSSStyleRule* getWrapperForRuleInSheets(StyleRule*, Style::Scope&, ExtensionStyleSheets&); 46 49 void collectFromStyleSheetIfNeeded(CSSStyleSheet*); 47 50 -
trunk/Source/WebCore/css/StyleSheetList.cpp
r190280 r206917 22 22 #include "StyleSheetList.h" 23 23 24 #include "AuthorStyleSheets.h"25 24 #include "CSSStyleSheet.h" 26 25 #include "Document.h" 27 26 #include "HTMLNames.h" 28 27 #include "HTMLStyleElement.h" 28 #include "StyleScope.h" 29 29 #include <wtf/text/WTFString.h> 30 30 … … 46 46 if (!m_document) 47 47 return m_detachedStyleSheets; 48 return m_document-> authorStyleSheets().styleSheetsForStyleSheetList();48 return m_document->styleScope().styleSheetsForStyleSheetList(); 49 49 } 50 50 51 51 void StyleSheetList::detachFromDocument() 52 52 { 53 m_detachedStyleSheets = m_document-> authorStyleSheets().styleSheetsForStyleSheetList();53 m_detachedStyleSheets = m_document->styleScope().styleSheetsForStyleSheetList(); 54 54 m_document = nullptr; 55 55 } -
trunk/Source/WebCore/dom/Document.cpp
r206890 r206917 32 32 #include "AnimationController.h" 33 33 #include "Attr.h" 34 #include "AuthorStyleSheets.h"35 34 #include "CDATASection.h" 36 35 #include "CSSFontSelector.h" … … 169 168 #include "StyleResolveForDocument.h" 170 169 #include "StyleResolver.h" 170 #include "StyleScope.h" 171 171 #include "StyleSheetContents.h" 172 172 #include "StyleSheetList.h" … … 452 452 , m_listenerTypes(0) 453 453 , m_mutationObserverTypes(0) 454 , m_ authorStyleSheets(std::make_unique<AuthorStyleSheets>(*this))454 , m_styleScope(std::make_unique<Style::Scope>(*this)) 455 455 , m_extensionStyleSheets(std::make_unique<ExtensionStyleSheets>(*this)) 456 456 , m_visitedLinkState(std::make_unique<VisitedLinkState>(*this)) … … 1355 1355 1356 1356 // Recalculate style so language is used when selecting the initial font. 1357 m_ authorStyleSheets->didChangeContentsOrInterpretation();1357 m_styleScope->didChangeContentsOrInterpretation(); 1358 1358 } 1359 1359 … … 1813 1813 // hits a null-dereference due to security code always assuming the document has a SecurityOrigin. 1814 1814 1815 authorStyleSheets().flushPendingUpdate();1815 styleScope().flushPendingUpdate(); 1816 1816 1817 1817 frameView.willRecalcStyle(); … … 1896 1896 return false; 1897 1897 1898 return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || authorStyleSheets().hasPendingUpdate();1898 return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || styleScope().hasPendingUpdate(); 1899 1899 } 1900 1900 … … 1907 1907 return; 1908 1908 1909 authorStyleSheets().flushPendingUpdate();1909 styleScope().flushPendingUpdate(); 1910 1910 1911 1911 if (!needsStyleRecalc()) … … 1961 1961 if (bodyElement && !bodyElement->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) { 1962 1962 m_pendingSheetLayout = DidLayoutWithPendingSheets; 1963 authorStyleSheets().didChangeContentsOrInterpretation();1963 styleScope().didChangeContentsOrInterpretation(); 1964 1964 recalcStyle(Style::Force); 1965 1965 } else if (m_hasNodesWithPlaceholderStyle) … … 2143 2143 { 2144 2144 m_styleResolver = std::make_unique<StyleResolver>(*this); 2145 m_styleResolver->appendAuthorStyleSheets( authorStyleSheets().activeStyleSheets());2145 m_styleResolver->appendAuthorStyleSheets(styleScope().activeStyleSheets()); 2146 2146 } 2147 2147 … … 3086 3086 m_needsNotifyRemoveAllPendingStylesheet = false; 3087 3087 3088 authorStyleSheets().didChangeCandidatesForActiveSet();3088 styleScope().didChangeCandidatesForActiveSet(); 3089 3089 3090 3090 if (m_pendingSheetLayout == DidLayoutWithPendingSheets) { … … 3109 3109 ASSERT(!m_inStyleRecalc); 3110 3110 3111 auto& authorSheets = const_cast<AuthorStyleSheets&>(authorStyleSheets());3112 authorSheets.flushPendingUpdate();3113 return authorSheets.usesStyleBasedEditability();3111 auto& styleScope = const_cast<Style::Scope&>(this->styleScope()); 3112 styleScope.flushPendingUpdate(); 3113 return styleScope.usesStyleBasedEditability(); 3114 3114 } 3115 3115 … … 3157 3157 // http://www.hixie.ch/tests/evil/css/import/main/preferred.html 3158 3158 // -dwh 3159 authorStyleSheets().setSelectedStylesheetSetName(content);3160 authorStyleSheets().setPreferredStylesheetSetName(content);3161 authorStyleSheets().didChangeContentsOrInterpretation();3159 styleScope().setSelectedStylesheetSetName(content); 3160 styleScope().setPreferredStylesheetSetName(content); 3161 styleScope().didChangeContentsOrInterpretation(); 3162 3162 break; 3163 3163 … … 3453 3453 String Document::preferredStylesheetSet() const 3454 3454 { 3455 return authorStyleSheets().preferredStylesheetSetName();3455 return styleScope().preferredStylesheetSetName(); 3456 3456 } 3457 3457 3458 3458 String Document::selectedStylesheetSet() const 3459 3459 { 3460 return authorStyleSheets().selectedStylesheetSetName();3460 return styleScope().selectedStylesheetSetName(); 3461 3461 } 3462 3462 3463 3463 void Document::setSelectedStylesheetSet(const String& aString) 3464 3464 { 3465 authorStyleSheets().setSelectedStylesheetSetName(aString);3466 authorStyleSheets().didChangeContentsOrInterpretation();3465 styleScope().setSelectedStylesheetSetName(aString); 3466 styleScope().didChangeContentsOrInterpretation(); 3467 3467 } 3468 3468 … … 6666 6666 bool Document::haveStylesheetsLoaded() const 6667 6667 { 6668 return ! authorStyleSheets().hasPendingSheets() || m_ignorePendingStylesheets;6668 return !styleScope().hasPendingSheets() || m_ignorePendingStylesheets; 6669 6669 } 6670 6670 -
trunk/Source/WebCore/dom/Document.h
r206795 r206917 75 75 class AXObjectCache; 76 76 class Attr; 77 class AuthorStyleSheets;78 77 class CDATASection; 79 78 class CSSFontSelector; … … 225 224 #endif 226 225 226 namespace Style { 227 class Scope; 228 }; 229 227 230 const uint64_t HTMLMediaElementInvalidID = 0; 228 231 … … 505 508 WEBCORE_EXPORT StyleSheetList& styleSheets(); 506 509 507 AuthorStyleSheets& authorStyleSheets() { return *m_authorStyleSheets; }508 const AuthorStyleSheets& authorStyleSheets() const { return *m_authorStyleSheets; }510 Style::Scope& styleScope() { return *m_styleScope; } 511 const Style::Scope& styleScope() const { return *m_styleScope; } 509 512 ExtensionStyleSheets& extensionStyleSheets() { return *m_extensionStyleSheets; } 510 513 const ExtensionStyleSheets& extensionStyleSheets() const { return *m_extensionStyleSheets; } … … 1470 1473 MutationObserverOptions m_mutationObserverTypes; 1471 1474 1472 std::unique_ptr< AuthorStyleSheets> m_authorStyleSheets;1475 std::unique_ptr<Style::Scope> m_styleScope; 1473 1476 std::unique_ptr<ExtensionStyleSheets> m_extensionStyleSheets; 1474 1477 RefPtr<StyleSheetList> m_styleSheetList; -
trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp
r206361 r206917 29 29 #include "ExtensionStyleSheets.h" 30 30 31 #include "AuthorStyleSheets.h"32 31 #include "CSSStyleSheet.h" 33 32 #include "Element.h" … … 43 42 #include "StyleInvalidationAnalysis.h" 44 43 #include "StyleResolver.h" 44 #include "StyleScope.h" 45 45 #include "StyleSheetContents.h" 46 46 #include "StyleSheetList.h" … … 84 84 if (m_pageUserSheet) { 85 85 m_pageUserSheet = nullptr; 86 m_document. authorStyleSheets().didChangeContentsOrInterpretation();86 m_document.styleScope().didChangeContentsOrInterpretation(); 87 87 } 88 88 } … … 92 92 clearPageUserSheet(); 93 93 if (pageUserSheet()) 94 m_document. authorStyleSheets().didChangeContentsOrInterpretation();94 m_document.styleScope().didChangeContentsOrInterpretation(); 95 95 } 96 96 … … 156 156 if (m_injectedUserStyleSheets.isEmpty() && m_injectedAuthorStyleSheets.isEmpty()) 157 157 return; 158 m_document. authorStyleSheets().didChangeContentsOrInterpretation();158 m_document.styleScope().didChangeContentsOrInterpretation(); 159 159 } 160 160 … … 163 163 ASSERT(userSheet.get().isUserStyleSheet()); 164 164 m_userStyleSheets.append(CSSStyleSheet::create(WTFMove(userSheet), m_document)); 165 m_document. authorStyleSheets().didChangeContentsOrInterpretation();165 m_document.styleScope().didChangeContentsOrInterpretation(); 166 166 } 167 167 … … 170 170 ASSERT(!authorSheet.get().isUserStyleSheet()); 171 171 m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTFMove(authorSheet), m_document)); 172 m_document. authorStyleSheets().didChangeContentsOrInterpretation();172 m_document.styleScope().didChangeContentsOrInterpretation(); 173 173 } 174 174 … … 202 202 void ExtensionStyleSheets::styleResolverChangedTimerFired() 203 203 { 204 m_document. authorStyleSheets().didChangeContentsOrInterpretation();204 m_document.styleScope().didChangeContentsOrInterpretation(); 205 205 } 206 206 -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp
r206880 r206917 22 22 #include "InlineStyleSheetOwner.h" 23 23 24 #include "AuthorStyleSheets.h"25 24 #include "ContentSecurityPolicy.h" 26 25 #include "Element.h" … … 29 28 #include "ScriptableDocumentParser.h" 30 29 #include "ShadowRoot.h" 30 #include "StyleScope.h" 31 31 #include "StyleSheetContents.h" 32 32 #include "TextNodeTraversal.h" … … 52 52 void InlineStyleSheetOwner::insertedIntoDocument(Element& element) 53 53 { 54 m_styleS heetScope = &AuthorStyleSheets::forNode(element);55 m_styleS heetScope->addStyleSheetCandidateNode(element, m_isParsingChildren);54 m_styleScope = &Style::Scope::forNode(element); 55 m_styleScope->addStyleSheetCandidateNode(element, m_isParsingChildren); 56 56 57 57 if (m_isParsingChildren) … … 62 62 void InlineStyleSheetOwner::removedFromDocument(Element& element) 63 63 { 64 if (m_styleS heetScope) {65 m_styleS heetScope->removeStyleSheetCandidateNode(element);66 m_styleS heetScope = nullptr;64 if (m_styleScope) { 65 m_styleScope->removeStyleSheetCandidateNode(element); 66 m_styleScope = nullptr; 67 67 } 68 68 if (m_sheet) … … 75 75 m_sheet->clearOwnerNode(); 76 76 77 if (m_styleS heetScope) {78 m_styleS heetScope->removeStyleSheetCandidateNode(element);79 m_styleS heetScope = nullptr;77 if (m_styleScope) { 78 m_styleScope->removeStyleSheetCandidateNode(element); 79 m_styleScope = nullptr; 80 80 } 81 81 } … … 125 125 Document& document = element.document(); 126 126 if (m_sheet) { 127 if (m_sheet->isLoading() && m_styleS heetScope)128 m_styleS heetScope->removePendingSheet();127 if (m_sheet->isLoading() && m_styleScope) 128 m_styleScope->removePendingSheet(); 129 129 clearSheet(); 130 130 } … … 150 150 return; 151 151 152 if (m_styleS heetScope)153 m_styleS heetScope->addPendingSheet();152 if (m_styleScope) 153 m_styleScope->addPendingSheet(); 154 154 155 155 m_loading = true; … … 178 178 return false; 179 179 180 if (m_styleS heetScope)181 m_styleS heetScope->removePendingSheet();180 if (m_styleScope) 181 m_styleScope->removePendingSheet(); 182 182 183 183 return true; … … 186 186 void InlineStyleSheetOwner::startLoadingDynamicSheet(Element&) 187 187 { 188 if (m_styleS heetScope)189 m_styleS heetScope->addPendingSheet();188 if (m_styleScope) 189 m_styleScope->addPendingSheet(); 190 190 } 191 191 -
trunk/Source/WebCore/dom/InlineStyleSheetOwner.h
r206880 r206917 51 51 void finishParsingChildren(Element&); 52 52 53 AuthorStyleSheets* styleSheetScope() { return m_styleSheetScope; }53 Style::Scope* styleScope() { return m_styleScope; } 54 54 55 55 private: … … 64 64 AtomicString m_media; 65 65 RefPtr<CSSStyleSheet> m_sheet; 66 AuthorStyleSheets* m_styleSheetScope { nullptr };66 Style::Scope* m_styleScope { nullptr }; 67 67 }; 68 68 -
trunk/Source/WebCore/dom/ProcessingInstruction.cpp
r206867 r206917 23 23 #include "ProcessingInstruction.h" 24 24 25 #include "AuthorStyleSheets.h"26 25 #include "CSSStyleSheet.h" 27 26 #include "CachedCSSStyleSheet.h" … … 36 35 #include "XMLDocumentParser.h" // for parseAttributes() 37 36 #include "MediaList.h" 37 #include "StyleScope.h" 38 38 #include "StyleSheetContents.h" 39 39 … … 60 60 61 61 if (inDocument()) 62 document(). authorStyleSheets().removeStyleSheetCandidateNode(*this);62 document().styleScope().removeStyleSheetCandidateNode(*this); 63 63 } 64 64 … … 136 136 137 137 m_loading = true; 138 document(). authorStyleSheets().addPendingSheet();138 document().styleScope().addPendingSheet(); 139 139 140 140 #if ENABLE(XSLT) … … 159 159 // The request may have been denied if (for example) the stylesheet is local and the document is remote. 160 160 m_loading = false; 161 document(). authorStyleSheets().removePendingSheet();161 document().styleScope().removePendingSheet(); 162 162 } 163 163 } … … 177 177 { 178 178 if (!isLoading()) { 179 document(). authorStyleSheets().removePendingSheet();179 document().styleScope().removePendingSheet(); 180 180 return true; 181 181 } … … 252 252 if (!insertionPoint.inDocument()) 253 253 return InsertionDone; 254 document(). authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);254 document().styleScope().addStyleSheetCandidateNode(*this, m_createdByParser); 255 255 checkStyleSheet(); 256 256 return InsertionDone; … … 263 263 return; 264 264 265 document(). authorStyleSheets().removeStyleSheetCandidateNode(*this);265 document().styleScope().removeStyleSheetCandidateNode(*this); 266 266 267 267 if (m_sheet) { … … 273 273 if (m_loading) { 274 274 m_loading = false; 275 document(). authorStyleSheets().removePendingSheet();275 document().styleScope().removePendingSheet(); 276 276 } 277 277 278 278 // If we're in document teardown, then we don't need to do any notification of our sheet's removal. 279 279 if (document().hasLivingRenderTree()) 280 document(). authorStyleSheets().didChangeContentsOrInterpretation();280 document().styleScope().didChangeContentsOrInterpretation(); 281 281 } 282 282 -
trunk/Source/WebCore/dom/ShadowRoot.cpp
r206880 r206917 29 29 #include "ShadowRoot.h" 30 30 31 #include "AuthorStyleSheets.h"32 31 #include "CSSStyleSheet.h" 33 32 #include "ElementTraversal.h" … … 36 35 #include "SlotAssignment.h" 37 36 #include "StyleResolver.h" 37 #include "StyleScope.h" 38 38 #include "markup.h" 39 39 … … 43 43 unsigned countersAndFlags[1]; 44 44 void* styleResolver; 45 void* authorStyleSheets;45 void* styleScope; 46 46 void* host; 47 47 void* slotAssignment; … … 89 89 // FIXME: We could share style resolver with shadow roots that have identical style. 90 90 m_styleResolver = std::make_unique<StyleResolver>(document()); 91 if (m_ authorStyleSheets)92 m_styleResolver->appendAuthorStyleSheets(m_ authorStyleSheets->activeStyleSheets());91 if (m_styleScope) 92 m_styleResolver->appendAuthorStyleSheets(m_styleScope->activeStyleSheets()); 93 93 } 94 94 return *m_styleResolver; … … 108 108 } 109 109 110 AuthorStyleSheets& ShadowRoot::authorStyleSheets()111 { 112 if (!m_ authorStyleSheets)113 m_ authorStyleSheets = std::make_unique<AuthorStyleSheets>(*this);114 return *m_ authorStyleSheets;110 Style::Scope& ShadowRoot::styleScope() 111 { 112 if (!m_styleScope) 113 m_styleScope = std::make_unique<Style::Scope>(*this); 114 return *m_styleScope; 115 115 } 116 116 117 117 void ShadowRoot::updateStyle() 118 118 { 119 if (!m_ authorStyleSheets)119 if (!m_styleScope) 120 120 return; 121 121 // FIXME: Make optimized updated work. 122 m_ authorStyleSheets->didChangeContentsOrInterpretation();122 m_styleScope->didChangeContentsOrInterpretation(); 123 123 } 124 124 -
trunk/Source/WebCore/dom/ShadowRoot.h
r206880 r206917 37 37 namespace WebCore { 38 38 39 class AuthorStyleSheets;40 39 class HTMLSlotElement; 41 40 class SlotAssignment; … … 65 64 StyleResolver& styleResolver(); 66 65 StyleResolver* styleResolverIfExists(); 67 AuthorStyleSheets& authorStyleSheets();66 Style::Scope& styleScope(); 68 67 69 68 void updateStyle(); … … 117 116 118 117 std::unique_ptr<StyleResolver> m_styleResolver; 119 std::unique_ptr< AuthorStyleSheets> m_authorStyleSheets;118 std::unique_ptr<Style::Scope> m_styleScope; 120 119 121 120 std::unique_ptr<SlotAssignment> m_slotAssignment; -
trunk/Source/WebCore/html/HTMLLinkElement.cpp
r206902 r206917 27 27 28 28 #include "Attribute.h" 29 #include "AuthorStyleSheets.h"30 29 #include "CachedCSSStyleSheet.h" 31 30 #include "CachedResource.h" … … 55 54 #include "StyleInheritedData.h" 56 55 #include "StyleResolveForDocument.h" 56 #include "StyleScope.h" 57 57 #include "StyleSheetContents.h" 58 58 #include <wtf/Ref.h> … … 103 103 104 104 if (inDocument()) 105 document(). authorStyleSheets().removeStyleSheetCandidateNode(*this);105 document().styleScope().removeStyleSheetCandidateNode(*this); 106 106 107 107 linkLoadEventSender().cancelEvent(*this); … … 141 141 process(); 142 142 else 143 document(). authorStyleSheets().didChangeContentsOrInterpretation();143 document().styleScope().didChangeContentsOrInterpretation(); 144 144 } 145 145 } … … 177 177 process(); 178 178 if (m_sheet && !isDisabled()) 179 document(). authorStyleSheets().didChangeContentsOrInterpretation();179 document().styleScope().didChangeContentsOrInterpretation(); 180 180 return; 181 181 } … … 284 284 // we no longer contain a stylesheet, e.g. perhaps rel or type was changed 285 285 clearSheet(); 286 document(). authorStyleSheets().didChangeContentsOrInterpretation();286 document().styleScope().didChangeContentsOrInterpretation(); 287 287 } 288 288 } … … 306 306 return InsertionDone; 307 307 308 document(). authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);308 document().styleScope().addStyleSheetCandidateNode(*this, m_createdByParser); 309 309 310 310 process(); … … 322 322 return; 323 323 } 324 document(). authorStyleSheets().removeStyleSheetCandidateNode(*this);324 document().styleScope().removeStyleSheetCandidateNode(*this); 325 325 326 326 if (m_sheet) … … 545 545 if (m_pendingSheetType == InactiveSheet) 546 546 return; 547 document(). authorStyleSheets().addPendingSheet();547 document().styleScope().addPendingSheet(); 548 548 } 549 549 … … 558 558 if (type == InactiveSheet) { 559 559 // Document just needs to know about the sheet for exposure through document.styleSheets 560 document(). authorStyleSheets().didChangeCandidatesForActiveSet();561 return; 562 } 563 564 document(). authorStyleSheets().removePendingSheet(560 document().styleScope().didChangeCandidatesForActiveSet(); 561 return; 562 } 563 564 document().styleScope().removePendingSheet( 565 565 notification == RemovePendingSheetNotifyImmediately 566 ? AuthorStyleSheets::RemovePendingSheetNotifyImmediately567 : AuthorStyleSheets::RemovePendingSheetNotifyLater);566 ? Style::Scope::RemovePendingSheetNotifyImmediately 567 : Style::Scope::RemovePendingSheetNotifyLater); 568 568 } 569 569 -
trunk/Source/WebCore/html/HTMLStyleElement.cpp
r206880 r206917 25 25 #include "HTMLStyleElement.h" 26 26 27 #include "AuthorStyleSheets.h"28 27 #include "CachedResource.h" 29 28 #include "Document.h" … … 36 35 #include "ScriptableDocumentParser.h" 37 36 #include "ShadowRoot.h" 37 #include "StyleScope.h" 38 38 #include "StyleSheetContents.h" 39 39 … … 77 77 if (sheet()) { 78 78 sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value)); 79 if (auto* scope = m_styleSheetOwner.styleS heetScope())79 if (auto* scope = m_styleSheetOwner.styleScope()) 80 80 scope->didChangeContentsOrInterpretation(); 81 81 } else -
trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp
r206361 r206917 27 27 #include "InspectorCSSAgent.h" 28 28 29 #include "AuthorStyleSheets.h"30 29 #include "CSSComputedStyleDeclaration.h" 31 30 #include "CSSImportRule.h" … … 57 56 #include "StyleResolver.h" 58 57 #include "StyleRule.h" 58 #include "StyleScope.h" 59 59 #include "StyleSheetList.h" 60 60 #include "WebKitNamedFlow.h" … … 671 671 void InspectorCSSAgent::collectAllDocumentStyleSheets(Document& document, Vector<CSSStyleSheet*>& result) 672 672 { 673 auto cssStyleSheets = document. authorStyleSheets().activeStyleSheetsForInspector();673 auto cssStyleSheets = document.styleScope().activeStyleSheetsForInspector(); 674 674 for (auto& cssStyleSheet : cssStyleSheets) 675 675 collectStyleSheets(cssStyleSheet.get(), result); … … 890 890 else 891 891 m_nodeIdToForcedPseudoState.remove(nodeId); 892 element->document(). authorStyleSheets().didChangeContentsOrInterpretation();892 element->document().styleScope().didChangeContentsOrInterpretation(); 893 893 } 894 894 … … 1016 1016 // StyleRules returned by StyleResolver::styleRulesForElement lack parent pointers since that infomation is not cheaply available. 1017 1017 // Since the inspector wants to walk the parent chain, we construct the full wrappers here. 1018 CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule, styleResolver.document(). authorStyleSheets(), styleResolver.document().extensionStyleSheets());1018 CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule, styleResolver.document().styleScope(), styleResolver.document().extensionStyleSheets()); 1019 1019 if (!cssomWrapper) 1020 1020 return nullptr; … … 1190 1190 m_nodeIdToForcedPseudoState.clear(); 1191 1191 for (auto& document : documentsToChange) 1192 document-> authorStyleSheets().didChangeContentsOrInterpretation();1192 document->styleScope().didChangeContentsOrInterpretation(); 1193 1193 } 1194 1194 -
trunk/Source/WebCore/inspector/InspectorPageAgent.cpp
r206361 r206917 33 33 #include "InspectorPageAgent.h" 34 34 35 #include "AuthorStyleSheets.h"36 35 #include "CachedCSSStyleSheet.h" 37 36 #include "CachedFont.h" … … 68 67 #include "SecurityOrigin.h" 69 68 #include "Settings.h" 69 #include "StyleScope.h" 70 70 #include "TextEncoding.h" 71 71 #include "TextResourceDecoder.h" … … 1003 1003 Document* document = m_page.mainFrame().document(); 1004 1004 if (document) { 1005 document-> authorStyleSheets().didChangeContentsOrInterpretation();1005 document->styleScope().didChangeContentsOrInterpretation(); 1006 1006 document->updateLayout(); 1007 1007 } -
trunk/Source/WebCore/page/DOMWindow.cpp
r206880 r206917 28 28 #include "DOMWindow.h" 29 29 30 #include "AuthorStyleSheets.h"31 30 #include "BackForwardController.h" 32 31 #include "BarProp.h" … … 98 97 #include "StyleMedia.h" 99 98 #include "StyleResolver.h" 99 #include "StyleScope.h" 100 100 #include "SuddenTermination.h" 101 101 #include "URL.h" … … 1433 1433 return nullptr; 1434 1434 1435 m_frame->document()-> authorStyleSheets().flushPendingUpdate();1435 m_frame->document()->styleScope().flushPendingUpdate(); 1436 1436 1437 1437 unsigned rulesToInclude = StyleResolver::AuthorCSSRules; -
trunk/Source/WebCore/page/Frame.cpp
r206361 r206917 33 33 #include "AnimationController.h" 34 34 #include "ApplyStyleCommand.h" 35 #include "AuthorStyleSheets.h"36 35 #include "BackForwardController.h" 37 36 #include "CSSComputedStyleDeclaration.h" … … 94 93 #include "Settings.h" 95 94 #include "StyleProperties.h" 95 #include "StyleScope.h" 96 96 #include "TextNodeTraversal.h" 97 97 #include "TextResourceDecoder.h" … … 645 645 view()->adjustMediaTypeForPrinting(printing); 646 646 647 m_doc-> authorStyleSheets().didChangeContentsOrInterpretation();647 m_doc->styleScope().didChangeContentsOrInterpretation(); 648 648 if (shouldUsePrintingLayout()) { 649 649 view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize); -
trunk/Source/WebCore/page/FrameView.cpp
r206743 r206917 30 30 #include "AXObjectCache.h" 31 31 #include "AnimationController.h" 32 #include "AuthorStyleSheets.h"33 32 #include "BackForwardController.h" 34 33 #include "CachedImage.h" … … 93 92 #include "Settings.h" 94 93 #include "StyleResolver.h" 94 #include "StyleScope.h" 95 95 #include "TextResourceDecoder.h" 96 96 #include "TextStream.h" … … 1336 1336 if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) { 1337 1337 LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc"); 1338 document. authorStyleSheets().didChangeContentsOrInterpretation();1338 document.styleScope().didChangeContentsOrInterpretation(); 1339 1339 // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds. 1340 1340 InspectorInstrumentation::mediaQueryResultChanged(document); … … 3533 3533 m_pagination = pagination; 3534 3534 3535 frame().document()-> authorStyleSheets().didChangeContentsOrInterpretation();3535 frame().document()->styleScope().didChangeContentsOrInterpretation(); 3536 3536 } 3537 3537 … … 5002 5002 // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously 5003 5003 // dirtying style here causes assertions on iOS (rdar://problem/19998166). 5004 document-> authorStyleSheets().didChangeContentsOrInterpretation();5004 document->styleScope().didChangeContentsOrInterpretation(); 5005 5005 } 5006 5006 } -
trunk/Source/WebCore/page/Page.cpp
r206527 r206917 24 24 #include "AnimationController.h" 25 25 #include "ApplicationCacheStorage.h" 26 #include "AuthorStyleSheets.h"27 26 #include "BackForwardClient.h" 28 27 #include "BackForwardController.h" … … 91 90 #include "StorageNamespaceProvider.h" 92 91 #include "StyleResolver.h" 92 #include "StyleScope.h" 93 93 #include "SubframeLoader.h" 94 94 #include "TextResourceDecoder.h" … … 425 425 426 426 if (m_mainFrame->document()) 427 m_mainFrame->document()-> authorStyleSheets().didChangeContentsOrInterpretation();427 m_mainFrame->document()->styleScope().didChangeContentsOrInterpretation(); 428 428 } 429 429 #endif // ENABLE(VIEW_MODE_CSS_MEDIA) … … 503 503 for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) { 504 504 if (Document* document = frame->document()) 505 document-> authorStyleSheets().didChangeContentsOrInterpretation();505 document->styleScope().didChangeContentsOrInterpretation(); 506 506 } 507 507 } … … 1164 1164 continue; 1165 1165 document->extensionStyleSheets().invalidateInjectedStyleSheetCache(); 1166 document-> authorStyleSheets().didChangeContentsOrInterpretation();1166 document->styleScope().didChangeContentsOrInterpretation(); 1167 1167 } 1168 1168 } -
trunk/Source/WebCore/style/StyleScope.cpp
r206916 r206917 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2004-2009, 2011-2012, 2015 Apple Inc. All rights reserved.6 * Copyright (C) 2004-2009, 2011-2012, 2015-2016 Apple Inc. All rights reserved. 7 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 8 8 * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved. … … 27 27 28 28 #include "config.h" 29 #include " AuthorStyleSheets.h"29 #include "StyleScope.h" 30 30 31 31 #include "CSSStyleSheet.h" … … 57 57 using namespace HTMLNames; 58 58 59 AuthorStyleSheets::AuthorStyleSheets(Document& document) 59 namespace Style { 60 61 Scope::Scope(Document& document) 60 62 : m_document(document) 61 , m_pendingUpdateTimer(*this, & AuthorStyleSheets::pendingUpdateTimerFired)62 { 63 } 64 65 AuthorStyleSheets::AuthorStyleSheets(ShadowRoot& shadowRoot)63 , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired) 64 { 65 } 66 67 Scope::Scope(ShadowRoot& shadowRoot) 66 68 : m_document(shadowRoot.documentScope()) 67 69 , m_shadowRoot(&shadowRoot) 68 , m_pendingUpdateTimer(*this, & AuthorStyleSheets::pendingUpdateTimerFired)69 { 70 } 71 72 StyleResolver& AuthorStyleSheets::styleResolver()70 , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired) 71 { 72 } 73 74 StyleResolver& Scope::styleResolver() 73 75 { 74 76 if (m_shadowRoot) … … 78 80 } 79 81 80 StyleResolver* AuthorStyleSheets::styleResolverIfExists()82 StyleResolver* Scope::styleResolverIfExists() 81 83 { 82 84 if (m_shadowRoot) … … 86 88 } 87 89 88 AuthorStyleSheets& AuthorStyleSheets::forNode(Node& node)90 Scope& Scope::forNode(Node& node) 89 91 { 90 92 ASSERT(node.inDocument()); 91 93 auto* shadowRoot = node.containingShadowRoot(); 92 94 if (shadowRoot) 93 return shadowRoot-> authorStyleSheets();94 return node.document(). authorStyleSheets();95 return shadowRoot->styleScope(); 96 return node.document().styleScope(); 95 97 } 96 98 97 99 // This method is called whenever a top-level stylesheet has finished loading. 98 void AuthorStyleSheets::removePendingSheet(RemovePendingSheetNotificationType notification)100 void Scope::removePendingSheet(RemovePendingSheetNotificationType notification) 99 101 { 100 102 // Make sure we knew this sheet was pending, and that our count isn't out of sync. … … 124 126 } 125 127 126 void AuthorStyleSheets::addStyleSheetCandidateNode(Node& node, bool createdByParser)128 void Scope::addStyleSheetCandidateNode(Node& node, bool createdByParser) 127 129 { 128 130 if (!node.inDocument()) … … 157 159 } 158 160 159 void AuthorStyleSheets::removeStyleSheetCandidateNode(Node& node)161 void Scope::removeStyleSheetCandidateNode(Node& node) 160 162 { 161 163 if (m_styleSheetCandidateNodes.remove(&node)) … … 163 165 } 164 166 165 void AuthorStyleSheets::collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>& sheets)167 void Scope::collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>& sheets) 166 168 { 167 169 if (m_document.settings() && !m_document.settings()->authorAndUserStylesEnabled()) … … 241 243 } 242 244 243 AuthorStyleSheets::StyleResolverUpdateType AuthorStyleSheets::analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc)245 Scope::StyleResolverUpdateType Scope::analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc) 244 246 { 245 247 requiresFullStyleRecalc = true; … … 308 310 } 309 311 310 void AuthorStyleSheets::updateActiveStyleSheets(UpdateType updateType)312 void Scope::updateActiveStyleSheets(UpdateType updateType) 311 313 { 312 314 ASSERT(!m_pendingUpdateType); … … 374 376 } 375 377 376 void AuthorStyleSheets::updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets, StyleResolverUpdateType updateType)378 void Scope::updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets, StyleResolverUpdateType updateType) 377 379 { 378 380 if (updateType == Reconstruct) { … … 405 407 } 406 408 407 const Vector<RefPtr<CSSStyleSheet>> AuthorStyleSheets::activeStyleSheetsForInspector() const409 const Vector<RefPtr<CSSStyleSheet>> Scope::activeStyleSheetsForInspector() const 408 410 { 409 411 Vector<RefPtr<CSSStyleSheet>> result; … … 426 428 } 427 429 428 bool AuthorStyleSheets::activeStyleSheetsContains(const CSSStyleSheet* sheet) const430 bool Scope::activeStyleSheetsContains(const CSSStyleSheet* sheet) const 429 431 { 430 432 if (!m_weakCopyOfActiveStyleSheetListForFastLookup) { … … 436 438 } 437 439 438 void AuthorStyleSheets::flushPendingUpdate()440 void Scope::flushPendingUpdate() 439 441 { 440 442 if (!m_pendingUpdateType) … … 447 449 } 448 450 449 void AuthorStyleSheets::clearPendingUpdate()451 void Scope::clearPendingUpdate() 450 452 { 451 453 m_pendingUpdateTimer.stop(); … … 453 455 } 454 456 455 void AuthorStyleSheets::scheduleActiveSetUpdate()457 void Scope::scheduleActiveSetUpdate() 456 458 { 457 459 if (m_shadowRoot) { … … 467 469 } 468 470 469 void AuthorStyleSheets::didChangeCandidatesForActiveSet()471 void Scope::didChangeCandidatesForActiveSet() 470 472 { 471 473 auto updateType = m_pendingUpdateType.valueOr(UpdateType::ActiveSet); … … 474 476 } 475 477 476 void AuthorStyleSheets::didChangeContentsOrInterpretation()478 void Scope::didChangeContentsOrInterpretation() 477 479 { 478 480 clearPendingUpdate(); … … 480 482 } 481 483 482 void AuthorStyleSheets::pendingUpdateTimerFired()484 void Scope::pendingUpdateTimerFired() 483 485 { 484 486 flushPendingUpdate(); … … 486 488 487 489 } 490 } -
trunk/Source/WebCore/style/StyleScope.h
r206916 r206917 4 4 * (C) 2001 Dirk Mueller (mueller@kde.org) 5 5 * (C) 2006 Alexey Proskuryakov (ap@webkit.org) 6 * Copyright (C) 2004-2010, 2012-2013, 2015 Apple Inc. All rights reserved.6 * Copyright (C) 2004-2010, 2012-2013, 2015-2016 Apple Inc. All rights reserved. 7 7 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) 8 8 * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies) … … 26 26 */ 27 27 28 #ifndef AuthorStyleSheets_h 29 #define AuthorStyleSheets_h 28 #pragma once 30 29 31 30 #include "Timer.h" … … 50 49 class TreeScope; 51 50 52 class AuthorStyleSheets { 51 namespace Style { 52 53 class Scope { 53 54 WTF_MAKE_FAST_ALLOCATED; 54 55 public: 55 explicit AuthorStyleSheets(Document&);56 explicit AuthorStyleSheets(ShadowRoot&);56 explicit Scope(Document&); 57 explicit Scope(ShadowRoot&); 57 58 58 59 const Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets() const { return m_activeStyleSheets; } … … 92 93 StyleResolver* styleResolverIfExists(); 93 94 94 static AuthorStyleSheets& forNode(Node&);95 static Scope& forNode(Node&); 95 96 96 97 private: … … 119 120 Timer m_pendingUpdateTimer; 120 121 121 // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().122 122 mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup; 123 123 … … 140 140 141 141 } 142 143 #endif 144 142 } -
trunk/Source/WebCore/style/StyleTreeResolver.cpp
r206641 r206917 27 27 #include "StyleTreeResolver.h" 28 28 29 #include "AuthorStyleSheets.h"30 29 #include "CSSFontSelector.h" 31 30 #include "ComposedTreeAncestorIterator.h" … … 46 45 #include "StyleFontSizeFunctions.h" 47 46 #include "StyleResolver.h" 47 #include "StyleScope.h" 48 48 #include "Text.h" 49 49 -
trunk/Source/WebCore/svg/SVGFontFaceElement.cpp
r206361 r206917 25 25 #include "SVGFontFaceElement.h" 26 26 27 #include "AuthorStyleSheets.h"28 27 #include "CSSFontFaceSrcValue.h" 29 28 #include "CSSParser.h" … … 43 42 #include "StyleResolver.h" 44 43 #include "StyleRule.h" 44 #include "StyleScope.h" 45 45 #include <math.h> 46 46 … … 268 268 } 269 269 270 document(). authorStyleSheets().didChangeContentsOrInterpretation();270 document().styleScope().didChangeContentsOrInterpretation(); 271 271 } 272 272 … … 293 293 m_fontFaceRule->mutableProperties().clear(); 294 294 295 document(). authorStyleSheets().didChangeContentsOrInterpretation();295 document().styleScope().didChangeContentsOrInterpretation(); 296 296 } else 297 297 ASSERT(!m_fontElement); -
trunk/Source/WebCore/xml/XMLTreeViewer.cpp
r206361 r206917 33 33 #if ENABLE(XSLT) 34 34 35 #include "AuthorStyleSheets.h"36 35 #include "Document.h" 37 36 #include "Element.h" … … 42 41 #include "SecurityOrigin.h" 43 42 #include "SecurityOriginPolicy.h" 43 #include "StyleScope.h" 44 44 #include "Text.h" 45 45 #include "XMLViewerCSS.h" … … 65 65 auto text = m_document.createTextNode(cssString); 66 66 m_document.getElementById(String(ASCIILiteral("xml-viewer-style")))->appendChild(text, IGNORE_EXCEPTION); 67 m_document. authorStyleSheets().didChangeContentsOrInterpretation();67 m_document.styleScope().didChangeContentsOrInterpretation(); 68 68 } 69 69 -
trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp
r206903 r206917 27 27 #include "XMLDocumentParser.h" 28 28 29 #include "AuthorStyleSheets.h"30 29 #include "CDATASection.h" 31 30 #include "CachedScript.h" … … 50 49 #include "ScriptElement.h" 51 50 #include "ScriptSourceCode.h" 51 #include "StyleScope.h" 52 52 #include "TextResourceDecoder.h" 53 53 #include "TreeDepthLimit.h" … … 201 201 else { 202 202 updateLeafTextNode(); 203 document()-> authorStyleSheets().didChangeContentsOrInterpretation();203 document()->styleScope().didChangeContentsOrInterpretation(); 204 204 } 205 205 -
trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp
r206867 r206917 29 29 #include "XMLDocumentParser.h" 30 30 31 #include "AuthorStyleSheets.h"32 31 #include "CDATASection.h" 33 32 #include "CachedScript.h" … … 57 56 #include "SecurityOrigin.h" 58 57 #include "Settings.h" 58 #include "StyleScope.h" 59 59 #include "TextResourceDecoder.h" 60 60 #include "TransformSource.h" … … 1388 1388 1389 1389 document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets. 1390 document()-> authorStyleSheets().didChangeContentsOrInterpretation();1390 document()->styleScope().didChangeContentsOrInterpretation(); 1391 1391 1392 1392 // styleResolverChanged() call can detach the parser and null out its document. -
trunk/Source/WebKit/mac/WebView/WebHTMLView.mm
r206867 r206917 73 73 #import "WebUIDelegatePrivate.h" 74 74 #import "WebViewInternal.h" 75 #import <WebCore/AuthorStyleSheets.h>76 75 #import <WebCore/CSSStyleDeclaration.h> 77 76 #import <WebCore/CachedImage.h> … … 120 119 #import <WebCore/SharedBuffer.h> 121 120 #import <WebCore/StyleProperties.h> 121 #import <WebCore/StyleScope.h> 122 122 #import <WebCore/Text.h> 123 123 #import <WebCore/TextAlternativeWithRange.h> … … 3613 3613 3614 3614 if (Frame* coreFrame = core([self _frame])) { 3615 coreFrame->document()-> authorStyleSheets().didChangeContentsOrInterpretation();3615 coreFrame->document()->styleScope().didChangeContentsOrInterpretation(); 3616 3616 coreFrame->document()->updateStyleIfNeeded(); 3617 3617 } … … 5008 5008 document->setPaginatedForScreen(_private->paginateScreenContent); 5009 5009 document->setPrinting(_private->printing); 5010 document-> authorStyleSheets().didChangeContentsOrInterpretation();5010 document->styleScope().didChangeContentsOrInterpretation(); 5011 5011 } 5012 5012 }
Note: See TracChangeset
for help on using the changeset viewer.