<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[206917] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206917">206917</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-10-07 09:55:11 -0700 (Fri, 07 Oct 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Rename AuthorStyleSheets to Style::Scope
https://bugs.webkit.org/show_bug.cgi?id=163108
Reviewed by Andreas Kling.
It represents the style scope in DOM.
Also move the file under style/.
* CMakeLists.txt:
* WebCore.xcodeproj/project.pbxproj:
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::styleSheetScope):
* css/CSSStyleSheet.h:
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
* css/InspectorCSSOMWrappers.h:
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):
* dom/AuthorStyleSheets.cpp: Removed.
* dom/AuthorStyleSheets.h: Removed.
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::setContentLanguage):
(WebCore::Document::recalcStyle):
(WebCore::Document::needsStyleRecalc):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::createStyleResolver):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::haveStylesheetsLoaded):
* dom/Document.h:
(WebCore::Document::styleScope):
(WebCore::Document::authorStyleSheets): Deleted.
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/InlineStyleSheetOwner.h:
(WebCore::InlineStyleSheetOwner::styleScope):
(WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::styleResolver):
(WebCore::ShadowRoot::styleScope):
(WebCore::ShadowRoot::updateStyle):
(WebCore::ShadowRoot::authorStyleSheets): Deleted.
* dom/ShadowRoot.h:
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::buildObjectForRule):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/DOMWindow.cpp:
(WebCore::DOMWindow::getMatchedCSSRules):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
(WebCore::Style::Scope::Scope):
(WebCore::Style::Scope::styleResolver):
(WebCore::Style::Scope::styleResolverIfExists):
(WebCore::Style::Scope::forNode):
(WebCore::Style::Scope::removePendingSheet):
(WebCore::Style::Scope::addStyleSheetCandidateNode):
(WebCore::Style::Scope::removeStyleSheetCandidateNode):
(WebCore::Style::Scope::collectActiveStyleSheets):
(WebCore::Style::Scope::analyzeStyleSheetChange):
(WebCore::Style::Scope::updateActiveStyleSheets):
(WebCore::Style::Scope::updateStyleResolver):
(WebCore::Style::Scope::activeStyleSheetsForInspector):
(WebCore::Style::Scope::activeStyleSheetsContains):
(WebCore::Style::Scope::flushPendingUpdate):
(WebCore::Style::Scope::clearPendingUpdate):
(WebCore::Style::Scope::scheduleActiveSetUpdate):
(WebCore::Style::Scope::didChangeCandidatesForActiveSet):
(WebCore::Style::Scope::didChangeContentsOrInterpretation):
(WebCore::Style::Scope::pendingUpdateTimerFired):
(WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::styleResolver): Deleted.
(WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
(WebCore::AuthorStyleSheets::forNode): Deleted.
(WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
(WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
(WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
(WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
(WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
(WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
(WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
(WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
(WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
(WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
(WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
* style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
* style/StyleTreeResolver.cpp:
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleSheetcpp">trunk/Source/WebCore/css/CSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleSheeth">trunk/Source/WebCore/css/CSSStyleSheet.h</a></li>
<li><a href="#trunkSourceWebCorecssInspectorCSSOMWrapperscpp">trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp</a></li>
<li><a href="#trunkSourceWebCorecssInspectorCSSOMWrappersh">trunk/Source/WebCore/css/InspectorCSSOMWrappers.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetListcpp">trunk/Source/WebCore/css/StyleSheetList.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomExtensionStyleSheetscpp">trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomInlineStyleSheetOwnercpp">trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp</a></li>
<li><a href="#trunkSourceWebCoredomInlineStyleSheetOwnerh">trunk/Source/WebCore/dom/InlineStyleSheetOwner.h</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRootcpp">trunk/Source/WebCore/dom/ShadowRoot.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRooth">trunk/Source/WebCore/dom/ShadowRoot.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLStyleElementcpp">trunk/Source/WebCore/html/HTMLStyleElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorepageDOMWindowcpp">trunk/Source/WebCore/page/DOMWindow.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleTreeResolvercpp">trunk/Source/WebCore/style/StyleTreeResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceElementcpp">trunk/Source/WebCore/svg/SVGFontFaceElement.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLTreeViewercpp">trunk/Source/WebCore/xml/XMLTreeViewer.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParsercpp">trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebCorestyleStyleScopecpp">trunk/Source/WebCore/style/StyleScope.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleScopeh">trunk/Source/WebCore/style/StyleScope.h</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoredomAuthorStyleSheetscpp">trunk/Source/WebCore/dom/AuthorStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomAuthorStyleSheetsh">trunk/Source/WebCore/dom/AuthorStyleSheets.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -1384,7 +1384,6 @@
</span><span class="cx"> dom/ActiveDOMObject.cpp
</span><span class="cx"> dom/AnimationEvent.cpp
</span><span class="cx"> dom/Attr.cpp
</span><del>- dom/AuthorStyleSheets.cpp
</del><span class="cx"> dom/BeforeTextInsertedEvent.cpp
</span><span class="cx"> dom/BeforeUnloadEvent.cpp
</span><span class="cx"> dom/CDATASection.cpp
</span><span class="lines">@@ -2650,6 +2649,7 @@
</span><span class="cx"> style/StylePendingResources.cpp
</span><span class="cx"> style/StyleRelations.cpp
</span><span class="cx"> style/StyleResolveForDocument.cpp
</span><ins>+ style/StyleScope.cpp
</ins><span class="cx"> style/StyleSharingResolver.cpp
</span><span class="cx"> style/StyleTreeResolver.cpp
</span><span class="cx"> style/StyleUpdate.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/ChangeLog        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -1,3 +1,153 @@
</span><ins>+2016-10-07 Antti Koivisto <antti@apple.com>
+
+ Rename AuthorStyleSheets to Style::Scope
+ https://bugs.webkit.org/show_bug.cgi?id=163108
+
+ Reviewed by Andreas Kling.
+
+ It represents the style scope in DOM.
+ Also move the file under style/.
+
+ * CMakeLists.txt:
+ * WebCore.xcodeproj/project.pbxproj:
+ * css/CSSStyleSheet.cpp:
+ (WebCore::CSSStyleSheet::styleSheetScope):
+ * css/CSSStyleSheet.h:
+ * css/InspectorCSSOMWrappers.cpp:
+ (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
+ * css/InspectorCSSOMWrappers.h:
+ * css/StyleSheetList.cpp:
+ (WebCore::StyleSheetList::styleSheets):
+ (WebCore::StyleSheetList::detachFromDocument):
+ * dom/AuthorStyleSheets.cpp: Removed.
+ * dom/AuthorStyleSheets.h: Removed.
+ * dom/Document.cpp:
+ (WebCore::Document::Document):
+ (WebCore::Document::setContentLanguage):
+ (WebCore::Document::recalcStyle):
+ (WebCore::Document::needsStyleRecalc):
+ (WebCore::Document::updateStyleIfNeeded):
+ (WebCore::Document::updateLayoutIgnorePendingStylesheets):
+ (WebCore::Document::createStyleResolver):
+ (WebCore::Document::didRemoveAllPendingStylesheet):
+ (WebCore::Document::usesStyleBasedEditability):
+ (WebCore::Document::processHttpEquiv):
+ (WebCore::Document::preferredStylesheetSet):
+ (WebCore::Document::selectedStylesheetSet):
+ (WebCore::Document::setSelectedStylesheetSet):
+ (WebCore::Document::haveStylesheetsLoaded):
+ * dom/Document.h:
+ (WebCore::Document::styleScope):
+ (WebCore::Document::authorStyleSheets): Deleted.
+ * dom/ExtensionStyleSheets.cpp:
+ (WebCore::ExtensionStyleSheets::clearPageUserSheet):
+ (WebCore::ExtensionStyleSheets::updatePageUserSheet):
+ (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
+ (WebCore::ExtensionStyleSheets::addUserStyleSheet):
+ (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
+ (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
+ * dom/InlineStyleSheetOwner.cpp:
+ (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
+ (WebCore::InlineStyleSheetOwner::removedFromDocument):
+ (WebCore::InlineStyleSheetOwner::clearDocumentData):
+ (WebCore::InlineStyleSheetOwner::createSheet):
+ (WebCore::InlineStyleSheetOwner::sheetLoaded):
+ (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
+ * dom/InlineStyleSheetOwner.h:
+ (WebCore::InlineStyleSheetOwner::styleScope):
+ (WebCore::InlineStyleSheetOwner::styleSheetScope): Deleted.
+ * dom/ProcessingInstruction.cpp:
+ (WebCore::ProcessingInstruction::~ProcessingInstruction):
+ (WebCore::ProcessingInstruction::checkStyleSheet):
+ (WebCore::ProcessingInstruction::sheetLoaded):
+ (WebCore::ProcessingInstruction::insertedInto):
+ (WebCore::ProcessingInstruction::removedFrom):
+ * dom/ShadowRoot.cpp:
+ (WebCore::ShadowRoot::styleResolver):
+ (WebCore::ShadowRoot::styleScope):
+ (WebCore::ShadowRoot::updateStyle):
+ (WebCore::ShadowRoot::authorStyleSheets): Deleted.
+ * dom/ShadowRoot.h:
+ * html/HTMLLinkElement.cpp:
+ (WebCore::HTMLLinkElement::~HTMLLinkElement):
+ (WebCore::HTMLLinkElement::setDisabledState):
+ (WebCore::HTMLLinkElement::parseAttribute):
+ (WebCore::HTMLLinkElement::process):
+ (WebCore::HTMLLinkElement::insertedInto):
+ (WebCore::HTMLLinkElement::removedFrom):
+ (WebCore::HTMLLinkElement::addPendingSheet):
+ (WebCore::HTMLLinkElement::removePendingSheet):
+ * html/HTMLStyleElement.cpp:
+ * inspector/InspectorCSSAgent.cpp:
+ (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
+ (WebCore::InspectorCSSAgent::forcePseudoState):
+ (WebCore::InspectorCSSAgent::buildObjectForRule):
+ (WebCore::InspectorCSSAgent::resetPseudoStates):
+ * inspector/InspectorPageAgent.cpp:
+ (WebCore::InspectorPageAgent::setEmulatedMedia):
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::getMatchedCSSRules):
+ * page/Frame.cpp:
+ (WebCore::Frame::setPrinting):
+ * page/FrameView.cpp:
+ (WebCore::FrameView::layout):
+ (WebCore::FrameView::setPagination):
+ (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
+ * page/Page.cpp:
+ (WebCore::Page::setViewMode):
+ (WebCore::Page::setNeedsRecalcStyleInAllFrames):
+ (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
+ * style/StyleScope.cpp: Copied from dom/AuthorStyleSheets.cpp.
+ (WebCore::Style::Scope::Scope):
+ (WebCore::Style::Scope::styleResolver):
+ (WebCore::Style::Scope::styleResolverIfExists):
+ (WebCore::Style::Scope::forNode):
+ (WebCore::Style::Scope::removePendingSheet):
+ (WebCore::Style::Scope::addStyleSheetCandidateNode):
+ (WebCore::Style::Scope::removeStyleSheetCandidateNode):
+ (WebCore::Style::Scope::collectActiveStyleSheets):
+ (WebCore::Style::Scope::analyzeStyleSheetChange):
+ (WebCore::Style::Scope::updateActiveStyleSheets):
+ (WebCore::Style::Scope::updateStyleResolver):
+ (WebCore::Style::Scope::activeStyleSheetsForInspector):
+ (WebCore::Style::Scope::activeStyleSheetsContains):
+ (WebCore::Style::Scope::flushPendingUpdate):
+ (WebCore::Style::Scope::clearPendingUpdate):
+ (WebCore::Style::Scope::scheduleActiveSetUpdate):
+ (WebCore::Style::Scope::didChangeCandidatesForActiveSet):
+ (WebCore::Style::Scope::didChangeContentsOrInterpretation):
+ (WebCore::Style::Scope::pendingUpdateTimerFired):
+ (WebCore::AuthorStyleSheets::AuthorStyleSheets): Deleted.
+ (WebCore::AuthorStyleSheets::styleResolver): Deleted.
+ (WebCore::AuthorStyleSheets::styleResolverIfExists): Deleted.
+ (WebCore::AuthorStyleSheets::forNode): Deleted.
+ (WebCore::AuthorStyleSheets::removePendingSheet): Deleted.
+ (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode): Deleted.
+ (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode): Deleted.
+ (WebCore::AuthorStyleSheets::collectActiveStyleSheets): Deleted.
+ (WebCore::AuthorStyleSheets::analyzeStyleSheetChange): Deleted.
+ (WebCore::AuthorStyleSheets::updateActiveStyleSheets): Deleted.
+ (WebCore::AuthorStyleSheets::updateStyleResolver): Deleted.
+ (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector): Deleted.
+ (WebCore::AuthorStyleSheets::activeStyleSheetsContains): Deleted.
+ (WebCore::AuthorStyleSheets::flushPendingUpdate): Deleted.
+ (WebCore::AuthorStyleSheets::clearPendingUpdate): Deleted.
+ (WebCore::AuthorStyleSheets::scheduleActiveSetUpdate): Deleted.
+ (WebCore::AuthorStyleSheets::didChangeCandidatesForActiveSet): Deleted.
+ (WebCore::AuthorStyleSheets::didChangeContentsOrInterpretation): Deleted.
+ (WebCore::AuthorStyleSheets::pendingUpdateTimerFired): Deleted.
+ * style/StyleScope.h: Copied from dom/AuthorStyleSheets.h.
+ * style/StyleTreeResolver.cpp:
+ * svg/SVGFontFaceElement.cpp:
+ (WebCore::SVGFontFaceElement::rebuildFontFace):
+ (WebCore::SVGFontFaceElement::removedFrom):
+ * xml/XMLTreeViewer.cpp:
+ (WebCore::XMLTreeViewer::transformDocumentToTreeView):
+ * xml/parser/XMLDocumentParser.cpp:
+ (WebCore::XMLDocumentParser::end):
+ * xml/parser/XMLDocumentParserLibxml2.cpp:
+ (WebCore::XMLDocumentParser::doEnd):
+
</ins><span class="cx"> 2016-10-07 Zalan Bujtas <zalan@apple.com>
</span><span class="cx">
</span><span class="cx"> https://vuldb.com/?cvssv3.2012 takes long time to load.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -6212,8 +6212,8 @@
</span><span class="cx">                 E461802B1C8A06D90026C02C /* RenderTreeUpdater.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461802A1C8A06D90026C02C /* RenderTreeUpdater.cpp */; };
</span><span class="cx">                 E461802D1C8DD2900026C02C /* StyleRelations.h in Headers */ = {isa = PBXBuildFile; fileRef = E461802C1C8DD2900026C02C /* StyleRelations.h */; };
</span><span class="cx">                 E461802F1C8DD4D20026C02C /* StyleRelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461802E1C8DD4D20026C02C /* StyleRelations.cpp */; };
</span><del>-                E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */; };
-                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                E461D65D1BB0C7F000CB5645 /* StyleScope.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */; };
+                E461D65F1BB0C80D00CB5645 /* StyleScope.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* StyleScope.h */; settings = {ATTRIBUTES = (Private, ); }; };
</ins><span class="cx">                 E462A4A1113E71BE004A4220 /* IntPointHash.h in Headers */ = {isa = PBXBuildFile; fileRef = E462A4A0113E71BE004A4220 /* IntPointHash.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E46A2B1C17CA65B9000DBCD8 /* TypedElementDescendantIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E46A2B1E17CA76B1000DBCD8 /* ElementChildIterator.h in Headers */ = {isa = PBXBuildFile; fileRef = E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -13828,8 +13828,8 @@
</span><span class="cx">                 E461802A1C8A06D90026C02C /* RenderTreeUpdater.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = RenderTreeUpdater.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 E461802C1C8DD2900026C02C /* StyleRelations.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleRelations.h; sourceTree = "<group>"; };
</span><span class="cx">                 E461802E1C8DD4D20026C02C /* StyleRelations.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleRelations.cpp; sourceTree = "<group>"; };
</span><del>-                E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthorStyleSheets.cpp; sourceTree = "<group>"; };
-                E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthorStyleSheets.h; sourceTree = "<group>"; };
</del><ins>+                E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = StyleScope.cpp; sourceTree = "<group>"; };
+                E461D65E1BB0C80D00CB5645 /* StyleScope.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleScope.h; sourceTree = "<group>"; };
</ins><span class="cx">                 E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = "<group>"; };
</span><span class="cx">                 E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedElementDescendantIterator.h; sourceTree = "<group>"; };
</span><span class="cx">                 E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementChildIterator.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -22326,6 +22326,8 @@
</span><span class="cx">                                 E461802C1C8DD2900026C02C /* StyleRelations.h */,
</span><span class="cx">                                 E4D58EB217B4DBDC00CBDCA8 /* StyleResolveForDocument.cpp */,
</span><span class="cx">                                 E4D58EB317B4DBDC00CBDCA8 /* StyleResolveForDocument.h */,
</span><ins>+                                E461D65C1BB0C7F000CB5645 /* StyleScope.cpp */,
+                                E461D65E1BB0C80D00CB5645 /* StyleScope.h */,
</ins><span class="cx">                                 E47A3AC21C5EABBE00CCBFA7 /* StyleSharingResolver.cpp */,
</span><span class="cx">                                 E47A3AC41C5EAC7900CCBFA7 /* StyleSharingResolver.h */,
</span><span class="cx">                                 E4DEAA1517A93DC3000E0430 /* StyleTreeResolver.cpp */,
</span><span class="lines">@@ -22962,8 +22964,6 @@
</span><span class="cx">                                 A8C4A7FB09D563270003AC8D /* Attr.h */,
</span><span class="cx">                                 93EEC1E509C2877700C515D1 /* Attr.idl */,
</span><span class="cx">                                 A8C4A7F909D563270003AC8D /* Attribute.h */,
</span><del>-                                E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */,
-                                E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */,
</del><span class="cx">                                 760847CD19A6A27700428CCC /* AutocompleteErrorEvent.h */,
</span><span class="cx">                                 760847CF19A6A28600428CCC /* AutocompleteErrorEvent.idl */,
</span><span class="cx">                                 BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */,
</span><span class="lines">@@ -23925,7 +23925,7 @@
</span><span class="cx">                                 0704A4081D6DE9F10086DCDB /* OverconstrainedError.h in Headers */,
</span><span class="cx">                                 E124748410AA161D00B79493 /* AuthenticationClient.h in Headers */,
</span><span class="cx">                                 514C764C0CE9234E007EF3CD /* AuthenticationMac.h in Headers */,
</span><del>-                                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */,
</del><ins>+                                E461D65F1BB0C80D00CB5645 /* StyleScope.h in Headers */,
</ins><span class="cx">                                 A501920E132EBF2E008BFE55 /* Autocapitalize.h in Headers */,
</span><span class="cx">                                 760847CE19A6A27800428CCC /* AutocompleteErrorEvent.h in Headers */,
</span><span class="cx">                                 7C1843FE1C8B7283002EB973 /* Autofill.h in Headers */,
</span><span class="lines">@@ -27690,7 +27690,7 @@
</span><span class="cx">                                 7EE6845F12D26E3800E79415 /* AuthenticationCF.cpp in Sources */,
</span><span class="cx">                                 934F71380D5A6EFF00018D69 /* AuthenticationChallengeBase.cpp in Sources */,
</span><span class="cx">                                 514C764D0CE9234E007EF3CD /* AuthenticationMac.mm in Sources */,
</span><del>-                                E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */,
</del><ins>+                                E461D65D1BB0C7F000CB5645 /* StyleScope.cpp in Sources */,
</ins><span class="cx">                                 A5F6E16B132ED46E008EDAE3 /* Autocapitalize.cpp in Sources */,
</span><span class="cx">                                 5597F8261D91C3130066BC21 /* ImageFrameCache.cpp in Sources */,
</span><span class="cx">                                 7C1843FD1C8B7283002EB973 /* Autofill.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -21,7 +21,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSCharsetRule.h"
</span><span class="cx"> #include "CSSFontFaceRule.h"
</span><span class="cx"> #include "CSSImportRule.h"
</span><span class="lines">@@ -44,7 +43,9 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleRule.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><ins>+
</ins><span class="cx"> #include <wtf/text/StringBuilder.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -170,7 +171,7 @@
</span><span class="cx"> ASSERT(m_contents->isMutable());
</span><span class="cx"> ASSERT(m_contents->hasOneClient());
</span><span class="cx">
</span><del>- auto* scope = styleSheetScope();
</del><ins>+ auto* scope = styleScope();
</ins><span class="cx"> if (!scope)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -191,7 +192,7 @@
</span><span class="cx">
</span><span class="cx"> void CSSStyleSheet::didMutate()
</span><span class="cx"> {
</span><del>- auto* scope = styleSheetScope();
</del><ins>+ auto* scope = styleScope();
</ins><span class="cx"> if (!scope)
</span><span class="cx"> return;
</span><span class="cx"> scope->didChangeContentsOrInterpretation();
</span><span class="lines">@@ -415,12 +416,12 @@
</span><span class="cx"> return root.ownerNode() ? &root.ownerNode()->document() : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AuthorStyleSheets* CSSStyleSheet::styleSheetScope()
</del><ins>+Style::Scope* CSSStyleSheet::styleScope()
</ins><span class="cx"> {
</span><span class="cx"> auto* ownerNode = rootStyleSheet().ownerNode();
</span><span class="cx"> if (!ownerNode)
</span><span class="cx"> return nullptr;
</span><del>- return &AuthorStyleSheets::forNode(*ownerNode);
</del><ins>+ return &Style::Scope::forNode(*ownerNode);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CSSStyleSheet::clearChildRuleCSSOMWrappers()
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheeth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/css/CSSStyleSheet.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class AuthorStyleSheets;
</del><span class="cx"> class CSSCharsetRule;
</span><span class="cx"> class CSSImportRule;
</span><span class="cx"> class CSSParser;
</span><span class="lines">@@ -45,6 +44,10 @@
</span><span class="cx"> class StyleRuleKeyframes;
</span><span class="cx"> class StyleSheetContents;
</span><span class="cx">
</span><ins>+namespace Style {
+class Scope;
+}
+
</ins><span class="cx"> typedef int ExceptionCode;
</span><span class="cx">
</span><span class="cx"> class CSSStyleSheet final : public StyleSheet {
</span><span class="lines">@@ -87,7 +90,7 @@
</span><span class="cx"> Document* ownerDocument() const;
</span><span class="cx"> CSSStyleSheet& rootStyleSheet();
</span><span class="cx"> const CSSStyleSheet& rootStyleSheet() const;
</span><del>- AuthorStyleSheets* styleSheetScope();
</del><ins>+ Style::Scope* styleScope();
</ins><span class="cx">
</span><span class="cx"> MediaQuerySet* mediaQueries() const { return m_mediaQueries.get(); }
</span><span class="cx"> void setMediaQueries(Ref<MediaQuerySet>&&);
</span></span></pre></div>
<a id="trunkSourceWebCorecssInspectorCSSOMWrapperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InspectorCSSOMWrappers.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSDefaultStyleSheets.h"
</span><span class="cx"> #include "CSSImportRule.h"
</span><span class="cx"> #include "CSSMediaRule.h"
</span><span class="lines">@@ -38,6 +37,7 @@
</span><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "CSSSupportsRule.h"
</span><span class="cx"> #include "ExtensionStyleSheets.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "WebKitCSSRegionRule.h"
</span><span class="cx">
</span><span class="lines">@@ -96,7 +96,7 @@
</span><span class="cx"> collect(sheets[i].get());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, AuthorStyleSheets& authorStyleSheets, ExtensionStyleSheets& extensionStyleSheets)
</del><ins>+CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, Style::Scope& styleScope, ExtensionStyleSheets& extensionStyleSheets)
</ins><span class="cx"> {
</span><span class="cx"> if (m_styleRuleToCSSOMWrapperMap.isEmpty()) {
</span><span class="cx"> collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::simpleDefaultStyleSheet);
</span><span class="lines">@@ -108,7 +108,7 @@
</span><span class="cx"> collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::fullscreenStyleSheet);
</span><span class="cx"> collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::plugInsStyleSheet);
</span><span class="cx">
</span><del>- collectFromStyleSheets(authorStyleSheets.activeStyleSheets());
</del><ins>+ collectFromStyleSheets(styleScope.activeStyleSheets());
</ins><span class="cx"> collect(extensionStyleSheets.pageUserSheet());
</span><span class="cx"> collectFromStyleSheets(extensionStyleSheets.injectedUserStyleSheets());
</span><span class="cx"> collectFromStyleSheets(extensionStyleSheets.documentUserStyleSheets());
</span></span></pre></div>
<a id="trunkSourceWebCorecssInspectorCSSOMWrappersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/InspectorCSSOMWrappers.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/InspectorCSSOMWrappers.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/css/InspectorCSSOMWrappers.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class AuthorStyleSheets;
</del><span class="cx"> class CSSStyleRule;
</span><span class="cx"> class CSSStyleSheet;
</span><span class="cx"> class ExtensionStyleSheets;
</span><span class="lines">@@ -38,11 +37,15 @@
</span><span class="cx"> class StyleRule;
</span><span class="cx"> class StyleSheetContents;
</span><span class="cx">
</span><ins>+namespace Style {
+class Scope;
+}
+
</ins><span class="cx"> class InspectorCSSOMWrappers {
</span><span class="cx"> public:
</span><span class="cx"> // WARNING. This will construct CSSOM wrappers for all style rules and cache them in a map for significant memory cost.
</span><span class="cx"> // It is here to support inspector. Don't use for any regular engine functions.
</span><del>- CSSStyleRule* getWrapperForRuleInSheets(StyleRule*, AuthorStyleSheets&, ExtensionStyleSheets&);
</del><ins>+ CSSStyleRule* getWrapperForRuleInSheets(StyleRule*, Style::Scope&, ExtensionStyleSheets&);
</ins><span class="cx"> void collectFromStyleSheetIfNeeded(CSSStyleSheet*);
</span><span class="cx">
</span><span class="cx"> private:
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetList.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetList.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/css/StyleSheetList.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -21,11 +21,11 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "HTMLNames.h"
</span><span class="cx"> #include "HTMLStyleElement.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include <wtf/text/WTFString.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -45,12 +45,12 @@
</span><span class="cx"> {
</span><span class="cx"> if (!m_document)
</span><span class="cx"> return m_detachedStyleSheets;
</span><del>- return m_document->authorStyleSheets().styleSheetsForStyleSheetList();
</del><ins>+ return m_document->styleScope().styleSheetsForStyleSheetList();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void StyleSheetList::detachFromDocument()
</span><span class="cx"> {
</span><del>- m_detachedStyleSheets = m_document->authorStyleSheets().styleSheetsForStyleSheetList();
</del><ins>+ m_detachedStyleSheets = m_document->styleScope().styleSheetsForStyleSheetList();
</ins><span class="cx"> m_document = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetscpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/AuthorStyleSheets.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -1,487 +0,0 @@
</span><del>-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * (C) 1999 Antti Koivisto (koivisto@kde.org)
- * (C) 2001 Dirk Mueller (mueller@kde.org)
- * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
- * Copyright (C) 2004-2009, 2011-2012, 2015 Apple Inc. All rights reserved.
- * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "AuthorStyleSheets.h"
-
-#include "CSSStyleSheet.h"
-#include "Element.h"
-#include "ElementChildIterator.h"
-#include "ExtensionStyleSheets.h"
-#include "HTMLIFrameElement.h"
-#include "HTMLLinkElement.h"
-#include "HTMLStyleElement.h"
-#include "InspectorInstrumentation.h"
-#include "Page.h"
-#include "PageGroup.h"
-#include "ProcessingInstruction.h"
-#include "SVGNames.h"
-#include "SVGStyleElement.h"
-#include "Settings.h"
-#include "ShadowRoot.h"
-#include "StyleInvalidationAnalysis.h"
-#include "StyleResolver.h"
-#include "StyleSheetContents.h"
-#include "StyleSheetList.h"
-#include "UserContentController.h"
-#include "UserContentURLPattern.h"
-#include "UserStyleSheet.h"
-
-namespace WebCore {
-
-using namespace ContentExtensions;
-using namespace HTMLNames;
-
-AuthorStyleSheets::AuthorStyleSheets(Document& document)
- : m_document(document)
- , m_pendingUpdateTimer(*this, &AuthorStyleSheets::pendingUpdateTimerFired)
-{
-}
-
-AuthorStyleSheets::AuthorStyleSheets(ShadowRoot& shadowRoot)
- : m_document(shadowRoot.documentScope())
- , m_shadowRoot(&shadowRoot)
- , m_pendingUpdateTimer(*this, &AuthorStyleSheets::pendingUpdateTimerFired)
-{
-}
-
-StyleResolver& AuthorStyleSheets::styleResolver()
-{
- if (m_shadowRoot)
- return m_shadowRoot->styleResolver();
-
- return m_document.ensureStyleResolver();
-}
-
-StyleResolver* AuthorStyleSheets::styleResolverIfExists()
-{
- if (m_shadowRoot)
- return m_shadowRoot->styleResolverIfExists();
-
- return m_document.styleResolverIfExists();
-}
-
-AuthorStyleSheets& AuthorStyleSheets::forNode(Node& node)
-{
- ASSERT(node.inDocument());
- auto* shadowRoot = node.containingShadowRoot();
- if (shadowRoot)
- return shadowRoot->authorStyleSheets();
- return node.document().authorStyleSheets();
-}
-
-// This method is called whenever a top-level stylesheet has finished loading.
-void AuthorStyleSheets::removePendingSheet(RemovePendingSheetNotificationType notification)
-{
- // Make sure we knew this sheet was pending, and that our count isn't out of sync.
- ASSERT(m_pendingStyleSheetCount > 0);
-
- m_pendingStyleSheetCount--;
-
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
- if (!ownerElement())
- printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", elapsedTime(), m_pendingStylesheets);
-#endif
-
- if (m_pendingStyleSheetCount)
- return;
-
- if (notification == RemovePendingSheetNotifyLater) {
- m_document.setNeedsNotifyRemoveAllPendingStylesheet();
- return;
- }
-
- if (m_shadowRoot) {
- m_shadowRoot->updateStyle();
- return;
- }
-
- m_document.didRemoveAllPendingStylesheet();
-}
-
-void AuthorStyleSheets::addStyleSheetCandidateNode(Node& node, bool createdByParser)
-{
- if (!node.inDocument())
- return;
-
- // Until the <body> exists, we have no choice but to compare document positions,
- // since styles outside of the body and head continue to be shunted into the head
- // (and thus can shift to end up before dynamically added DOM content that is also
- // outside the body).
- if ((createdByParser && m_document.bodyOrFrameset()) || m_styleSheetCandidateNodes.isEmpty()) {
- m_styleSheetCandidateNodes.add(&node);
- return;
- }
-
- // Determine an appropriate insertion point.
- auto begin = m_styleSheetCandidateNodes.begin();
- auto end = m_styleSheetCandidateNodes.end();
- auto it = end;
- Node* followingNode = nullptr;
- do {
- --it;
- Node* n = *it;
- unsigned short position = n->compareDocumentPosition(node);
- if (position == Node::DOCUMENT_POSITION_FOLLOWING) {
- m_styleSheetCandidateNodes.insertBefore(followingNode, &node);
- return;
- }
- followingNode = n;
- } while (it != begin);
-
- m_styleSheetCandidateNodes.insertBefore(followingNode, &node);
-}
-
-void AuthorStyleSheets::removeStyleSheetCandidateNode(Node& node)
-{
- if (m_styleSheetCandidateNodes.remove(&node))
- scheduleActiveSetUpdate();
-}
-
-void AuthorStyleSheets::collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>& sheets)
-{
- if (m_document.settings() && !m_document.settings()->authorAndUserStylesEnabled())
- return;
-
- for (auto& node : m_styleSheetCandidateNodes) {
- StyleSheet* sheet = nullptr;
- if (is<ProcessingInstruction>(*node)) {
- // Processing instruction (XML documents only).
- // We don't support linking to embedded CSS stylesheets, see <https://bugs.webkit.org/show_bug.cgi?id=49281> for discussion.
- ProcessingInstruction& pi = downcast<ProcessingInstruction>(*node);
- sheet = pi.sheet();
-#if ENABLE(XSLT)
- // Don't apply XSL transforms to already transformed documents -- <rdar://problem/4132806>
- if (pi.isXSL() && !m_document.transformSourceDocument()) {
- // Don't apply XSL transforms until loading is finished.
- if (!m_document.parsing())
- m_document.applyXSLTransform(&pi);
- return;
- }
-#endif
- } else if (is<HTMLLinkElement>(*node) || is<HTMLStyleElement>(*node) || is<SVGStyleElement>(*node)) {
- Element& element = downcast<Element>(*node);
- AtomicString title = element.attributeWithoutSynchronization(titleAttr);
- bool enabledViaScript = false;
- if (is<HTMLLinkElement>(element)) {
- // <LINK> element
- HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(element);
- if (linkElement.isDisabled())
- continue;
- enabledViaScript = linkElement.isEnabledViaScript();
- if (linkElement.styleSheetIsLoading()) {
- // it is loading but we should still decide which style sheet set to use
- if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSetName.isEmpty()) {
- if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate")) {
- m_preferredStylesheetSetName = title;
- m_selectedStylesheetSetName = title;
- }
- }
- continue;
- }
- if (!linkElement.sheet())
- title = nullAtom;
- }
- // Get the current preferred styleset. This is the
- // set of sheets that will be enabled.
- if (is<SVGStyleElement>(element))
- sheet = downcast<SVGStyleElement>(element).sheet();
- else if (is<HTMLLinkElement>(element))
- sheet = downcast<HTMLLinkElement>(element).sheet();
- else
- sheet = downcast<HTMLStyleElement>(element).sheet();
- // Check to see if this sheet belongs to a styleset
- // (thus making it PREFERRED or ALTERNATE rather than
- // PERSISTENT).
- auto& rel = element.attributeWithoutSynchronization(relAttr);
- if (!enabledViaScript && !title.isEmpty()) {
- // Yes, we have a title.
- if (m_preferredStylesheetSetName.isEmpty()) {
- // No preferred set has been established. If
- // we are NOT an alternate sheet, then establish
- // us as the preferred set. Otherwise, just ignore
- // this sheet.
- if (is<HTMLStyleElement>(element) || !rel.contains("alternate"))
- m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
- }
- if (title != m_preferredStylesheetSetName)
- sheet = nullptr;
- }
-
- if (rel.contains("alternate") && title.isEmpty())
- sheet = nullptr;
- }
- if (sheet)
- sheets.append(sheet);
- }
-}
-
-AuthorStyleSheets::StyleResolverUpdateType AuthorStyleSheets::analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc)
-{
- requiresFullStyleRecalc = true;
-
- unsigned newStylesheetCount = newStylesheets.size();
-
- if (!styleResolverIfExists())
- return Reconstruct;
-
- StyleResolver& styleResolver = *styleResolverIfExists();
-
- // Find out which stylesheets are new.
- unsigned oldStylesheetCount = m_activeStyleSheets.size();
- if (newStylesheetCount < oldStylesheetCount)
- return Reconstruct;
-
- Vector<StyleSheetContents*> addedSheets;
- unsigned newIndex = 0;
- for (unsigned oldIndex = 0; oldIndex < oldStylesheetCount; ++oldIndex) {
- if (newIndex >= newStylesheetCount)
- return Reconstruct;
- while (m_activeStyleSheets[oldIndex] != newStylesheets[newIndex]) {
- addedSheets.append(&newStylesheets[newIndex]->contents());
- ++newIndex;
- if (newIndex == newStylesheetCount)
- return Reconstruct;
- }
- ++newIndex;
- }
- bool hasInsertions = !addedSheets.isEmpty();
- while (newIndex < newStylesheetCount) {
- addedSheets.append(&newStylesheets[newIndex]->contents());
- ++newIndex;
- }
- // If all new sheets were added at the end of the list we can just add them to existing StyleResolver.
- // If there were insertions we need to re-add all the stylesheets so rules are ordered correctly.
- auto styleResolverUpdateType = hasInsertions ? Reset : Additive;
-
- // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
- if (!m_document.bodyOrFrameset() || m_document.hasNodesWithPlaceholderStyle())
- return styleResolverUpdateType;
-
- StyleInvalidationAnalysis invalidationAnalysis(addedSheets, styleResolver.mediaQueryEvaluator());
- if (invalidationAnalysis.dirtiesAllStyle())
- return styleResolverUpdateType;
- invalidationAnalysis.invalidateStyle(m_document);
- requiresFullStyleRecalc = false;
-
- return styleResolverUpdateType;
-}
-
-static void filterEnabledNonemptyCSSStyleSheets(Vector<RefPtr<CSSStyleSheet>>& result, const Vector<RefPtr<StyleSheet>>& sheets)
-{
- for (auto& sheet : sheets) {
- if (!is<CSSStyleSheet>(*sheet))
- continue;
- CSSStyleSheet& styleSheet = downcast<CSSStyleSheet>(*sheet);
- if (styleSheet.isLoading())
- continue;
- if (styleSheet.disabled())
- continue;
- if (!styleSheet.length())
- continue;
- result.append(&styleSheet);
- }
-}
-
-void AuthorStyleSheets::updateActiveStyleSheets(UpdateType updateType)
-{
- ASSERT(!m_pendingUpdateType);
-
- if (m_document.inStyleRecalc() || m_document.inRenderTreeUpdate()) {
- // Protect against deleting style resolver in the middle of a style resolution.
- // Crash stacks indicate we can get here when a resource load fails synchronously (for example due to content blocking).
- // FIXME: These kind of cases should be eliminated and this path replaced by an assert.
- m_pendingUpdateType = UpdateType::ContentsOrInterpretation;
- m_document.scheduleForcedStyleRecalc();
- return;
- }
-
- if (!m_document.hasLivingRenderTree()) {
- m_document.clearStyleResolver();
- return;
- }
-
- // Don't bother updating, since we haven't loaded all our style info yet
- // and haven't calculated the style resolver for the first time.
- if (!m_shadowRoot && !m_didUpdateActiveStyleSheets && m_pendingStyleSheetCount) {
- m_document.clearStyleResolver();
- return;
- }
-
- // FIXME: Support optimized invalidation in shadow trees.
- if (m_shadowRoot)
- updateType = UpdateType::ContentsOrInterpretation;
-
- m_didUpdateActiveStyleSheets = true;
-
- Vector<RefPtr<StyleSheet>> activeStyleSheets;
- collectActiveStyleSheets(activeStyleSheets);
-
- Vector<RefPtr<CSSStyleSheet>> activeCSSStyleSheets;
- activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
- activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
- filterEnabledNonemptyCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
-
- bool requiresFullStyleRecalc = true;
- StyleResolverUpdateType styleResolverUpdateType = Reconstruct;
- if (updateType == UpdateType::ActiveSet)
- styleResolverUpdateType = analyzeStyleSheetChange(activeCSSStyleSheets, requiresFullStyleRecalc);
-
- updateStyleResolver(activeCSSStyleSheets, styleResolverUpdateType);
-
- m_weakCopyOfActiveStyleSheetListForFastLookup = nullptr;
- m_activeStyleSheets.swap(activeCSSStyleSheets);
- m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
-
- InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
-
- for (const auto& sheet : m_activeStyleSheets) {
- if (sheet->contents().usesStyleBasedEditability())
- m_usesStyleBasedEditability = true;
- }
-
- if (requiresFullStyleRecalc) {
- if (m_shadowRoot) {
- for (auto& shadowChild : childrenOfType<Element>(*m_shadowRoot))
- shadowChild.setNeedsStyleRecalc();
- } else
- m_document.scheduleForcedStyleRecalc();
- }
-}
-
-void AuthorStyleSheets::updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets, StyleResolverUpdateType updateType)
-{
- if (updateType == Reconstruct) {
- if (m_shadowRoot)
- m_shadowRoot->resetStyleResolver();
- else
- m_document.clearStyleResolver();
- return;
- }
- auto& styleResolver = this->styleResolver();
-
- if (updateType == Reset) {
- styleResolver.ruleSets().resetAuthorStyle();
- styleResolver.appendAuthorStyleSheets(activeStyleSheets);
- } else {
- ASSERT(updateType == Additive);
- unsigned firstNewIndex = m_activeStyleSheets.size();
- Vector<RefPtr<CSSStyleSheet>> newStyleSheets;
- newStyleSheets.appendRange(activeStyleSheets.begin() + firstNewIndex, activeStyleSheets.end());
- styleResolver.appendAuthorStyleSheets(newStyleSheets);
- }
-
- if (!m_shadowRoot) {
- auto& userAgentShadowTreeStyleResolver = m_document.userAgentShadowTreeStyleResolver();
- userAgentShadowTreeStyleResolver.ruleSets().resetAuthorStyle();
- auto& authorRuleSet = styleResolver.ruleSets().authorStyle();
- if (authorRuleSet.hasShadowPseudoElementRules())
- userAgentShadowTreeStyleResolver.ruleSets().authorStyle().copyShadowPseudoElementRulesFrom(authorRuleSet);
- }
-}
-
-const Vector<RefPtr<CSSStyleSheet>> AuthorStyleSheets::activeStyleSheetsForInspector() const
-{
- Vector<RefPtr<CSSStyleSheet>> result;
-
- result.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
- result.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
-
- for (auto& styleSheet : m_styleSheetsForStyleSheetList) {
- if (!is<CSSStyleSheet>(*styleSheet))
- continue;
-
- CSSStyleSheet& sheet = downcast<CSSStyleSheet>(*styleSheet);
- if (sheet.disabled())
- continue;
-
- result.append(&sheet);
- }
-
- return result;
-}
-
-bool AuthorStyleSheets::activeStyleSheetsContains(const CSSStyleSheet* sheet) const
-{
- if (!m_weakCopyOfActiveStyleSheetListForFastLookup) {
- m_weakCopyOfActiveStyleSheetListForFastLookup = std::make_unique<HashSet<const CSSStyleSheet*>>();
- for (auto& activeStyleSheet : m_activeStyleSheets)
- m_weakCopyOfActiveStyleSheetListForFastLookup->add(activeStyleSheet.get());
- }
- return m_weakCopyOfActiveStyleSheetListForFastLookup->contains(sheet);
-}
-
-void AuthorStyleSheets::flushPendingUpdate()
-{
- if (!m_pendingUpdateType)
- return;
- auto updateType = *m_pendingUpdateType;
-
- clearPendingUpdate();
-
- updateActiveStyleSheets(updateType);
-}
-
-void AuthorStyleSheets::clearPendingUpdate()
-{
- m_pendingUpdateTimer.stop();
- m_pendingUpdateType = { };
-}
-
-void AuthorStyleSheets::scheduleActiveSetUpdate()
-{
- if (m_shadowRoot) {
- // FIXME: We need to flush updates recursively to support asynchronous updates in shadow trees.
- didChangeCandidatesForActiveSet();
- return;
- }
- if (m_pendingUpdateTimer.isActive())
- return;
- if (!m_pendingUpdateType)
- m_pendingUpdateType = UpdateType::ActiveSet;
- m_pendingUpdateTimer.startOneShot(0);
-}
-
-void AuthorStyleSheets::didChangeCandidatesForActiveSet()
-{
- auto updateType = m_pendingUpdateType.valueOr(UpdateType::ActiveSet);
- clearPendingUpdate();
- updateActiveStyleSheets(updateType);
-}
-
-void AuthorStyleSheets::didChangeContentsOrInterpretation()
-{
- clearPendingUpdate();
- updateActiveStyleSheets(UpdateType::ContentsOrInterpretation);
-}
-
-void AuthorStyleSheets::pendingUpdateTimerFired()
-{
- flushPendingUpdate();
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetsh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/AuthorStyleSheets.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -1,144 +0,0 @@
</span><del>-/*
- * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
- * (C) 1999 Antti Koivisto (koivisto@kde.org)
- * (C) 2001 Dirk Mueller (mueller@kde.org)
- * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
- * Copyright (C) 2004-2010, 2012-2013, 2015 Apple Inc. All rights reserved.
- * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
- * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
- * Copyright (C) 2011 Google Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB. If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- *
- */
-
-#ifndef AuthorStyleSheets_h
-#define AuthorStyleSheets_h
-
-#include "Timer.h"
-#include <memory>
-#include <wtf/FastMalloc.h>
-#include <wtf/HashMap.h>
-#include <wtf/ListHashSet.h>
-#include <wtf/RefPtr.h>
-#include <wtf/Vector.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CSSStyleSheet;
-class Document;
-class Node;
-class StyleResolver;
-class StyleSheet;
-class StyleSheetContents;
-class StyleSheetList;
-class ShadowRoot;
-class TreeScope;
-
-class AuthorStyleSheets {
- WTF_MAKE_FAST_ALLOCATED;
-public:
- explicit AuthorStyleSheets(Document&);
- explicit AuthorStyleSheets(ShadowRoot&);
-
- const Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets() const { return m_activeStyleSheets; }
-
- const Vector<RefPtr<StyleSheet>>& styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
- const Vector<RefPtr<CSSStyleSheet>> activeStyleSheetsForInspector() const;
-
- void addStyleSheetCandidateNode(Node&, bool createdByParser);
- void removeStyleSheetCandidateNode(Node&);
-
- String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
- String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
- void setPreferredStylesheetSetName(const String& name) { m_preferredStylesheetSetName = name; }
- void setSelectedStylesheetSetName(const String& name) { m_selectedStylesheetSetName = name; }
-
- void addPendingSheet() { m_pendingStyleSheetCount++; }
- enum RemovePendingSheetNotificationType {
- RemovePendingSheetNotifyImmediately,
- RemovePendingSheetNotifyLater
- };
- void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
-
- bool hasPendingSheets() const { return m_pendingStyleSheetCount > 0; }
-
- bool usesStyleBasedEditability() { return m_usesStyleBasedEditability; }
-
- bool activeStyleSheetsContains(const CSSStyleSheet*) const;
-
- void didChangeCandidatesForActiveSet();
- void scheduleActiveSetUpdate();
- WEBCORE_EXPORT void didChangeContentsOrInterpretation();
-
- bool hasPendingUpdate() const { return !!m_pendingUpdateType; }
- void flushPendingUpdate();
-
- StyleResolver& styleResolver();
- StyleResolver* styleResolverIfExists();
-
- static AuthorStyleSheets& forNode(Node&);
-
-private:
- enum class UpdateType { ActiveSet, ContentsOrInterpretation };
- void updateActiveStyleSheets(UpdateType);
-
- void collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>&);
-
- enum StyleResolverUpdateType {
- Reconstruct,
- Reset,
- Additive
- };
- StyleResolverUpdateType analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc);
- void updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>&, StyleResolverUpdateType);
-
- void pendingUpdateTimerFired();
- void clearPendingUpdate();
-
- Document& m_document;
- ShadowRoot* m_shadowRoot { nullptr };
-
- Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList;
- Vector<RefPtr<CSSStyleSheet>> m_activeStyleSheets;
-
- Timer m_pendingUpdateTimer;
-
- // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().
- mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
-
- // Track the number of currently loading top-level stylesheets needed for rendering.
- // Sheets loaded using the @import directive are not included in this count.
- // We use this count of pending sheets to detect when we can begin attaching
- // elements and when it is safe to execute scripts.
- int m_pendingStyleSheetCount { 0 };
- bool m_didUpdateActiveStyleSheets { false };
-
- Optional<UpdateType> m_pendingUpdateType;
-
- ListHashSet<Node*> m_styleSheetCandidateNodes;
-
- String m_preferredStylesheetSetName;
- String m_selectedStylesheetSetName;
-
- bool m_usesStyleBasedEditability { false };
-};
-
-}
-
-#endif
-
</del></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -31,7 +31,6 @@
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "Attr.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CDATASection.h"
</span><span class="cx"> #include "CSSFontSelector.h"
</span><span class="cx"> #include "CSSStyleDeclaration.h"
</span><span class="lines">@@ -168,6 +167,7 @@
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="cx"> #include "StyleResolveForDocument.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx"> #include "StyleTreeResolver.h"
</span><span class="lines">@@ -451,7 +451,7 @@
</span><span class="cx"> , m_domTreeVersion(++s_globalTreeVersion)
</span><span class="cx"> , m_listenerTypes(0)
</span><span class="cx"> , m_mutationObserverTypes(0)
</span><del>- , m_authorStyleSheets(std::make_unique<AuthorStyleSheets>(*this))
</del><ins>+ , m_styleScope(std::make_unique<Style::Scope>(*this))
</ins><span class="cx"> , m_extensionStyleSheets(std::make_unique<ExtensionStyleSheets>(*this))
</span><span class="cx"> , m_visitedLinkState(std::make_unique<VisitedLinkState>(*this))
</span><span class="cx"> , m_visuallyOrdered(false)
</span><span class="lines">@@ -1354,7 +1354,7 @@
</span><span class="cx"> m_contentLanguage = language;
</span><span class="cx">
</span><span class="cx"> // Recalculate style so language is used when selecting the initial font.
</span><del>- m_authorStyleSheets->didChangeContentsOrInterpretation();
</del><ins>+ m_styleScope->didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::setXMLVersion(const String& version, ExceptionCode& ec)
</span><span class="lines">@@ -1812,7 +1812,7 @@
</span><span class="cx"> // re-attaching our containing iframe, which when asked HTMLFrameElementBase::isURLAllowed
</span><span class="cx"> // hits a null-dereference due to security code always assuming the document has a SecurityOrigin.
</span><span class="cx">
</span><del>- authorStyleSheets().flushPendingUpdate();
</del><ins>+ styleScope().flushPendingUpdate();
</ins><span class="cx">
</span><span class="cx"> frameView.willRecalcStyle();
</span><span class="cx">
</span><span class="lines">@@ -1895,7 +1895,7 @@
</span><span class="cx"> if (pageCacheState() != NotInPageCache)
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || authorStyleSheets().hasPendingUpdate();
</del><ins>+ return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || styleScope().hasPendingUpdate();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::updateStyleIfNeeded()
</span><span class="lines">@@ -1906,7 +1906,7 @@
</span><span class="cx"> if (!view() || view()->isInRenderTreeLayout())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- authorStyleSheets().flushPendingUpdate();
</del><ins>+ styleScope().flushPendingUpdate();
</ins><span class="cx">
</span><span class="cx"> if (!needsStyleRecalc())
</span><span class="cx"> return;
</span><span class="lines">@@ -1960,7 +1960,7 @@
</span><span class="cx"> HTMLElement* bodyElement = bodyOrFrameset();
</span><span class="cx"> if (bodyElement && !bodyElement->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) {
</span><span class="cx"> m_pendingSheetLayout = DidLayoutWithPendingSheets;
</span><del>- authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> recalcStyle(Style::Force);
</span><span class="cx"> } else if (m_hasNodesWithPlaceholderStyle)
</span><span class="cx"> // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes
</span><span class="lines">@@ -2142,7 +2142,7 @@
</span><span class="cx"> void Document::createStyleResolver()
</span><span class="cx"> {
</span><span class="cx"> m_styleResolver = std::make_unique<StyleResolver>(*this);
</span><del>- m_styleResolver->appendAuthorStyleSheets(authorStyleSheets().activeStyleSheets());
</del><ins>+ m_styleResolver->appendAuthorStyleSheets(styleScope().activeStyleSheets());
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> StyleResolver& Document::userAgentShadowTreeStyleResolver()
</span><span class="lines">@@ -3085,7 +3085,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_needsNotifyRemoveAllPendingStylesheet = false;
</span><span class="cx">
</span><del>- authorStyleSheets().didChangeCandidatesForActiveSet();
</del><ins>+ styleScope().didChangeCandidatesForActiveSet();
</ins><span class="cx">
</span><span class="cx"> if (m_pendingSheetLayout == DidLayoutWithPendingSheets) {
</span><span class="cx"> m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
</span><span class="lines">@@ -3108,9 +3108,9 @@
</span><span class="cx"> ASSERT(!m_renderView || !m_renderView->frameView().isPainting());
</span><span class="cx"> ASSERT(!m_inStyleRecalc);
</span><span class="cx">
</span><del>- auto& authorSheets = const_cast<AuthorStyleSheets&>(authorStyleSheets());
- authorSheets.flushPendingUpdate();
- return authorSheets.usesStyleBasedEditability();
</del><ins>+ auto& styleScope = const_cast<Style::Scope&>(this->styleScope());
+ styleScope.flushPendingUpdate();
+ return styleScope.usesStyleBasedEditability();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::setHasElementUsingStyleBasedEditability()
</span><span class="lines">@@ -3156,9 +3156,9 @@
</span><span class="cx"> // For more info, see the test at:
</span><span class="cx"> // http://www.hixie.ch/tests/evil/css/import/main/preferred.html
</span><span class="cx"> // -dwh
</span><del>- authorStyleSheets().setSelectedStylesheetSetName(content);
- authorStyleSheets().setPreferredStylesheetSetName(content);
- authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ styleScope().setSelectedStylesheetSetName(content);
+ styleScope().setPreferredStylesheetSetName(content);
+ styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case HTTPHeaderName::Refresh: {
</span><span class="lines">@@ -3452,18 +3452,18 @@
</span><span class="cx">
</span><span class="cx"> String Document::preferredStylesheetSet() const
</span><span class="cx"> {
</span><del>- return authorStyleSheets().preferredStylesheetSetName();
</del><ins>+ return styleScope().preferredStylesheetSetName();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String Document::selectedStylesheetSet() const
</span><span class="cx"> {
</span><del>- return authorStyleSheets().selectedStylesheetSetName();
</del><ins>+ return styleScope().selectedStylesheetSetName();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::setSelectedStylesheetSet(const String& aString)
</span><span class="cx"> {
</span><del>- authorStyleSheets().setSelectedStylesheetSetName(aString);
- authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ styleScope().setSelectedStylesheetSetName(aString);
+ styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::evaluateMediaQueryList()
</span><span class="lines">@@ -6665,7 +6665,7 @@
</span><span class="cx">
</span><span class="cx"> bool Document::haveStylesheetsLoaded() const
</span><span class="cx"> {
</span><del>- return !authorStyleSheets().hasPendingSheets() || m_ignorePendingStylesheets;
</del><ins>+ return !styleScope().hasPendingSheets() || m_ignorePendingStylesheets;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Locale& Document::getCachedLocale(const AtomicString& locale)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/Document.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">
</span><span class="cx"> class AXObjectCache;
</span><span class="cx"> class Attr;
</span><del>-class AuthorStyleSheets;
</del><span class="cx"> class CDATASection;
</span><span class="cx"> class CSSFontSelector;
</span><span class="cx"> class CSSStyleDeclaration;
</span><span class="lines">@@ -224,6 +223,10 @@
</span><span class="cx"> class MediaSession;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+namespace Style {
+class Scope;
+};
+
</ins><span class="cx"> const uint64_t HTMLMediaElementInvalidID = 0;
</span><span class="cx">
</span><span class="cx"> enum PageshowEventPersistence {
</span><span class="lines">@@ -504,8 +507,8 @@
</span><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT StyleSheetList& styleSheets();
</span><span class="cx">
</span><del>- AuthorStyleSheets& authorStyleSheets() { return *m_authorStyleSheets; }
- const AuthorStyleSheets& authorStyleSheets() const { return *m_authorStyleSheets; }
</del><ins>+ Style::Scope& styleScope() { return *m_styleScope; }
+ const Style::Scope& styleScope() const { return *m_styleScope; }
</ins><span class="cx"> ExtensionStyleSheets& extensionStyleSheets() { return *m_extensionStyleSheets; }
</span><span class="cx"> const ExtensionStyleSheets& extensionStyleSheets() const { return *m_extensionStyleSheets; }
</span><span class="cx">
</span><span class="lines">@@ -1469,7 +1472,7 @@
</span><span class="cx">
</span><span class="cx"> MutationObserverOptions m_mutationObserverTypes;
</span><span class="cx">
</span><del>- std::unique_ptr<AuthorStyleSheets> m_authorStyleSheets;
</del><ins>+ std::unique_ptr<Style::Scope> m_styleScope;
</ins><span class="cx"> std::unique_ptr<ExtensionStyleSheets> m_extensionStyleSheets;
</span><span class="cx"> RefPtr<StyleSheetList> m_styleSheetList;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomExtensionStyleSheetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ExtensionStyleSheets.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "HTMLIFrameElement.h"
</span><span class="lines">@@ -42,6 +41,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleInvalidationAnalysis.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx"> #include "UserContentController.h"
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (m_pageUserSheet) {
</span><span class="cx"> m_pageUserSheet = nullptr;
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> {
</span><span class="cx"> clearPageUserSheet();
</span><span class="cx"> if (pageUserSheet())
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const Vector<RefPtr<CSSStyleSheet>>& ExtensionStyleSheets::injectedUserStyleSheets() const
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx"> m_injectedStyleSheetCacheValid = false;
</span><span class="cx"> if (m_injectedUserStyleSheets.isEmpty() && m_injectedAuthorStyleSheets.isEmpty())
</span><span class="cx"> return;
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::addUserStyleSheet(Ref<StyleSheetContents>&& userSheet)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(userSheet.get().isUserStyleSheet());
</span><span class="cx"> m_userStyleSheets.append(CSSStyleSheet::create(WTFMove(userSheet), m_document));
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::addAuthorStyleSheetForTesting(Ref<StyleSheetContents>&& authorSheet)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!authorSheet.get().isUserStyleSheet());
</span><span class="cx"> m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTFMove(authorSheet), m_document));
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::styleResolverChangedTimerFired()
</span><span class="cx"> {
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::detachFromDocument()
</span></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -21,7 +21,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InlineStyleSheetOwner.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "ContentSecurityPolicy.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "MediaList.h"
</span><span class="lines">@@ -28,6 +27,7 @@
</span><span class="cx"> #include "MediaQueryEvaluator.h"
</span><span class="cx"> #include "ScriptableDocumentParser.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include "TextNodeTraversal.h"
</span><span class="cx"> #include <wtf/NeverDestroyed.h>
</span><span class="lines">@@ -51,8 +51,8 @@
</span><span class="cx">
</span><span class="cx"> void InlineStyleSheetOwner::insertedIntoDocument(Element& element)
</span><span class="cx"> {
</span><del>- m_styleSheetScope = &AuthorStyleSheets::forNode(element);
- m_styleSheetScope->addStyleSheetCandidateNode(element, m_isParsingChildren);
</del><ins>+ m_styleScope = &Style::Scope::forNode(element);
+ m_styleScope->addStyleSheetCandidateNode(element, m_isParsingChildren);
</ins><span class="cx">
</span><span class="cx"> if (m_isParsingChildren)
</span><span class="cx"> return;
</span><span class="lines">@@ -61,9 +61,9 @@
</span><span class="cx">
</span><span class="cx"> void InlineStyleSheetOwner::removedFromDocument(Element& element)
</span><span class="cx"> {
</span><del>- if (m_styleSheetScope) {
- m_styleSheetScope->removeStyleSheetCandidateNode(element);
- m_styleSheetScope = nullptr;
</del><ins>+ if (m_styleScope) {
+ m_styleScope->removeStyleSheetCandidateNode(element);
+ m_styleScope = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> if (m_sheet)
</span><span class="cx"> clearSheet();
</span><span class="lines">@@ -74,9 +74,9 @@
</span><span class="cx"> if (m_sheet)
</span><span class="cx"> m_sheet->clearOwnerNode();
</span><span class="cx">
</span><del>- if (m_styleSheetScope) {
- m_styleSheetScope->removeStyleSheetCandidateNode(element);
- m_styleSheetScope = nullptr;
</del><ins>+ if (m_styleScope) {
+ m_styleScope->removeStyleSheetCandidateNode(element);
+ m_styleScope = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -124,8 +124,8 @@
</span><span class="cx"> ASSERT(element.inDocument());
</span><span class="cx"> Document& document = element.document();
</span><span class="cx"> if (m_sheet) {
</span><del>- if (m_sheet->isLoading() && m_styleSheetScope)
- m_styleSheetScope->removePendingSheet();
</del><ins>+ if (m_sheet->isLoading() && m_styleScope)
+ m_styleScope->removePendingSheet();
</ins><span class="cx"> clearSheet();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -149,8 +149,8 @@
</span><span class="cx"> if (!screenEval.evaluate(*mediaQueries) && !printEval.evaluate(*mediaQueries))
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (m_styleSheetScope)
- m_styleSheetScope->addPendingSheet();
</del><ins>+ if (m_styleScope)
+ m_styleScope->addPendingSheet();
</ins><span class="cx">
</span><span class="cx"> m_loading = true;
</span><span class="cx">
</span><span class="lines">@@ -177,8 +177,8 @@
</span><span class="cx"> if (isLoading())
</span><span class="cx"> return false;
</span><span class="cx">
</span><del>- if (m_styleSheetScope)
- m_styleSheetScope->removePendingSheet();
</del><ins>+ if (m_styleScope)
+ m_styleScope->removePendingSheet();
</ins><span class="cx">
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="lines">@@ -185,8 +185,8 @@
</span><span class="cx">
</span><span class="cx"> void InlineStyleSheetOwner::startLoadingDynamicSheet(Element&)
</span><span class="cx"> {
</span><del>- if (m_styleSheetScope)
- m_styleSheetScope->addPendingSheet();
</del><ins>+ if (m_styleScope)
+ m_styleScope->addPendingSheet();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -50,7 +50,7 @@
</span><span class="cx"> void childrenChanged(Element&);
</span><span class="cx"> void finishParsingChildren(Element&);
</span><span class="cx">
</span><del>- AuthorStyleSheets* styleSheetScope() { return m_styleSheetScope; }
</del><ins>+ Style::Scope* styleScope() { return m_styleScope; }
</ins><span class="cx">
</span><span class="cx"> private:
</span><span class="cx"> void createSheet(Element&, const String& text);
</span><span class="lines">@@ -63,7 +63,7 @@
</span><span class="cx"> AtomicString m_contentType;
</span><span class="cx"> AtomicString m_media;
</span><span class="cx"> RefPtr<CSSStyleSheet> m_sheet;
</span><del>- AuthorStyleSheets* m_styleSheetScope { nullptr };
</del><ins>+ Style::Scope* m_styleScope { nullptr };
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -22,7 +22,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ProcessingInstruction.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "CachedCSSStyleSheet.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx"> #include "XSLStyleSheet.h"
</span><span class="cx"> #include "XMLDocumentParser.h" // for parseAttributes()
</span><span class="cx"> #include "MediaList.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -59,7 +59,7 @@
</span><span class="cx"> m_cachedSheet->removeClient(*this);
</span><span class="cx">
</span><span class="cx"> if (inDocument())
</span><del>- document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</del><ins>+ document().styleScope().removeStyleSheetCandidateNode(*this);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String ProcessingInstruction::nodeName() const
</span><span class="lines">@@ -135,7 +135,7 @@
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="cx"> m_loading = true;
</span><del>- document().authorStyleSheets().addPendingSheet();
</del><ins>+ document().styleScope().addPendingSheet();
</ins><span class="cx">
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx"> if (m_isXSL) {
</span><span class="lines">@@ -158,7 +158,7 @@
</span><span class="cx"> else {
</span><span class="cx"> // The request may have been denied if (for example) the stylesheet is local and the document is remote.
</span><span class="cx"> m_loading = false;
</span><del>- document().authorStyleSheets().removePendingSheet();
</del><ins>+ document().styleScope().removePendingSheet();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> bool ProcessingInstruction::sheetLoaded()
</span><span class="cx"> {
</span><span class="cx"> if (!isLoading()) {
</span><del>- document().authorStyleSheets().removePendingSheet();
</del><ins>+ document().styleScope().removePendingSheet();
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> return false;
</span><span class="lines">@@ -251,7 +251,7 @@
</span><span class="cx"> CharacterData::insertedInto(insertionPoint);
</span><span class="cx"> if (!insertionPoint.inDocument())
</span><span class="cx"> return InsertionDone;
</span><del>- document().authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);
</del><ins>+ document().styleScope().addStyleSheetCandidateNode(*this, m_createdByParser);
</ins><span class="cx"> checkStyleSheet();
</span><span class="cx"> return InsertionDone;
</span><span class="cx"> }
</span><span class="lines">@@ -262,7 +262,7 @@
</span><span class="cx"> if (!insertionPoint.inDocument())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</del><ins>+ document().styleScope().removeStyleSheetCandidateNode(*this);
</ins><span class="cx">
</span><span class="cx"> if (m_sheet) {
</span><span class="cx"> ASSERT(m_sheet->ownerNode() == this);
</span><span class="lines">@@ -272,12 +272,12 @@
</span><span class="cx">
</span><span class="cx"> if (m_loading) {
</span><span class="cx"> m_loading = false;
</span><del>- document().authorStyleSheets().removePendingSheet();
</del><ins>+ document().styleScope().removePendingSheet();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
</span><span class="cx"> if (document().hasLivingRenderTree())
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ProcessingInstruction::finishParsingChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "ElementTraversal.h"
</span><span class="cx"> #include "RenderElement.h"
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "SlotAssignment.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "markup.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -42,7 +42,7 @@
</span><span class="cx"> struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope {
</span><span class="cx"> unsigned countersAndFlags[1];
</span><span class="cx"> void* styleResolver;
</span><del>- void* authorStyleSheets;
</del><ins>+ void* styleScope;
</ins><span class="cx"> void* host;
</span><span class="cx"> void* slotAssignment;
</span><span class="cx"> };
</span><span class="lines">@@ -88,8 +88,8 @@
</span><span class="cx"> if (!m_styleResolver) {
</span><span class="cx"> // FIXME: We could share style resolver with shadow roots that have identical style.
</span><span class="cx"> m_styleResolver = std::make_unique<StyleResolver>(document());
</span><del>- if (m_authorStyleSheets)
- m_styleResolver->appendAuthorStyleSheets(m_authorStyleSheets->activeStyleSheets());
</del><ins>+ if (m_styleScope)
+ m_styleResolver->appendAuthorStyleSheets(m_styleScope->activeStyleSheets());
</ins><span class="cx"> }
</span><span class="cx"> return *m_styleResolver;
</span><span class="cx"> }
</span><span class="lines">@@ -107,19 +107,19 @@
</span><span class="cx"> m_styleResolver = nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-AuthorStyleSheets& ShadowRoot::authorStyleSheets()
</del><ins>+Style::Scope& ShadowRoot::styleScope()
</ins><span class="cx"> {
</span><del>- if (!m_authorStyleSheets)
- m_authorStyleSheets = std::make_unique<AuthorStyleSheets>(*this);
- return *m_authorStyleSheets;
</del><ins>+ if (!m_styleScope)
+ m_styleScope = std::make_unique<Style::Scope>(*this);
+ return *m_styleScope;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ShadowRoot::updateStyle()
</span><span class="cx"> {
</span><del>- if (!m_authorStyleSheets)
</del><ins>+ if (!m_styleScope)
</ins><span class="cx"> return;
</span><span class="cx"> // FIXME: Make optimized updated work.
</span><del>- m_authorStyleSheets->didChangeContentsOrInterpretation();
</del><ins>+ m_styleScope->didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String ShadowRoot::innerHTML() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRooth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.h (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.h        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/dom/ShadowRoot.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -36,7 +36,6 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-class AuthorStyleSheets;
</del><span class="cx"> class HTMLSlotElement;
</span><span class="cx"> class SlotAssignment;
</span><span class="cx">
</span><span class="lines">@@ -64,7 +63,7 @@
</span><span class="cx">
</span><span class="cx"> StyleResolver& styleResolver();
</span><span class="cx"> StyleResolver* styleResolverIfExists();
</span><del>- AuthorStyleSheets& authorStyleSheets();
</del><ins>+ Style::Scope& styleScope();
</ins><span class="cx">
</span><span class="cx"> void updateStyle();
</span><span class="cx"> void resetStyleResolver();
</span><span class="lines">@@ -116,7 +115,7 @@
</span><span class="cx"> Element* m_host { nullptr };
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<StyleResolver> m_styleResolver;
</span><del>- std::unique_ptr<AuthorStyleSheets> m_authorStyleSheets;
</del><ins>+ std::unique_ptr<Style::Scope> m_styleScope;
</ins><span class="cx">
</span><span class="cx"> std::unique_ptr<SlotAssignment> m_slotAssignment;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "HTMLLinkElement.h"
</span><span class="cx">
</span><span class="cx"> #include "Attribute.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CachedCSSStyleSheet.h"
</span><span class="cx"> #include "CachedResource.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="lines">@@ -54,6 +53,7 @@
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleInheritedData.h"
</span><span class="cx"> #include "StyleResolveForDocument.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="cx"> #include <wtf/StdLibExtras.h>
</span><span class="lines">@@ -102,7 +102,7 @@
</span><span class="cx"> m_cachedSheet->removeClient(*this);
</span><span class="cx">
</span><span class="cx"> if (inDocument())
</span><del>- document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</del><ins>+ document().styleScope().removeStyleSheetCandidateNode(*this);
</ins><span class="cx">
</span><span class="cx"> linkLoadEventSender().cancelEvent(*this);
</span><span class="cx"> linkErrorEventSender().cancelEvent(*this);
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> if (!m_sheet && m_disabledState == EnabledViaScript)
</span><span class="cx"> process();
</span><span class="cx"> else
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> m_media = value.string().convertToASCIILowercase();
</span><span class="cx"> process();
</span><span class="cx"> if (m_sheet && !isDisabled())
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (name == disabledAttr) {
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx"> } else if (m_sheet) {
</span><span class="cx"> // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
</span><span class="cx"> clearSheet();
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -305,7 +305,7 @@
</span><span class="cx"> if (m_isInShadowTree)
</span><span class="cx"> return InsertionDone;
</span><span class="cx">
</span><del>- document().authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);
</del><ins>+ document().styleScope().addStyleSheetCandidateNode(*this, m_createdByParser);
</ins><span class="cx">
</span><span class="cx"> process();
</span><span class="cx"> return InsertionDone;
</span><span class="lines">@@ -321,7 +321,7 @@
</span><span class="cx"> ASSERT(!m_sheet);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</del><ins>+ document().styleScope().removeStyleSheetCandidateNode(*this);
</ins><span class="cx">
</span><span class="cx"> if (m_sheet)
</span><span class="cx"> clearSheet();
</span><span class="lines">@@ -544,7 +544,7 @@
</span><span class="cx">
</span><span class="cx"> if (m_pendingSheetType == InactiveSheet)
</span><span class="cx"> return;
</span><del>- document().authorStyleSheets().addPendingSheet();
</del><ins>+ document().styleScope().addPendingSheet();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLLinkElement::removePendingSheet(RemovePendingSheetNotificationType notification)
</span><span class="lines">@@ -557,14 +557,14 @@
</span><span class="cx">
</span><span class="cx"> if (type == InactiveSheet) {
</span><span class="cx"> // Document just needs to know about the sheet for exposure through document.styleSheets
</span><del>- document().authorStyleSheets().didChangeCandidatesForActiveSet();
</del><ins>+ document().styleScope().didChangeCandidatesForActiveSet();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- document().authorStyleSheets().removePendingSheet(
</del><ins>+ document().styleScope().removePendingSheet(
</ins><span class="cx"> notification == RemovePendingSheetNotifyImmediately
</span><del>- ? AuthorStyleSheets::RemovePendingSheetNotifyImmediately
- : AuthorStyleSheets::RemovePendingSheetNotifyLater);
</del><ins>+ ? Style::Scope::RemovePendingSheetNotifyImmediately
+ : Style::Scope::RemovePendingSheetNotifyLater);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLStyleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "HTMLStyleElement.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CachedResource.h"
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Event.h"
</span><span class="lines">@@ -35,6 +34,7 @@
</span><span class="cx"> #include "RuntimeEnabledFeatures.h"
</span><span class="cx"> #include "ScriptableDocumentParser.h"
</span><span class="cx"> #include "ShadowRoot.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetContents.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx"> m_styleSheetOwner.setMedia(value);
</span><span class="cx"> if (sheet()) {
</span><span class="cx"> sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
</span><del>- if (auto* scope = m_styleSheetOwner.styleSheetScope())
</del><ins>+ if (auto* scope = m_styleSheetOwner.styleScope())
</ins><span class="cx"> scope->didChangeContentsOrInterpretation();
</span><span class="cx"> } else
</span><span class="cx"> m_styleSheetOwner.childrenChanged(*this);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InspectorCSSAgent.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><span class="cx"> #include "CSSImportRule.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -56,6 +55,7 @@
</span><span class="cx"> #include "StylePropertyShorthand.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleRule.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "StyleSheetList.h"
</span><span class="cx"> #include "WebKitNamedFlow.h"
</span><span class="cx"> #include <inspector/InspectorProtocolObjects.h>
</span><span class="lines">@@ -670,7 +670,7 @@
</span><span class="cx">
</span><span class="cx"> void InspectorCSSAgent::collectAllDocumentStyleSheets(Document& document, Vector<CSSStyleSheet*>& result)
</span><span class="cx"> {
</span><del>- auto cssStyleSheets = document.authorStyleSheets().activeStyleSheetsForInspector();
</del><ins>+ auto cssStyleSheets = document.styleScope().activeStyleSheetsForInspector();
</ins><span class="cx"> for (auto& cssStyleSheet : cssStyleSheets)
</span><span class="cx"> collectStyleSheets(cssStyleSheet.get(), result);
</span><span class="cx"> }
</span><span class="lines">@@ -889,7 +889,7 @@
</span><span class="cx"> m_nodeIdToForcedPseudoState.set(nodeId, forcedPseudoState);
</span><span class="cx"> else
</span><span class="cx"> m_nodeIdToForcedPseudoState.remove(nodeId);
</span><del>- element->document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ element->document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorCSSAgent::getNamedFlowCollection(ErrorString& errorString, int documentNodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::NamedFlow>>& result)
</span><span class="lines">@@ -1015,7 +1015,7 @@
</span><span class="cx">
</span><span class="cx"> // StyleRules returned by StyleResolver::styleRulesForElement lack parent pointers since that infomation is not cheaply available.
</span><span class="cx"> // Since the inspector wants to walk the parent chain, we construct the full wrappers here.
</span><del>- CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule, styleResolver.document().authorStyleSheets(), styleResolver.document().extensionStyleSheets());
</del><ins>+ CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule, styleResolver.document().styleScope(), styleResolver.document().extensionStyleSheets());
</ins><span class="cx"> if (!cssomWrapper)
</span><span class="cx"> return nullptr;
</span><span class="cx"> InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssomWrapper->parentStyleSheet());
</span><span class="lines">@@ -1189,7 +1189,7 @@
</span><span class="cx">
</span><span class="cx"> m_nodeIdToForcedPseudoState.clear();
</span><span class="cx"> for (auto& document : documentsToChange)
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InspectorPageAgent.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CachedCSSStyleSheet.h"
</span><span class="cx"> #include "CachedFont.h"
</span><span class="cx"> #include "CachedImage.h"
</span><span class="lines">@@ -67,6 +66,7 @@
</span><span class="cx"> #include "ScriptController.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "TextEncoding.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="lines">@@ -1002,7 +1002,7 @@
</span><span class="cx"> m_emulatedMedia = media;
</span><span class="cx"> Document* document = m_page.mainFrame().document();
</span><span class="cx"> if (document) {
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> document->updateLayout();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageDOMWindowcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/DOMWindow.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/page/DOMWindow.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -27,7 +27,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "DOMWindow.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "BarProp.h"
</span><span class="cx"> #include "BeforeUnloadEvent.h"
</span><span class="lines">@@ -97,6 +96,7 @@
</span><span class="cx"> #include "StorageNamespaceProvider.h"
</span><span class="cx"> #include "StyleMedia.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "SuddenTermination.h"
</span><span class="cx"> #include "URL.h"
</span><span class="cx"> #include "UserGestureIndicator.h"
</span><span class="lines">@@ -1432,7 +1432,7 @@
</span><span class="cx"> if (pseudoType == CSSSelector::PseudoElementUnknown && !pseudoElement.isEmpty())
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- m_frame->document()->authorStyleSheets().flushPendingUpdate();
</del><ins>+ m_frame->document()->styleScope().flushPendingUpdate();
</ins><span class="cx">
</span><span class="cx"> unsigned rulesToInclude = StyleResolver::AuthorCSSRules;
</span><span class="cx"> if (!authorOnly)
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/page/Frame.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "ApplyStyleCommand.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -93,6 +92,7 @@
</span><span class="cx"> #include "ScrollingCoordinator.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleProperties.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "TextNodeTraversal.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "UserContentController.h"
</span><span class="lines">@@ -644,7 +644,7 @@
</span><span class="cx"> m_doc->setPrinting(printing);
</span><span class="cx"> view()->adjustMediaTypeForPrinting(printing);
</span><span class="cx">
</span><del>- m_doc->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_doc->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> if (shouldUsePrintingLayout()) {
</span><span class="cx"> view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
</span><span class="cx"> } else {
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx">
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "AnimationController.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "CachedImage.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="lines">@@ -92,6 +91,7 @@
</span><span class="cx"> #include "ScrollingCoordinator.h"
</span><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "TextStream.h"
</span><span class="cx"> #include "TiledBacking.h"
</span><span class="lines">@@ -1335,7 +1335,7 @@
</span><span class="cx"> StyleResolver* styleResolver = document.styleResolverIfExists();
</span><span class="cx"> if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) {
</span><span class="cx"> LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc");
</span><del>- document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds.
</span><span class="cx"> InspectorInstrumentation::mediaQueryResultChanged(document);
</span><span class="cx"> } else
</span><span class="lines">@@ -3532,7 +3532,7 @@
</span><span class="cx">
</span><span class="cx"> m_pagination = pagination;
</span><span class="cx">
</span><del>- frame().document()->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ frame().document()->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IntRect FrameView::windowClipRect() const
</span><span class="lines">@@ -5001,7 +5001,7 @@
</span><span class="cx"> if (Document* document = frame().document()) {
</span><span class="cx"> // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously
</span><span class="cx"> // dirtying style here causes assertions on iOS (rdar://problem/19998166).
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/page/Page.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx"> #include "AlternativeTextClient.h"
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "ApplicationCacheStorage.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardClient.h"
</span><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="lines">@@ -90,6 +89,7 @@
</span><span class="cx"> #include "StorageNamespace.h"
</span><span class="cx"> #include "StorageNamespaceProvider.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "SubframeLoader.h"
</span><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "UserContentProvider.h"
</span><span class="lines">@@ -424,7 +424,7 @@
</span><span class="cx"> m_mainFrame->view()->forceLayout();
</span><span class="cx">
</span><span class="cx"> if (m_mainFrame->document())
</span><del>- m_mainFrame->document()->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_mainFrame->document()->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx">
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> if (Document* document = frame->document())
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1163,7 +1163,7 @@
</span><span class="cx"> if (!document)
</span><span class="cx"> continue;
</span><span class="cx"> document->extensionStyleSheets().invalidateInjectedStyleSheetCache();
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleScopecppfromrev206916trunkSourceWebCoredomAuthorStyleSheetscpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/style/StyleScope.cpp (from rev 206916, trunk/Source/WebCore/dom/AuthorStyleSheets.cpp) (0 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleScope.cpp         (rev 0)
+++ trunk/Source/WebCore/style/StyleScope.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -0,0 +1,490 @@
</span><ins>+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * (C) 2001 Dirk Mueller (mueller@kde.org)
+ * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2004-2009, 2011-2012, 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2008, 2009, 2011, 2012 Google Inc. All rights reserved.
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) Research In Motion Limited 2010-2011. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "StyleScope.h"
+
+#include "CSSStyleSheet.h"
+#include "Element.h"
+#include "ElementChildIterator.h"
+#include "ExtensionStyleSheets.h"
+#include "HTMLIFrameElement.h"
+#include "HTMLLinkElement.h"
+#include "HTMLStyleElement.h"
+#include "InspectorInstrumentation.h"
+#include "Page.h"
+#include "PageGroup.h"
+#include "ProcessingInstruction.h"
+#include "SVGNames.h"
+#include "SVGStyleElement.h"
+#include "Settings.h"
+#include "ShadowRoot.h"
+#include "StyleInvalidationAnalysis.h"
+#include "StyleResolver.h"
+#include "StyleSheetContents.h"
+#include "StyleSheetList.h"
+#include "UserContentController.h"
+#include "UserContentURLPattern.h"
+#include "UserStyleSheet.h"
+
+namespace WebCore {
+
+using namespace ContentExtensions;
+using namespace HTMLNames;
+
+namespace Style {
+
+Scope::Scope(Document& document)
+ : m_document(document)
+ , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
+{
+}
+
+Scope::Scope(ShadowRoot& shadowRoot)
+ : m_document(shadowRoot.documentScope())
+ , m_shadowRoot(&shadowRoot)
+ , m_pendingUpdateTimer(*this, &Scope::pendingUpdateTimerFired)
+{
+}
+
+StyleResolver& Scope::styleResolver()
+{
+ if (m_shadowRoot)
+ return m_shadowRoot->styleResolver();
+
+ return m_document.ensureStyleResolver();
+}
+
+StyleResolver* Scope::styleResolverIfExists()
+{
+ if (m_shadowRoot)
+ return m_shadowRoot->styleResolverIfExists();
+
+ return m_document.styleResolverIfExists();
+}
+
+Scope& Scope::forNode(Node& node)
+{
+ ASSERT(node.inDocument());
+ auto* shadowRoot = node.containingShadowRoot();
+ if (shadowRoot)
+ return shadowRoot->styleScope();
+ return node.document().styleScope();
+}
+
+// This method is called whenever a top-level stylesheet has finished loading.
+void Scope::removePendingSheet(RemovePendingSheetNotificationType notification)
+{
+ // Make sure we knew this sheet was pending, and that our count isn't out of sync.
+ ASSERT(m_pendingStyleSheetCount > 0);
+
+ m_pendingStyleSheetCount--;
+
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+ if (!ownerElement())
+ printf("Stylesheet loaded at time %d. %d stylesheets still remain.\n", elapsedTime(), m_pendingStylesheets);
+#endif
+
+ if (m_pendingStyleSheetCount)
+ return;
+
+ if (notification == RemovePendingSheetNotifyLater) {
+ m_document.setNeedsNotifyRemoveAllPendingStylesheet();
+ return;
+ }
+
+ if (m_shadowRoot) {
+ m_shadowRoot->updateStyle();
+ return;
+ }
+
+ m_document.didRemoveAllPendingStylesheet();
+}
+
+void Scope::addStyleSheetCandidateNode(Node& node, bool createdByParser)
+{
+ if (!node.inDocument())
+ return;
+
+ // Until the <body> exists, we have no choice but to compare document positions,
+ // since styles outside of the body and head continue to be shunted into the head
+ // (and thus can shift to end up before dynamically added DOM content that is also
+ // outside the body).
+ if ((createdByParser && m_document.bodyOrFrameset()) || m_styleSheetCandidateNodes.isEmpty()) {
+ m_styleSheetCandidateNodes.add(&node);
+ return;
+ }
+
+ // Determine an appropriate insertion point.
+ auto begin = m_styleSheetCandidateNodes.begin();
+ auto end = m_styleSheetCandidateNodes.end();
+ auto it = end;
+ Node* followingNode = nullptr;
+ do {
+ --it;
+ Node* n = *it;
+ unsigned short position = n->compareDocumentPosition(node);
+ if (position == Node::DOCUMENT_POSITION_FOLLOWING) {
+ m_styleSheetCandidateNodes.insertBefore(followingNode, &node);
+ return;
+ }
+ followingNode = n;
+ } while (it != begin);
+
+ m_styleSheetCandidateNodes.insertBefore(followingNode, &node);
+}
+
+void Scope::removeStyleSheetCandidateNode(Node& node)
+{
+ if (m_styleSheetCandidateNodes.remove(&node))
+ scheduleActiveSetUpdate();
+}
+
+void Scope::collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>& sheets)
+{
+ if (m_document.settings() && !m_document.settings()->authorAndUserStylesEnabled())
+ return;
+
+ for (auto& node : m_styleSheetCandidateNodes) {
+ StyleSheet* sheet = nullptr;
+ if (is<ProcessingInstruction>(*node)) {
+ // Processing instruction (XML documents only).
+ // We don't support linking to embedded CSS stylesheets, see <https://bugs.webkit.org/show_bug.cgi?id=49281> for discussion.
+ ProcessingInstruction& pi = downcast<ProcessingInstruction>(*node);
+ sheet = pi.sheet();
+#if ENABLE(XSLT)
+ // Don't apply XSL transforms to already transformed documents -- <rdar://problem/4132806>
+ if (pi.isXSL() && !m_document.transformSourceDocument()) {
+ // Don't apply XSL transforms until loading is finished.
+ if (!m_document.parsing())
+ m_document.applyXSLTransform(&pi);
+ return;
+ }
+#endif
+ } else if (is<HTMLLinkElement>(*node) || is<HTMLStyleElement>(*node) || is<SVGStyleElement>(*node)) {
+ Element& element = downcast<Element>(*node);
+ AtomicString title = element.attributeWithoutSynchronization(titleAttr);
+ bool enabledViaScript = false;
+ if (is<HTMLLinkElement>(element)) {
+ // <LINK> element
+ HTMLLinkElement& linkElement = downcast<HTMLLinkElement>(element);
+ if (linkElement.isDisabled())
+ continue;
+ enabledViaScript = linkElement.isEnabledViaScript();
+ if (linkElement.styleSheetIsLoading()) {
+ // it is loading but we should still decide which style sheet set to use
+ if (!enabledViaScript && !title.isEmpty() && m_preferredStylesheetSetName.isEmpty()) {
+ if (!linkElement.attributeWithoutSynchronization(relAttr).contains("alternate")) {
+ m_preferredStylesheetSetName = title;
+ m_selectedStylesheetSetName = title;
+ }
+ }
+ continue;
+ }
+ if (!linkElement.sheet())
+ title = nullAtom;
+ }
+ // Get the current preferred styleset. This is the
+ // set of sheets that will be enabled.
+ if (is<SVGStyleElement>(element))
+ sheet = downcast<SVGStyleElement>(element).sheet();
+ else if (is<HTMLLinkElement>(element))
+ sheet = downcast<HTMLLinkElement>(element).sheet();
+ else
+ sheet = downcast<HTMLStyleElement>(element).sheet();
+ // Check to see if this sheet belongs to a styleset
+ // (thus making it PREFERRED or ALTERNATE rather than
+ // PERSISTENT).
+ auto& rel = element.attributeWithoutSynchronization(relAttr);
+ if (!enabledViaScript && !title.isEmpty()) {
+ // Yes, we have a title.
+ if (m_preferredStylesheetSetName.isEmpty()) {
+ // No preferred set has been established. If
+ // we are NOT an alternate sheet, then establish
+ // us as the preferred set. Otherwise, just ignore
+ // this sheet.
+ if (is<HTMLStyleElement>(element) || !rel.contains("alternate"))
+ m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
+ }
+ if (title != m_preferredStylesheetSetName)
+ sheet = nullptr;
+ }
+
+ if (rel.contains("alternate") && title.isEmpty())
+ sheet = nullptr;
+ }
+ if (sheet)
+ sheets.append(sheet);
+ }
+}
+
+Scope::StyleResolverUpdateType Scope::analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc)
+{
+ requiresFullStyleRecalc = true;
+
+ unsigned newStylesheetCount = newStylesheets.size();
+
+ if (!styleResolverIfExists())
+ return Reconstruct;
+
+ StyleResolver& styleResolver = *styleResolverIfExists();
+
+ // Find out which stylesheets are new.
+ unsigned oldStylesheetCount = m_activeStyleSheets.size();
+ if (newStylesheetCount < oldStylesheetCount)
+ return Reconstruct;
+
+ Vector<StyleSheetContents*> addedSheets;
+ unsigned newIndex = 0;
+ for (unsigned oldIndex = 0; oldIndex < oldStylesheetCount; ++oldIndex) {
+ if (newIndex >= newStylesheetCount)
+ return Reconstruct;
+ while (m_activeStyleSheets[oldIndex] != newStylesheets[newIndex]) {
+ addedSheets.append(&newStylesheets[newIndex]->contents());
+ ++newIndex;
+ if (newIndex == newStylesheetCount)
+ return Reconstruct;
+ }
+ ++newIndex;
+ }
+ bool hasInsertions = !addedSheets.isEmpty();
+ while (newIndex < newStylesheetCount) {
+ addedSheets.append(&newStylesheets[newIndex]->contents());
+ ++newIndex;
+ }
+ // If all new sheets were added at the end of the list we can just add them to existing StyleResolver.
+ // If there were insertions we need to re-add all the stylesheets so rules are ordered correctly.
+ auto styleResolverUpdateType = hasInsertions ? Reset : Additive;
+
+ // If we are already parsing the body and so may have significant amount of elements, put some effort into trying to avoid style recalcs.
+ if (!m_document.bodyOrFrameset() || m_document.hasNodesWithPlaceholderStyle())
+ return styleResolverUpdateType;
+
+ StyleInvalidationAnalysis invalidationAnalysis(addedSheets, styleResolver.mediaQueryEvaluator());
+ if (invalidationAnalysis.dirtiesAllStyle())
+ return styleResolverUpdateType;
+ invalidationAnalysis.invalidateStyle(m_document);
+ requiresFullStyleRecalc = false;
+
+ return styleResolverUpdateType;
+}
+
+static void filterEnabledNonemptyCSSStyleSheets(Vector<RefPtr<CSSStyleSheet>>& result, const Vector<RefPtr<StyleSheet>>& sheets)
+{
+ for (auto& sheet : sheets) {
+ if (!is<CSSStyleSheet>(*sheet))
+ continue;
+ CSSStyleSheet& styleSheet = downcast<CSSStyleSheet>(*sheet);
+ if (styleSheet.isLoading())
+ continue;
+ if (styleSheet.disabled())
+ continue;
+ if (!styleSheet.length())
+ continue;
+ result.append(&styleSheet);
+ }
+}
+
+void Scope::updateActiveStyleSheets(UpdateType updateType)
+{
+ ASSERT(!m_pendingUpdateType);
+
+ if (m_document.inStyleRecalc() || m_document.inRenderTreeUpdate()) {
+ // Protect against deleting style resolver in the middle of a style resolution.
+ // Crash stacks indicate we can get here when a resource load fails synchronously (for example due to content blocking).
+ // FIXME: These kind of cases should be eliminated and this path replaced by an assert.
+ m_pendingUpdateType = UpdateType::ContentsOrInterpretation;
+ m_document.scheduleForcedStyleRecalc();
+ return;
+ }
+
+ if (!m_document.hasLivingRenderTree()) {
+ m_document.clearStyleResolver();
+ return;
+ }
+
+ // Don't bother updating, since we haven't loaded all our style info yet
+ // and haven't calculated the style resolver for the first time.
+ if (!m_shadowRoot && !m_didUpdateActiveStyleSheets && m_pendingStyleSheetCount) {
+ m_document.clearStyleResolver();
+ return;
+ }
+
+ // FIXME: Support optimized invalidation in shadow trees.
+ if (m_shadowRoot)
+ updateType = UpdateType::ContentsOrInterpretation;
+
+ m_didUpdateActiveStyleSheets = true;
+
+ Vector<RefPtr<StyleSheet>> activeStyleSheets;
+ collectActiveStyleSheets(activeStyleSheets);
+
+ Vector<RefPtr<CSSStyleSheet>> activeCSSStyleSheets;
+ activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
+ activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
+ filterEnabledNonemptyCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
+
+ bool requiresFullStyleRecalc = true;
+ StyleResolverUpdateType styleResolverUpdateType = Reconstruct;
+ if (updateType == UpdateType::ActiveSet)
+ styleResolverUpdateType = analyzeStyleSheetChange(activeCSSStyleSheets, requiresFullStyleRecalc);
+
+ updateStyleResolver(activeCSSStyleSheets, styleResolverUpdateType);
+
+ m_weakCopyOfActiveStyleSheetListForFastLookup = nullptr;
+ m_activeStyleSheets.swap(activeCSSStyleSheets);
+ m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
+
+ InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
+
+ for (const auto& sheet : m_activeStyleSheets) {
+ if (sheet->contents().usesStyleBasedEditability())
+ m_usesStyleBasedEditability = true;
+ }
+
+ if (requiresFullStyleRecalc) {
+ if (m_shadowRoot) {
+ for (auto& shadowChild : childrenOfType<Element>(*m_shadowRoot))
+ shadowChild.setNeedsStyleRecalc();
+ } else
+ m_document.scheduleForcedStyleRecalc();
+ }
+}
+
+void Scope::updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets, StyleResolverUpdateType updateType)
+{
+ if (updateType == Reconstruct) {
+ if (m_shadowRoot)
+ m_shadowRoot->resetStyleResolver();
+ else
+ m_document.clearStyleResolver();
+ return;
+ }
+ auto& styleResolver = this->styleResolver();
+
+ if (updateType == Reset) {
+ styleResolver.ruleSets().resetAuthorStyle();
+ styleResolver.appendAuthorStyleSheets(activeStyleSheets);
+ } else {
+ ASSERT(updateType == Additive);
+ unsigned firstNewIndex = m_activeStyleSheets.size();
+ Vector<RefPtr<CSSStyleSheet>> newStyleSheets;
+ newStyleSheets.appendRange(activeStyleSheets.begin() + firstNewIndex, activeStyleSheets.end());
+ styleResolver.appendAuthorStyleSheets(newStyleSheets);
+ }
+
+ if (!m_shadowRoot) {
+ auto& userAgentShadowTreeStyleResolver = m_document.userAgentShadowTreeStyleResolver();
+ userAgentShadowTreeStyleResolver.ruleSets().resetAuthorStyle();
+ auto& authorRuleSet = styleResolver.ruleSets().authorStyle();
+ if (authorRuleSet.hasShadowPseudoElementRules())
+ userAgentShadowTreeStyleResolver.ruleSets().authorStyle().copyShadowPseudoElementRulesFrom(authorRuleSet);
+ }
+}
+
+const Vector<RefPtr<CSSStyleSheet>> Scope::activeStyleSheetsForInspector() const
+{
+ Vector<RefPtr<CSSStyleSheet>> result;
+
+ result.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
+ result.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
+
+ for (auto& styleSheet : m_styleSheetsForStyleSheetList) {
+ if (!is<CSSStyleSheet>(*styleSheet))
+ continue;
+
+ CSSStyleSheet& sheet = downcast<CSSStyleSheet>(*styleSheet);
+ if (sheet.disabled())
+ continue;
+
+ result.append(&sheet);
+ }
+
+ return result;
+}
+
+bool Scope::activeStyleSheetsContains(const CSSStyleSheet* sheet) const
+{
+ if (!m_weakCopyOfActiveStyleSheetListForFastLookup) {
+ m_weakCopyOfActiveStyleSheetListForFastLookup = std::make_unique<HashSet<const CSSStyleSheet*>>();
+ for (auto& activeStyleSheet : m_activeStyleSheets)
+ m_weakCopyOfActiveStyleSheetListForFastLookup->add(activeStyleSheet.get());
+ }
+ return m_weakCopyOfActiveStyleSheetListForFastLookup->contains(sheet);
+}
+
+void Scope::flushPendingUpdate()
+{
+ if (!m_pendingUpdateType)
+ return;
+ auto updateType = *m_pendingUpdateType;
+
+ clearPendingUpdate();
+
+ updateActiveStyleSheets(updateType);
+}
+
+void Scope::clearPendingUpdate()
+{
+ m_pendingUpdateTimer.stop();
+ m_pendingUpdateType = { };
+}
+
+void Scope::scheduleActiveSetUpdate()
+{
+ if (m_shadowRoot) {
+ // FIXME: We need to flush updates recursively to support asynchronous updates in shadow trees.
+ didChangeCandidatesForActiveSet();
+ return;
+ }
+ if (m_pendingUpdateTimer.isActive())
+ return;
+ if (!m_pendingUpdateType)
+ m_pendingUpdateType = UpdateType::ActiveSet;
+ m_pendingUpdateTimer.startOneShot(0);
+}
+
+void Scope::didChangeCandidatesForActiveSet()
+{
+ auto updateType = m_pendingUpdateType.valueOr(UpdateType::ActiveSet);
+ clearPendingUpdate();
+ updateActiveStyleSheets(updateType);
+}
+
+void Scope::didChangeContentsOrInterpretation()
+{
+ clearPendingUpdate();
+ updateActiveStyleSheets(UpdateType::ContentsOrInterpretation);
+}
+
+void Scope::pendingUpdateTimerFired()
+{
+ flushPendingUpdate();
+}
+
+}
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorestyleStyleScopehfromrev206916trunkSourceWebCoredomAuthorStyleSheetsh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/style/StyleScope.h (from rev 206916, trunk/Source/WebCore/dom/AuthorStyleSheets.h) (0 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleScope.h         (rev 0)
+++ trunk/Source/WebCore/style/StyleScope.h        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -0,0 +1,142 @@
</span><ins>+/*
+ * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
+ * (C) 1999 Antti Koivisto (koivisto@kde.org)
+ * (C) 2001 Dirk Mueller (mueller@kde.org)
+ * (C) 2006 Alexey Proskuryakov (ap@webkit.org)
+ * Copyright (C) 2004-2010, 2012-2013, 2015-2016 Apple Inc. All rights reserved.
+ * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
+ * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
+ * Copyright (C) 2011 Google Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#pragma once
+
+#include "Timer.h"
+#include <memory>
+#include <wtf/FastMalloc.h>
+#include <wtf/HashMap.h>
+#include <wtf/ListHashSet.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class CSSStyleSheet;
+class Document;
+class Node;
+class StyleResolver;
+class StyleSheet;
+class StyleSheetContents;
+class StyleSheetList;
+class ShadowRoot;
+class TreeScope;
+
+namespace Style {
+
+class Scope {
+ WTF_MAKE_FAST_ALLOCATED;
+public:
+ explicit Scope(Document&);
+ explicit Scope(ShadowRoot&);
+
+ const Vector<RefPtr<CSSStyleSheet>>& activeStyleSheets() const { return m_activeStyleSheets; }
+
+ const Vector<RefPtr<StyleSheet>>& styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
+ const Vector<RefPtr<CSSStyleSheet>> activeStyleSheetsForInspector() const;
+
+ void addStyleSheetCandidateNode(Node&, bool createdByParser);
+ void removeStyleSheetCandidateNode(Node&);
+
+ String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
+ String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
+ void setPreferredStylesheetSetName(const String& name) { m_preferredStylesheetSetName = name; }
+ void setSelectedStylesheetSetName(const String& name) { m_selectedStylesheetSetName = name; }
+
+ void addPendingSheet() { m_pendingStyleSheetCount++; }
+ enum RemovePendingSheetNotificationType {
+ RemovePendingSheetNotifyImmediately,
+ RemovePendingSheetNotifyLater
+ };
+ void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
+
+ bool hasPendingSheets() const { return m_pendingStyleSheetCount > 0; }
+
+ bool usesStyleBasedEditability() { return m_usesStyleBasedEditability; }
+
+ bool activeStyleSheetsContains(const CSSStyleSheet*) const;
+
+ void didChangeCandidatesForActiveSet();
+ void scheduleActiveSetUpdate();
+ WEBCORE_EXPORT void didChangeContentsOrInterpretation();
+
+ bool hasPendingUpdate() const { return !!m_pendingUpdateType; }
+ void flushPendingUpdate();
+
+ StyleResolver& styleResolver();
+ StyleResolver* styleResolverIfExists();
+
+ static Scope& forNode(Node&);
+
+private:
+ enum class UpdateType { ActiveSet, ContentsOrInterpretation };
+ void updateActiveStyleSheets(UpdateType);
+
+ void collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>&);
+
+ enum StyleResolverUpdateType {
+ Reconstruct,
+ Reset,
+ Additive
+ };
+ StyleResolverUpdateType analyzeStyleSheetChange(const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc);
+ void updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>&, StyleResolverUpdateType);
+
+ void pendingUpdateTimerFired();
+ void clearPendingUpdate();
+
+ Document& m_document;
+ ShadowRoot* m_shadowRoot { nullptr };
+
+ Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList;
+ Vector<RefPtr<CSSStyleSheet>> m_activeStyleSheets;
+
+ Timer m_pendingUpdateTimer;
+
+ mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
+
+ // Track the number of currently loading top-level stylesheets needed for rendering.
+ // Sheets loaded using the @import directive are not included in this count.
+ // We use this count of pending sheets to detect when we can begin attaching
+ // elements and when it is safe to execute scripts.
+ int m_pendingStyleSheetCount { 0 };
+ bool m_didUpdateActiveStyleSheets { false };
+
+ Optional<UpdateType> m_pendingUpdateType;
+
+ ListHashSet<Node*> m_styleSheetCandidateNodes;
+
+ String m_preferredStylesheetSetName;
+ String m_selectedStylesheetSetName;
+
+ bool m_usesStyleBasedEditability { false };
+};
+
+}
+}
</ins></span></pre></div>
<a id="trunkSourceWebCorestyleStyleTreeResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleTreeResolver.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/style/StyleTreeResolver.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "StyleTreeResolver.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSFontSelector.h"
</span><span class="cx"> #include "ComposedTreeAncestorIterator.h"
</span><span class="cx"> #include "ComposedTreeIterator.h"
</span><span class="lines">@@ -45,6 +44,7 @@
</span><span class="cx"> #include "ShadowRoot.h"
</span><span class="cx"> #include "StyleFontSizeFunctions.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "Text.h"
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceElement.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> #include "SVGFontFaceElement.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -42,6 +41,7 @@
</span><span class="cx"> #include "StyleProperties.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleRule.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include <math.h>
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNode& rootParent)
</span><span class="lines">@@ -292,7 +292,7 @@
</span><span class="cx"> document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
</span><span class="cx"> m_fontFaceRule->mutableProperties().clear();
</span><span class="cx">
</span><del>- document().authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document().styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> } else
</span><span class="cx"> ASSERT(!m_fontElement);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLTreeViewercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLTreeViewer.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "ExceptionCodePlaceholder.h"
</span><span class="lines">@@ -41,6 +40,7 @@
</span><span class="cx"> #include "ScriptSourceCode.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "SecurityOriginPolicy.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "Text.h"
</span><span class="cx"> #include "XMLViewerCSS.h"
</span><span class="cx"> #include "XMLViewerJS.h"
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> String cssString = StringImpl::createWithoutCopying(XMLViewer_css, sizeof(XMLViewer_css));
</span><span class="cx"> auto text = m_document.createTextNode(cssString);
</span><span class="cx"> m_document.getElementById(String(ASCIILiteral("xml-viewer-style")))->appendChild(text, IGNORE_EXCEPTION);
</span><del>- m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ m_document.styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "XMLDocumentParser.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CDATASection.h"
</span><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "Comment.h"
</span><span class="lines">@@ -49,6 +48,7 @@
</span><span class="cx"> #include "SVGStyleElement.h"
</span><span class="cx"> #include "ScriptElement.h"
</span><span class="cx"> #include "ScriptSourceCode.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "TreeDepthLimit.h"
</span><span class="cx"> #include <wtf/Ref.h>
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx"> insertErrorMessageBlock();
</span><span class="cx"> else {
</span><span class="cx"> updateLeafTextNode();
</span><del>- document()->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document()->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (isParsing())
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "XMLDocumentParser.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CDATASection.h"
</span><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "Comment.h"
</span><span class="lines">@@ -56,6 +55,7 @@
</span><span class="cx"> #include "ScriptSourceCode.h"
</span><span class="cx"> #include "SecurityOrigin.h"
</span><span class="cx"> #include "Settings.h"
</span><ins>+#include "StyleScope.h"
</ins><span class="cx"> #include "TextResourceDecoder.h"
</span><span class="cx"> #include "TransformSource.h"
</span><span class="cx"> #include "XMLNSNames.h"
</span><span class="lines">@@ -1387,7 +1387,7 @@
</span><span class="cx"> document()->setTransformSource(std::make_unique<TransformSource>(doc));
</span><span class="cx">
</span><span class="cx"> document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
</span><del>- document()->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document()->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx">
</span><span class="cx"> // styleResolverChanged() call can detach the parser and null out its document.
</span><span class="cx"> // In that case, we just bail out.
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (206916 => 206917)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-10-07 16:41:48 UTC (rev 206916)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-10-07 16:55:11 UTC (rev 206917)
</span><span class="lines">@@ -72,7 +72,6 @@
</span><span class="cx"> #import "WebTypesInternal.h"
</span><span class="cx"> #import "WebUIDelegatePrivate.h"
</span><span class="cx"> #import "WebViewInternal.h"
</span><del>-#import <WebCore/AuthorStyleSheets.h>
</del><span class="cx"> #import <WebCore/CSSStyleDeclaration.h>
</span><span class="cx"> #import <WebCore/CachedImage.h>
</span><span class="cx"> #import <WebCore/CachedResourceClient.h>
</span><span class="lines">@@ -119,6 +118,7 @@
</span><span class="cx"> #import <WebCore/RuntimeApplicationChecks.h>
</span><span class="cx"> #import <WebCore/SharedBuffer.h>
</span><span class="cx"> #import <WebCore/StyleProperties.h>
</span><ins>+#import <WebCore/StyleScope.h>
</ins><span class="cx"> #import <WebCore/Text.h>
</span><span class="cx"> #import <WebCore/TextAlternativeWithRange.h>
</span><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="lines">@@ -3612,7 +3612,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (Frame* coreFrame = core([self _frame])) {
</span><del>- coreFrame->document()->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ coreFrame->document()->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> coreFrame->document()->updateStyleIfNeeded();
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -5007,7 +5007,7 @@
</span><span class="cx">
</span><span class="cx"> document->setPaginatedForScreen(_private->paginateScreenContent);
</span><span class="cx"> document->setPrinting(_private->printing);
</span><del>- document->authorStyleSheets().didChangeContentsOrInterpretation();
</del><ins>+ document->styleScope().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>