<!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>[190169] trunk/Source/WebCore</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/190169">190169</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2015-09-23 08:04:16 -0700 (Wed, 23 Sep 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Split author style code out from DocumentStyleSheetCollection
https://bugs.webkit.org/show_bug.cgi?id=149446

Reviewed by Andreas Kling.

Shadow trees may have their own author style. Factor the related code out so we can use
it outside the document context.

DocumentStyleSheetCollection is replaced by two classes:

AuthorStyleSheets - author stylesheets and mutation optimization code
ExtensionStyleSheets - user stylesheets, injected author stylesheets, content extension stylesheets

* WebCore.xcodeproj/project.pbxproj:
* contentextensions/ContentExtensionsBackend.cpp:
(WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::~DocumentRuleSets):
(WebCore::DocumentRuleSets::initUserStyle):
* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::sibling):
(WebCore::DocumentRuleSets::uncommonAttribute):
* css/InspectorCSSOMWrappers.cpp:
(WebCore::InspectorCSSOMWrappers::collectFromStyleSheets):
(WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
(WebCore::InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection): Deleted.
* css/InspectorCSSOMWrappers.h:
* css/StyleResolver.cpp:
(WebCore::StyleResolver::StyleResolver):
(WebCore::StyleResolver::appendAuthorStyleSheets):
* css/StyleSheetList.cpp:
(WebCore::StyleSheetList::styleSheets):
(WebCore::StyleSheetList::detachFromDocument):
(WebCore::StyleSheetList::length):
* dom/AuthorStyleSheets.cpp: Added.
(WebCore::AuthorStyleSheets::AuthorStyleSheets):
(WebCore::AuthorStyleSheets::combineCSSFeatureFlags):
(WebCore::AuthorStyleSheets::resetCSSFeatureFlags):
(WebCore::AuthorStyleSheets::addAuthorSheet):
(WebCore::AuthorStyleSheets::removePendingSheet):
(WebCore::AuthorStyleSheets::addStyleSheetCandidateNode):
(WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
(WebCore::AuthorStyleSheets::collectActiveStyleSheets):
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
(WebCore::filterEnabledNonemptyCSSStyleSheets):
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
(WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
(WebCore::AuthorStyleSheets::activeStyleSheetsContains):
(WebCore::AuthorStyleSheets::detachFromDocument):
* dom/AuthorStyleSheets.h: Added.
(WebCore::AuthorStyleSheets::activeStyleSheets):
(WebCore::AuthorStyleSheets::styleSheets):
(WebCore::AuthorStyleSheets::styleSheetsForStyleSheetList):
(WebCore::AuthorStyleSheets::pendingUpdateType):
(WebCore::AuthorStyleSheets::setPendingUpdateType):
(WebCore::AuthorStyleSheets::flushPendingUpdates):
(WebCore::AuthorStyleSheets::preferredStylesheetSetName):
(WebCore::AuthorStyleSheets::selectedStylesheetSetName):
(WebCore::AuthorStyleSheets::setPreferredStylesheetSetName):
(WebCore::AuthorStyleSheets::setSelectedStylesheetSetName):
(WebCore::AuthorStyleSheets::addPendingSheet):
(WebCore::AuthorStyleSheets::hasPendingSheets):
(WebCore::AuthorStyleSheets::usesFirstLineRules):
(WebCore::AuthorStyleSheets::usesFirstLetterRules):
(WebCore::AuthorStyleSheets::usesRemUnits):
(WebCore::AuthorStyleSheets::setUsesRemUnit):
(WebCore::AuthorStyleSheets::usesStyleBasedEditability):
(WebCore::AuthorStyleSheets::setUsesStyleBasedEditability):
* dom/Document.cpp:
(WebCore::Document::Document):
(WebCore::Document::~Document):
(WebCore::Document::setCompatibilityMode):
(WebCore::Document::recalcStyle):
(WebCore::Document::createStyleResolver):
(WebCore::Document::fontsNeedUpdate):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::preferredStylesheetSet):
(WebCore::Document::selectedStylesheetSet):
(WebCore::Document::setSelectedStylesheetSet):
(WebCore::Document::scheduleOptimizedStyleSheetUpdate):
(WebCore::Document::styleResolverChanged):
(WebCore::Document::haveStylesheetsLoaded):
(WebCore::Document::getCachedLocale):
* dom/Document.h:
(WebCore::Document::authorStyleSheets):
(WebCore::Document::extensionStyleSheets):
(WebCore::Document::gotoAnchorNeededAfterStylesheetsLoad):
(WebCore::Document::setGotoAnchorNeededAfterStylesheetsLoad):
(WebCore::Document::styleSheetCollection): Deleted.
* dom/DocumentStyleSheetCollection.cpp: Removed.
* dom/DocumentStyleSheetCollection.h: Removed.
* dom/ExtensionStyleSheets.cpp: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.cpp.
(WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
(WebCore::ExtensionStyleSheets::pageUserSheet):
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::injectedUserStyleSheets):
(WebCore::ExtensionStyleSheets::injectedAuthorStyleSheets):
(WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserSheet):
(WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
(WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
(WebCore::ExtensionStyleSheets::detachFromDocument):
(WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection): Deleted.
(WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags): Deleted.
(WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags): Deleted.
(WebCore::DocumentStyleSheetCollection::pageUserSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::clearPageUserSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::updatePageUserSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache): Deleted.
(WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache): Deleted.
(WebCore::DocumentStyleSheetCollection::addAuthorSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::addUserSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector): Deleted.
(WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired): Deleted.
(WebCore::DocumentStyleSheetCollection::removePendingSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::addStyleSheetCandidateNode): Deleted.
(WebCore::DocumentStyleSheetCollection::removeStyleSheetCandidateNode): Deleted.
(WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange): Deleted.
(WebCore::filterEnabledNonemptyCSSStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::activeStyleSheetsForInspector): Deleted.
(WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains): Deleted.
(WebCore::DocumentStyleSheetCollection::detachFromDocument): Deleted.
* dom/ExtensionStyleSheets.h: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.h.
(WebCore::ExtensionStyleSheets::documentUserStyleSheets):
(WebCore::DocumentStyleSheetCollection::styleSheetsForStyleSheetList): Deleted.
(WebCore::DocumentStyleSheetCollection::activeAuthorStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::documentUserStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::documentAuthorStyleSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::pendingUpdateType): Deleted.
(WebCore::DocumentStyleSheetCollection::setPendingUpdateType): Deleted.
(WebCore::DocumentStyleSheetCollection::flushPendingUpdates): Deleted.
(WebCore::DocumentStyleSheetCollection::preferredStylesheetSetName): Deleted.
(WebCore::DocumentStyleSheetCollection::selectedStylesheetSetName): Deleted.
(WebCore::DocumentStyleSheetCollection::setPreferredStylesheetSetName): Deleted.
(WebCore::DocumentStyleSheetCollection::setSelectedStylesheetSetName): Deleted.
(WebCore::DocumentStyleSheetCollection::addPendingSheet): Deleted.
(WebCore::DocumentStyleSheetCollection::hasPendingSheets): Deleted.
(WebCore::DocumentStyleSheetCollection::usesFirstLineRules): Deleted.
(WebCore::DocumentStyleSheetCollection::usesFirstLetterRules): Deleted.
(WebCore::DocumentStyleSheetCollection::usesRemUnits): Deleted.
(WebCore::DocumentStyleSheetCollection::setUsesRemUnit): Deleted.
(WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Deleted.
(WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Deleted.
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::insertedIntoDocument):
(WebCore::InlineStyleSheetOwner::removedFromDocument):
(WebCore::InlineStyleSheetOwner::clearDocumentData):
(WebCore::InlineStyleSheetOwner::childrenChanged):
(WebCore::InlineStyleSheetOwner::createSheet):
(WebCore::InlineStyleSheetOwner::sheetLoaded):
(WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::~ProcessingInstruction):
(WebCore::ProcessingInstruction::nodeName):
(WebCore::ProcessingInstruction::checkStyleSheet):
(WebCore::ProcessingInstruction::sheetLoaded):
(WebCore::ProcessingInstruction::insertedInto):
(WebCore::ProcessingInstruction::removedFrom):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::~HTMLLinkElement):
(WebCore::HTMLLinkElement::insertedInto):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::addPendingSheet):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLQuoteElement.cpp:
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
(WebCore::InspectorCSSAgent::buildObjectForRule):
* loader/DocumentLoader.cpp:
(WebCore::DocumentLoader::commitData):
* page/Page.cpp:
(WebCore::Page::userStyleSheetLocationChanged):
(WebCore::Page::setUserContentController):
* page/PageGroup.cpp:
* page/UserContentController.cpp:
(WebCore::UserContentController::invalidateInjectedStyleSheetCacheInAllFrames):
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::lineHeight):
(WebCore::RenderBlock::getFirstLetter):
* rendering/RenderElement.cpp:
(WebCore::RenderElement::uncachedFirstLineStyle):
(WebCore::RenderElement::cachedFirstLineStyle):
* rendering/RenderElement.h:
(WebCore::RenderElement::firstLineStyle):
(WebCore::RenderElement::setAncestorLineBoxDirty):
* rendering/RenderInline.cpp:
(WebCore::RenderInline::updateAlwaysCreateLineBoxes):
(WebCore::RenderInline::lineHeight):
* rendering/RenderLineBreak.cpp:
(WebCore::RenderLineBreak::lineHeight):
* rendering/RootInlineBox.cpp:
(WebCore::RootInlineBox::verticalPositionForBox):
* style/StyleResolveTree.cpp:
(WebCore::Style::resolveLocal):</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="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp">trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleSheetcpp">trunk/Source/WebCore/css/CSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDocumentRuleSetscpp">trunk/Source/WebCore/css/DocumentRuleSets.cpp</a></li>
<li><a href="#trunkSourceWebCorecssDocumentRuleSetsh">trunk/Source/WebCore/css/DocumentRuleSets.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="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleSheetListcpp">trunk/Source/WebCore/css/StyleSheetList.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMAllInOnecpp">trunk/Source/WebCore/dom/DOMAllInOne.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="#trunkSourceWebCoredomInlineStyleSheetOwnercpp">trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLQuoteElementcpp">trunk/Source/WebCore/html/HTMLQuoteElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreloaderDocumentLoadercpp">trunk/Source/WebCore/loader/DocumentLoader.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageGroupcpp">trunk/Source/WebCore/page/PageGroup.cpp</a></li>
<li><a href="#trunkSourceWebCorepageUserContentControllercpp">trunk/Source/WebCore/page/UserContentController.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockcpp">trunk/Source/WebCore/rendering/RenderBlock.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementcpp">trunk/Source/WebCore/rendering/RenderElement.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderElementh">trunk/Source/WebCore/rendering/RenderElement.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderInlinecpp">trunk/Source/WebCore/rendering/RenderInline.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderLineBreakcpp">trunk/Source/WebCore/rendering/RenderLineBreak.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderViewh">trunk/Source/WebCore/rendering/RenderView.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRootInlineBoxcpp">trunk/Source/WebCore/rendering/RootInlineBox.cpp</a></li>
<li><a href="#trunkSourceWebCorestyleStyleResolveTreecpp">trunk/Source/WebCore/style/StyleResolveTree.cpp</a></li>
<li><a href="#trunkSourceWebCoretestingInternalscpp">trunk/Source/WebCore/testing/Internals.cpp</a></li>
</ul>

<h3>Added 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>
<li><a href="#trunkSourceWebCoredomExtensionStyleSheetscpp">trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomExtensionStyleSheetsh">trunk/Source/WebCore/dom/ExtensionStyleSheets.h</a></li>
</ul>

<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoredomDocumentStyleSheetCollectioncpp">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumentStyleSheetCollectionh">trunk/Source/WebCore/dom/DocumentStyleSheetCollection.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 (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/CMakeLists.txt        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -1377,6 +1377,7 @@
</span><span class="cx">     dom/ActiveDOMObject.cpp
</span><span class="cx">     dom/AnimationEvent.cpp
</span><span class="cx">     dom/Attr.cpp
</span><ins>+    dom/AuthorStyleSheets.cpp
</ins><span class="cx">     dom/BeforeTextInsertedEvent.cpp
</span><span class="cx">     dom/BeforeUnloadEvent.cpp
</span><span class="cx">     dom/CDATASection.cpp
</span><span class="lines">@@ -1418,7 +1419,6 @@
</span><span class="cx">     dom/DocumentOrderedMap.cpp
</span><span class="cx">     dom/DocumentParser.cpp
</span><span class="cx">     dom/DocumentSharedObjectPool.cpp
</span><del>-    dom/DocumentStyleSheetCollection.cpp
</del><span class="cx">     dom/DocumentType.cpp
</span><span class="cx">     dom/Element.cpp
</span><span class="cx">     dom/ElementData.cpp
</span><span class="lines">@@ -1434,6 +1434,7 @@
</span><span class="cx">     dom/EventTarget.cpp
</span><span class="cx">     dom/ExceptionBase.cpp
</span><span class="cx">     dom/ExceptionCodePlaceholder.cpp
</span><ins>+    dom/ExtensionStyleSheets.cpp
</ins><span class="cx">     dom/FocusEvent.cpp
</span><span class="cx">     dom/GenericEventQueue.cpp
</span><span class="cx">     dom/IdTargetObserver.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/ChangeLog        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -1,3 +1,211 @@
</span><ins>+2015-09-22  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        Split author style code out from DocumentStyleSheetCollection
+        https://bugs.webkit.org/show_bug.cgi?id=149446
+
+        Reviewed by Andreas Kling.
+
+        Shadow trees may have their own author style. Factor the related code out so we can use
+        it outside the document context.
+
+        DocumentStyleSheetCollection is replaced by two classes:
+
+        AuthorStyleSheets - author stylesheets and mutation optimization code
+        ExtensionStyleSheets - user stylesheets, injected author stylesheets, content extension stylesheets
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * contentextensions/ContentExtensionsBackend.cpp:
+        (WebCore::ContentExtensions::ContentExtensionsBackend::processContentExtensionRulesForLoad):
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::didMutateRules):
+        * css/DocumentRuleSets.cpp:
+        (WebCore::DocumentRuleSets::~DocumentRuleSets):
+        (WebCore::DocumentRuleSets::initUserStyle):
+        * css/DocumentRuleSets.h:
+        (WebCore::DocumentRuleSets::sibling):
+        (WebCore::DocumentRuleSets::uncommonAttribute):
+        * css/InspectorCSSOMWrappers.cpp:
+        (WebCore::InspectorCSSOMWrappers::collectFromStyleSheets):
+        (WebCore::InspectorCSSOMWrappers::getWrapperForRuleInSheets):
+        (WebCore::InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection): Deleted.
+        * css/InspectorCSSOMWrappers.h:
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::StyleResolver):
+        (WebCore::StyleResolver::appendAuthorStyleSheets):
+        * css/StyleSheetList.cpp:
+        (WebCore::StyleSheetList::styleSheets):
+        (WebCore::StyleSheetList::detachFromDocument):
+        (WebCore::StyleSheetList::length):
+        * dom/AuthorStyleSheets.cpp: Added.
+        (WebCore::AuthorStyleSheets::AuthorStyleSheets):
+        (WebCore::AuthorStyleSheets::combineCSSFeatureFlags):
+        (WebCore::AuthorStyleSheets::resetCSSFeatureFlags):
+        (WebCore::AuthorStyleSheets::addAuthorSheet):
+        (WebCore::AuthorStyleSheets::removePendingSheet):
+        (WebCore::AuthorStyleSheets::addStyleSheetCandidateNode):
+        (WebCore::AuthorStyleSheets::removeStyleSheetCandidateNode):
+        (WebCore::AuthorStyleSheets::collectActiveStyleSheets):
+        (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
+        (WebCore::filterEnabledNonemptyCSSStyleSheets):
+        (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
+        (WebCore::AuthorStyleSheets::activeStyleSheetsForInspector):
+        (WebCore::AuthorStyleSheets::activeStyleSheetsContains):
+        (WebCore::AuthorStyleSheets::detachFromDocument):
+        * dom/AuthorStyleSheets.h: Added.
+        (WebCore::AuthorStyleSheets::activeStyleSheets):
+        (WebCore::AuthorStyleSheets::styleSheets):
+        (WebCore::AuthorStyleSheets::styleSheetsForStyleSheetList):
+        (WebCore::AuthorStyleSheets::pendingUpdateType):
+        (WebCore::AuthorStyleSheets::setPendingUpdateType):
+        (WebCore::AuthorStyleSheets::flushPendingUpdates):
+        (WebCore::AuthorStyleSheets::preferredStylesheetSetName):
+        (WebCore::AuthorStyleSheets::selectedStylesheetSetName):
+        (WebCore::AuthorStyleSheets::setPreferredStylesheetSetName):
+        (WebCore::AuthorStyleSheets::setSelectedStylesheetSetName):
+        (WebCore::AuthorStyleSheets::addPendingSheet):
+        (WebCore::AuthorStyleSheets::hasPendingSheets):
+        (WebCore::AuthorStyleSheets::usesFirstLineRules):
+        (WebCore::AuthorStyleSheets::usesFirstLetterRules):
+        (WebCore::AuthorStyleSheets::usesRemUnits):
+        (WebCore::AuthorStyleSheets::setUsesRemUnit):
+        (WebCore::AuthorStyleSheets::usesStyleBasedEditability):
+        (WebCore::AuthorStyleSheets::setUsesStyleBasedEditability):
+        * dom/Document.cpp:
+        (WebCore::Document::Document):
+        (WebCore::Document::~Document):
+        (WebCore::Document::setCompatibilityMode):
+        (WebCore::Document::recalcStyle):
+        (WebCore::Document::createStyleResolver):
+        (WebCore::Document::fontsNeedUpdate):
+        (WebCore::Document::usesStyleBasedEditability):
+        (WebCore::Document::processHttpEquiv):
+        (WebCore::Document::preferredStylesheetSet):
+        (WebCore::Document::selectedStylesheetSet):
+        (WebCore::Document::setSelectedStylesheetSet):
+        (WebCore::Document::scheduleOptimizedStyleSheetUpdate):
+        (WebCore::Document::styleResolverChanged):
+        (WebCore::Document::haveStylesheetsLoaded):
+        (WebCore::Document::getCachedLocale):
+        * dom/Document.h:
+        (WebCore::Document::authorStyleSheets):
+        (WebCore::Document::extensionStyleSheets):
+        (WebCore::Document::gotoAnchorNeededAfterStylesheetsLoad):
+        (WebCore::Document::setGotoAnchorNeededAfterStylesheetsLoad):
+        (WebCore::Document::styleSheetCollection): Deleted.
+        * dom/DocumentStyleSheetCollection.cpp: Removed.
+        * dom/DocumentStyleSheetCollection.h: Removed.
+        * dom/ExtensionStyleSheets.cpp: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.cpp.
+        (WebCore::ExtensionStyleSheets::ExtensionStyleSheets):
+        (WebCore::ExtensionStyleSheets::pageUserSheet):
+        (WebCore::ExtensionStyleSheets::clearPageUserSheet):
+        (WebCore::ExtensionStyleSheets::updatePageUserSheet):
+        (WebCore::ExtensionStyleSheets::injectedUserStyleSheets):
+        (WebCore::ExtensionStyleSheets::injectedAuthorStyleSheets):
+        (WebCore::ExtensionStyleSheets::updateInjectedStyleSheetCache):
+        (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
+        (WebCore::ExtensionStyleSheets::addUserSheet):
+        (WebCore::ExtensionStyleSheets::addDisplayNoneSelector):
+        (WebCore::ExtensionStyleSheets::maybeAddContentExtensionSheet):
+        (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
+        (WebCore::ExtensionStyleSheets::detachFromDocument):
+        (WebCore::DocumentStyleSheetCollection::DocumentStyleSheetCollection): Deleted.
+        (WebCore::DocumentStyleSheetCollection::combineCSSFeatureFlags): Deleted.
+        (WebCore::DocumentStyleSheetCollection::resetCSSFeatureFlags): Deleted.
+        (WebCore::DocumentStyleSheetCollection::pageUserSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::clearPageUserSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::updatePageUserSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::injectedUserStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::injectedAuthorStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::updateInjectedStyleSheetCache): Deleted.
+        (WebCore::DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache): Deleted.
+        (WebCore::DocumentStyleSheetCollection::addAuthorSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::addUserSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::addDisplayNoneSelector): Deleted.
+        (WebCore::DocumentStyleSheetCollection::maybeAddContentExtensionSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::styleResolverChangedTimerFired): Deleted.
+        (WebCore::DocumentStyleSheetCollection::removePendingSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::addStyleSheetCandidateNode): Deleted.
+        (WebCore::DocumentStyleSheetCollection::removeStyleSheetCandidateNode): Deleted.
+        (WebCore::DocumentStyleSheetCollection::collectActiveStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::analyzeStyleSheetChange): Deleted.
+        (WebCore::filterEnabledNonemptyCSSStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::updateActiveStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::activeStyleSheetsForInspector): Deleted.
+        (WebCore::DocumentStyleSheetCollection::activeStyleSheetsContains): Deleted.
+        (WebCore::DocumentStyleSheetCollection::detachFromDocument): Deleted.
+        * dom/ExtensionStyleSheets.h: Copied from Source/WebCore/dom/DocumentStyleSheetCollection.h.
+        (WebCore::ExtensionStyleSheets::documentUserStyleSheets):
+        (WebCore::DocumentStyleSheetCollection::styleSheetsForStyleSheetList): Deleted.
+        (WebCore::DocumentStyleSheetCollection::activeAuthorStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::documentUserStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::documentAuthorStyleSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::pendingUpdateType): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setPendingUpdateType): Deleted.
+        (WebCore::DocumentStyleSheetCollection::flushPendingUpdates): Deleted.
+        (WebCore::DocumentStyleSheetCollection::preferredStylesheetSetName): Deleted.
+        (WebCore::DocumentStyleSheetCollection::selectedStylesheetSetName): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setPreferredStylesheetSetName): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setSelectedStylesheetSetName): Deleted.
+        (WebCore::DocumentStyleSheetCollection::addPendingSheet): Deleted.
+        (WebCore::DocumentStyleSheetCollection::hasPendingSheets): Deleted.
+        (WebCore::DocumentStyleSheetCollection::usesFirstLineRules): Deleted.
+        (WebCore::DocumentStyleSheetCollection::usesFirstLetterRules): Deleted.
+        (WebCore::DocumentStyleSheetCollection::usesRemUnits): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setUsesRemUnit): Deleted.
+        (WebCore::DocumentStyleSheetCollection::usesStyleBasedEditability): Deleted.
+        (WebCore::DocumentStyleSheetCollection::setUsesStyleBasedEditability): Deleted.
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::insertedIntoDocument):
+        (WebCore::InlineStyleSheetOwner::removedFromDocument):
+        (WebCore::InlineStyleSheetOwner::clearDocumentData):
+        (WebCore::InlineStyleSheetOwner::childrenChanged):
+        (WebCore::InlineStyleSheetOwner::createSheet):
+        (WebCore::InlineStyleSheetOwner::sheetLoaded):
+        (WebCore::InlineStyleSheetOwner::startLoadingDynamicSheet):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::~ProcessingInstruction):
+        (WebCore::ProcessingInstruction::nodeName):
+        (WebCore::ProcessingInstruction::checkStyleSheet):
+        (WebCore::ProcessingInstruction::sheetLoaded):
+        (WebCore::ProcessingInstruction::insertedInto):
+        (WebCore::ProcessingInstruction::removedFrom):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::~HTMLLinkElement):
+        (WebCore::HTMLLinkElement::insertedInto):
+        (WebCore::HTMLLinkElement::removedFrom):
+        (WebCore::HTMLLinkElement::addPendingSheet):
+        (WebCore::HTMLLinkElement::removePendingSheet):
+        * html/HTMLQuoteElement.cpp:
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::collectAllDocumentStyleSheets):
+        (WebCore::InspectorCSSAgent::buildObjectForRule):
+        * loader/DocumentLoader.cpp:
+        (WebCore::DocumentLoader::commitData):
+        * page/Page.cpp:
+        (WebCore::Page::userStyleSheetLocationChanged):
+        (WebCore::Page::setUserContentController):
+        * page/PageGroup.cpp:
+        * page/UserContentController.cpp:
+        (WebCore::UserContentController::invalidateInjectedStyleSheetCacheInAllFrames):
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::lineHeight):
+        (WebCore::RenderBlock::getFirstLetter):
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::uncachedFirstLineStyle):
+        (WebCore::RenderElement::cachedFirstLineStyle):
+        * rendering/RenderElement.h:
+        (WebCore::RenderElement::firstLineStyle):
+        (WebCore::RenderElement::setAncestorLineBoxDirty):
+        * rendering/RenderInline.cpp:
+        (WebCore::RenderInline::updateAlwaysCreateLineBoxes):
+        (WebCore::RenderInline::lineHeight):
+        * rendering/RenderLineBreak.cpp:
+        (WebCore::RenderLineBreak::lineHeight):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::verticalPositionForBox):
+        * style/StyleResolveTree.cpp:
+        (WebCore::Style::resolveLocal):
+
</ins><span class="cx"> 2015-09-23  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         HTMLOutputElement.htmlFor should be settable
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -13525,6 +13525,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dom\AuthorStyleSheets.cpp&quot;&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dom\BeforeTextInsertedEvent.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -14001,20 +14015,6 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><del>-    &lt;ClCompile Include=&quot;..\dom\DocumentStyleSheetCollection.cpp&quot;&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
-    &lt;/ClCompile&gt;
</del><span class="cx">     &lt;ClCompile Include=&quot;..\dom\DocumentType.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -14296,6 +14296,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\dom\ExtensionStyleSheets.cpp&quot;&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+        &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\dom\GenericEventQueue.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="lines">@@ -21970,6 +21984,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\AnimationEvent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\Attr.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\Attribute.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dom\AuthorStyleSheets.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dom\BeforeLoadEvent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\BeforeTextInsertedEvent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\BeforeUnloadEvent.h&quot; /&gt;
</span><span class="lines">@@ -22009,7 +22024,6 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DocumentOrderedMap.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DocumentParser.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DocumentSharedObjectPool.h&quot; /&gt;
</span><del>-    &lt;ClInclude Include=&quot;..\dom\DocumentStyleSheetCollection.h&quot; /&gt;
</del><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DocumentTiming.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DocumentType.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\DOMCoreException.h&quot; /&gt;
</span><span class="lines">@@ -22043,6 +22057,7 @@
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\ExceptionBase.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\ExceptionCode.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\ExceptionCodePlaceholder.h&quot; /&gt;
</span><ins>+    &lt;ClInclude Include=&quot;..\dom\ExtensionStyleSheets.h&quot; /&gt;
</ins><span class="cx">     &lt;ClInclude Include=&quot;..\dom\GenericEventQueue.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\HashChangeEvent.h&quot; /&gt;
</span><span class="cx">     &lt;ClInclude Include=&quot;..\dom\IconURL.h&quot; /&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -6381,6 +6381,8 @@
</span><span class="cx">                 E45390490EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */; };
</span><span class="cx">                 E453904D0EAFD637003695C8 /* WidgetIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = E453903C0EAFD637003695C8 /* WidgetIOS.mm */; };
</span><span class="cx">                 E45390AE0EAFF4B5003695C8 /* SystemMemoryIOS.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */; };
</span><ins>+                E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */; settings = {ASSET_TAGS = (); }; };
+                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; settings = {ASSET_TAGS = (); }; };
</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">@@ -6390,8 +6392,8 @@
</span><span class="cx">                 E4778B80115A581A00B5D372 /* JSCustomEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E4778B7E115A581A00B5D372 /* JSCustomEvent.h */; };
</span><span class="cx">                 E47B4BE80E71241600038854 /* CachedResourceHandle.h in Headers */ = {isa = PBXBuildFile; fileRef = E47B4BE60E71241600038854 /* CachedResourceHandle.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E47B4BE90E71241600038854 /* CachedResourceHandle.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */; };
</span><del>-                E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */; settings = {ATTRIBUTES = (Private, ); }; };
-                E47E276816036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47E276716036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp */; };
</del><ins>+                E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; };
+                E47E276816036EDC00EE2AFB /* ExtensionStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */; };
</ins><span class="cx">                 E48944A2180B57D800F165D8 /* SimpleLineLayout.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */; };
</span><span class="cx">                 E48944A3180B57D800F165D8 /* SimpleLineLayout.h in Headers */ = {isa = PBXBuildFile; fileRef = E48944A1180B57D800F165D8 /* SimpleLineLayout.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E4916FF7195DF6A0005AB349 /* LayerFlushThrottleState.h in Headers */ = {isa = PBXBuildFile; fileRef = E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -14132,6 +14134,8 @@
</span><span class="cx">                 E45390380EAFD637003695C8 /* WebCoreSystemInterfaceIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreSystemInterfaceIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E453903C0EAFD637003695C8 /* WidgetIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WidgetIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E45390AD0EAFF4B5003695C8 /* SystemMemoryIOS.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SystemMemoryIOS.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AuthorStyleSheets.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AuthorStyleSheets.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E462A4A0113E71BE004A4220 /* IntPointHash.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntPointHash.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E46A2B1B17CA65B9000DBCD8 /* TypedElementDescendantIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TypedElementDescendantIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E46A2B1D17CA76B1000DBCD8 /* ElementChildIterator.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ElementChildIterator.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -14141,8 +14145,8 @@
</span><span class="cx">                 E47A97CF163059FC005DCD99 /* StyleInvalidationAnalysis.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleInvalidationAnalysis.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E47B4BE60E71241600038854 /* CachedResourceHandle.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CachedResourceHandle.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E47B4BE70E71241600038854 /* CachedResourceHandle.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CachedResourceHandle.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><del>-                E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DocumentStyleSheetCollection.h; sourceTree = &quot;&lt;group&gt;&quot;; };
-                E47E276716036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DocumentStyleSheetCollection.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</del><ins>+                E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ExtensionStyleSheets.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ExtensionStyleSheets.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E48944A0180B57D800F165D8 /* SimpleLineLayout.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SimpleLineLayout.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E48944A1180B57D800F165D8 /* SimpleLineLayout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SimpleLineLayout.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E4916FF6195DF6A0005AB349 /* LayerFlushThrottleState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LayerFlushThrottleState.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23285,6 +23289,8 @@
</span><span class="cx">                                 A8C4A7FB09D563270003AC8D /* Attr.h */,
</span><span class="cx">                                 93EEC1E509C2877700C515D1 /* Attr.idl */,
</span><span class="cx">                                 A8C4A7F909D563270003AC8D /* Attribute.h */,
</span><ins>+                                E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */,
+                                E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */,
</ins><span class="cx">                                 760847CD19A6A27700428CCC /* AutocompleteErrorEvent.h */,
</span><span class="cx">                                 760847CF19A6A28600428CCC /* AutocompleteErrorEvent.idl */,
</span><span class="cx">                                 BC9462D7107A7B4C00857193 /* BeforeLoadEvent.h */,
</span><span class="lines">@@ -23380,8 +23386,6 @@
</span><span class="cx">                                 BCCFBAE70B5152ED0001F1D7 /* DocumentParser.h */,
</span><span class="cx">                                 AD6E71AA1668899D00320C13 /* DocumentSharedObjectPool.cpp */,
</span><span class="cx">                                 AD6E71AB1668899D00320C13 /* DocumentSharedObjectPool.h */,
</span><del>-                                E47E276716036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp */,
-                                E47E276416036ED200EE2AFB /* DocumentStyleSheetCollection.h */,
</del><span class="cx">                                 86D982F6125C154000AD9E3D /* DocumentTiming.h */,
</span><span class="cx">                                 A8185F3209765765005826D9 /* DocumentType.cpp */,
</span><span class="cx">                                 A8185F3109765765005826D9 /* DocumentType.h */,
</span><span class="lines">@@ -23455,6 +23459,8 @@
</span><span class="cx">                                 935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
</span><span class="cx">                                 A7CACDB013CE875B00BBBE3F /* ExceptionCodePlaceholder.cpp */,
</span><span class="cx">                                 A74BB76A13BDA86300FF7BF0 /* ExceptionCodePlaceholder.h */,
</span><ins>+                                E47E276716036EDC00EE2AFB /* ExtensionStyleSheets.cpp */,
+                                E47E276416036ED200EE2AFB /* ExtensionStyleSheets.h */,
</ins><span class="cx">                                 B6D9D23414EABD260090D75E /* FocusEvent.cpp */,
</span><span class="cx">                                 B6D9D23314EABD260090D75E /* FocusEvent.h */,
</span><span class="cx">                                 B6D9D27214EABF030090D75E /* FocusEvent.idl */,
</span><span class="lines">@@ -24629,7 +24635,7 @@
</span><span class="cx">                                 BCCFBAE80B5152ED0001F1D7 /* DocumentParser.h in Headers */,
</span><span class="cx">                                 4A4F48AA16B0DFC000EDBB29 /* DocumentRuleSets.h in Headers */,
</span><span class="cx">                                 AD6E71AD1668899D00320C13 /* DocumentSharedObjectPool.h in Headers */,
</span><del>-                                E47E276516036ED200EE2AFB /* DocumentStyleSheetCollection.h in Headers */,
</del><ins>+                                E47E276516036ED200EE2AFB /* ExtensionStyleSheets.h in Headers */,
</ins><span class="cx">                                 0B90561A0F2578BF0095FF6A /* DocumentThreadableLoader.h in Headers */,
</span><span class="cx">                                 86D982F7125C154000AD9E3D /* DocumentTiming.h in Headers */,
</span><span class="cx">                                 A8185F3909765766005826D9 /* DocumentType.h in Headers */,
</span><span class="lines">@@ -26831,6 +26837,7 @@
</span><span class="cx">                                 99CC0B5E18BE984A006CEBCC /* SegmentedInputStorage.h in Headers */,
</span><span class="cx">                                 B2C3DA2F0D006C1D00EF6F26 /* SegmentedString.h in Headers */,
</span><span class="cx">                                 BEA807C90F714A0300524199 /* SelectionRect.h in Headers */,
</span><ins>+                                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */,
</ins><span class="cx">                                 51405C89190B014400754F94 /* SelectionRectGatherer.h in Headers */,
</span><span class="cx">                                 CDCFABBD18C0AF78006F8450 /* SelectionSubtreeRoot.h in Headers */,
</span><span class="cx">                                 E44B4BB4141650D7002B1D8B /* SelectorChecker.h in Headers */,
</span><span class="lines">@@ -28385,7 +28392,7 @@
</span><span class="cx">                                 A8C2280E11D4A59700D5A7D3 /* DocumentParser.cpp in Sources */,
</span><span class="cx">                                 4A4F48A916B0DFC000EDBB29 /* DocumentRuleSets.cpp in Sources */,
</span><span class="cx">                                 AD6E71AC1668899D00320C13 /* DocumentSharedObjectPool.cpp in Sources */,
</span><del>-                                E47E276816036EDC00EE2AFB /* DocumentStyleSheetCollection.cpp in Sources */,
</del><ins>+                                E47E276816036EDC00EE2AFB /* ExtensionStyleSheets.cpp in Sources */,
</ins><span class="cx">                                 0B9056190F2578BE0095FF6A /* DocumentThreadableLoader.cpp in Sources */,
</span><span class="cx">                                 A8185F3A09765766005826D9 /* DocumentType.cpp in Sources */,
</span><span class="cx">                                 973889A0116EA9DC00ADF313 /* DocumentWriter.cpp in Sources */,
</span><span class="lines">@@ -28490,6 +28497,7 @@
</span><span class="cx">                                 85ECBEF80AA7626900544F0B /* DOMHTMLParamElement.mm in Sources */,
</span><span class="cx">                                 7C33F3621B4A050400502CAF /* JSDocumentFragmentCustom.cpp in Sources */,
</span><span class="cx">                                 85183B490AA6926100F19FA3 /* DOMHTMLPreElement.mm in Sources */,
</span><ins>+                                E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */,
</ins><span class="cx">                                 A4226E961163D73A008B8397 /* DOMHTMLProgressElement.mm in Sources */,
</span><span class="cx">                                 85183B4B0AA6926100F19FA3 /* DOMHTMLQuoteElement.mm in Sources */,
</span><span class="cx">                                 85DF819C0AA77E4B00486AD7 /* DOMHTMLScriptElement.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecontentextensionsContentExtensionsBackendcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/contentextensions/ContentExtensionsBackend.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -34,6 +34,7 @@
</span><span class="cx"> #include &quot;DFABytecodeInterpreter.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><span class="cx"> #include &quot;DocumentLoader.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadInfo.h&quot;
</span><span class="lines">@@ -176,7 +177,7 @@
</span><span class="cx">             if (resourceType == ResourceType::Document)
</span><span class="cx">                 initiatingDocumentLoader.addPendingContentExtensionDisplayNoneSelector(action.extensionIdentifier(), action.stringArgument(), action.actionID());
</span><span class="cx">             else if (currentDocument)
</span><del>-                currentDocument-&gt;styleSheetCollection().addDisplayNoneSelector(action.extensionIdentifier(), action.stringArgument(), action.actionID());
</del><ins>+                currentDocument-&gt;extensionStyleSheets().addDisplayNoneSelector(action.extensionIdentifier(), action.stringArgument(), action.actionID());
</ins><span class="cx">             break;
</span><span class="cx">         case ContentExtensions::ActionType::CSSDisplayNoneStyleSheet: {
</span><span class="cx">             StyleSheetContents* styleSheetContents = globalDisplayNoneStyleSheet(action.stringArgument());
</span><span class="lines">@@ -184,7 +185,7 @@
</span><span class="cx">                 if (resourceType == ResourceType::Document)
</span><span class="cx">                     initiatingDocumentLoader.addPendingContentExtensionSheet(action.stringArgument(), *styleSheetContents);
</span><span class="cx">                 else if (currentDocument)
</span><del>-                    currentDocument-&gt;styleSheetCollection().maybeAddContentExtensionSheet(action.stringArgument(), *styleSheetContents);
</del><ins>+                    currentDocument-&gt;extensionStyleSheets().maybeAddContentExtensionSheet(action.stringArgument(), *styleSheetContents);
</ins><span class="cx">             }
</span><span class="cx">             break;
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSCharsetRule.h&quot;
</span><span class="cx"> #include &quot;CSSFontFaceRule.h&quot;
</span><span class="cx"> #include &quot;CSSImportRule.h&quot;
</span><span class="lines">@@ -30,8 +31,8 @@
</span><span class="cx"> #include &quot;CSSStyleRule.h&quot;
</span><span class="cx"> #include &quot;CachedCSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLStyleElement.h&quot;
</span><span class="cx"> #include &quot;MediaList.h&quot;
</span><span class="lines">@@ -170,7 +171,7 @@
</span><span class="cx">     if (!owner)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (mutationType == RuleInsertion &amp;&amp; !contentsWereClonedForMutation &amp;&amp; !owner-&gt;styleSheetCollection().activeStyleSheetsContains(this)) {
</del><ins>+    if (mutationType == RuleInsertion &amp;&amp; !contentsWereClonedForMutation &amp;&amp; !owner-&gt;authorStyleSheets().activeStyleSheetsContains(this)) {
</ins><span class="cx">         if (insertedKeyframesRule) {
</span><span class="cx">             if (StyleResolver* resolver = owner-&gt;styleResolverIfExists())
</span><span class="cx">                 resolver-&gt;addKeyframeStyle(insertedKeyframesRule);
</span></span></pre></div>
<a id="trunkSourceWebCorecssDocumentRuleSetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DocumentRuleSets.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DocumentRuleSets.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/DocumentRuleSets.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -31,7 +31,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSDefaultStyleSheets.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;MediaQueryEvaluator.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="lines">@@ -46,13 +46,13 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void DocumentRuleSets::initUserStyle(DocumentStyleSheetCollection&amp; styleSheetCollection, const MediaQueryEvaluator&amp; medium, StyleResolver&amp; resolver)
</del><ins>+void DocumentRuleSets::initUserStyle(ExtensionStyleSheets&amp; extensionStyleSheets, const MediaQueryEvaluator&amp; medium, StyleResolver&amp; resolver)
</ins><span class="cx"> {
</span><span class="cx">     auto tempUserStyle = std::make_unique&lt;RuleSet&gt;();
</span><del>-    if (CSSStyleSheet* pageUserSheet = styleSheetCollection.pageUserSheet())
</del><ins>+    if (CSSStyleSheet* pageUserSheet = extensionStyleSheets.pageUserSheet())
</ins><span class="cx">         tempUserStyle-&gt;addRulesFromSheet(&amp;pageUserSheet-&gt;contents(), medium, &amp;resolver);
</span><del>-    collectRulesFromUserStyleSheets(styleSheetCollection.injectedUserStyleSheets(), *tempUserStyle, medium, resolver);
-    collectRulesFromUserStyleSheets(styleSheetCollection.documentUserStyleSheets(), *tempUserStyle, medium, resolver);
</del><ins>+    collectRulesFromUserStyleSheets(extensionStyleSheets.injectedUserStyleSheets(), *tempUserStyle, medium, resolver);
+    collectRulesFromUserStyleSheets(extensionStyleSheets.documentUserStyleSheets(), *tempUserStyle, medium, resolver);
</ins><span class="cx">     if (tempUserStyle-&gt;ruleCount() &gt; 0 || tempUserStyle-&gt;pageRules().size() &gt; 0)
</span><span class="cx">         m_userStyle = WTF::move(tempUserStyle);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssDocumentRuleSetsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/DocumentRuleSets.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/DocumentRuleSets.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/DocumentRuleSets.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">     RuleSet* sibling() const { return m_siblingRuleSet.get(); }
</span><span class="cx">     RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get(); }
</span><span class="cx"> 
</span><del>-    void initUserStyle(DocumentStyleSheetCollection&amp;, const MediaQueryEvaluator&amp;, StyleResolver&amp;);
</del><ins>+    void initUserStyle(ExtensionStyleSheets&amp;, const MediaQueryEvaluator&amp;, StyleResolver&amp;);
</ins><span class="cx">     void resetAuthorStyle();
</span><span class="cx">     void appendAuthorStyleSheets(unsigned firstNew, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp;, MediaQueryEvaluator*, InspectorCSSOMWrappers&amp;, StyleResolver*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssInspectorCSSOMWrapperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/InspectorCSSOMWrappers.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;InspectorCSSOMWrappers.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSDefaultStyleSheets.h&quot;
</span><span class="cx"> #include &quot;CSSImportRule.h&quot;
</span><span class="cx"> #include &quot;CSSMediaRule.h&quot;
</span><span class="lines">@@ -36,7 +37,7 @@
</span><span class="cx"> #include &quot;CSSStyleRule.h&quot;
</span><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CSSSupportsRule.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;StyleSheetContents.h&quot;
</span><span class="cx"> #include &quot;WebKitCSSRegionRule.h&quot;
</span><span class="cx"> 
</span><span class="lines">@@ -95,16 +96,8 @@
</span><span class="cx">         collect(sheets[i].get());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void InspectorCSSOMWrappers::collectFromDocumentStyleSheetCollection(DocumentStyleSheetCollection&amp; styleSheetCollection)
</del><ins>+CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, AuthorStyleSheets&amp; authorStyleSheets, ExtensionStyleSheets&amp; extensionStyleSheets)
</ins><span class="cx"> {
</span><del>-    collectFromStyleSheets(styleSheetCollection.activeAuthorStyleSheets());
-    collect(styleSheetCollection.pageUserSheet());
-    collectFromStyleSheets(styleSheetCollection.injectedUserStyleSheets());
-    collectFromStyleSheets(styleSheetCollection.documentUserStyleSheets());
-}
-
-CSSStyleRule* InspectorCSSOMWrappers::getWrapperForRuleInSheets(StyleRule* rule, DocumentStyleSheetCollection&amp; styleSheetCollection)
-{
</del><span class="cx">     if (m_styleRuleToCSSOMWrapperMap.isEmpty()) {
</span><span class="cx">         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::simpleDefaultStyleSheet);
</span><span class="cx">         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::defaultStyleSheet);
</span><span class="lines">@@ -115,7 +108,10 @@
</span><span class="cx">         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::fullscreenStyleSheet);
</span><span class="cx">         collectFromStyleSheetContents(m_styleSheetCSSOMWrapperSet, CSSDefaultStyleSheets::plugInsStyleSheet);
</span><span class="cx"> 
</span><del>-        collectFromDocumentStyleSheetCollection(styleSheetCollection);
</del><ins>+        collectFromStyleSheets(authorStyleSheets.activeStyleSheets());
+        collect(extensionStyleSheets.pageUserSheet());
+        collectFromStyleSheets(extensionStyleSheets.injectedUserStyleSheets());
+        collectFromStyleSheets(extensionStyleSheets.documentUserStyleSheets());
</ins><span class="cx">     }
</span><span class="cx">     return m_styleRuleToCSSOMWrapperMap.get(rule);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssInspectorCSSOMWrappersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/InspectorCSSOMWrappers.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/InspectorCSSOMWrappers.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/InspectorCSSOMWrappers.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -31,9 +31,10 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+class AuthorStyleSheets;
</ins><span class="cx"> class CSSStyleRule;
</span><span class="cx"> class CSSStyleSheet;
</span><del>-class DocumentStyleSheetCollection;
</del><ins>+class ExtensionStyleSheets;
</ins><span class="cx"> class StyleRule;
</span><span class="cx"> class StyleSheetContents;
</span><span class="cx"> 
</span><span class="lines">@@ -41,7 +42,7 @@
</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*, DocumentStyleSheetCollection&amp;);
</del><ins>+    CSSStyleRule* getWrapperForRuleInSheets(StyleRule*, AuthorStyleSheets&amp;, ExtensionStyleSheets&amp;);
</ins><span class="cx">     void collectFromStyleSheetIfNeeded(CSSStyleSheet*);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><span class="lines">@@ -50,7 +51,6 @@
</span><span class="cx"> 
</span><span class="cx">     void collectFromStyleSheetContents(HashSet&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; sheetWrapperSet, StyleSheetContents*);
</span><span class="cx">     void collectFromStyleSheets(const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp;);
</span><del>-    void collectFromDocumentStyleSheetCollection(DocumentStyleSheetCollection&amp;);
</del><span class="cx"> 
</span><span class="cx">     HashMap&lt;StyleRule*, RefPtr&lt;CSSStyleRule&gt;&gt; m_styleRuleToCSSOMWrapperMap;
</span><span class="cx">     HashSet&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_styleSheetCSSOMWrapperSet;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -64,7 +64,6 @@
</span><span class="cx"> #include &quot;Counter.h&quot;
</span><span class="cx"> #include &quot;CounterContent.h&quot;
</span><span class="cx"> #include &quot;CursorList.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;ElementRuleCollector.h&quot;
</span><span class="cx"> #include &quot;FilterOperation.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="lines">@@ -301,8 +300,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_ruleSets.resetAuthorStyle();
</span><span class="cx"> 
</span><del>-    DocumentStyleSheetCollection&amp; styleSheetCollection = m_document.styleSheetCollection();
-    m_ruleSets.initUserStyle(styleSheetCollection, *m_medium, *this);
</del><ins>+    m_ruleSets.initUserStyle(m_document.extensionStyleSheets(), *m_medium, *this);
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx">     if (m_document.svgExtensions()) {
</span><span class="lines">@@ -311,8 +309,6 @@
</span><span class="cx">             m_document.fontSelector().addFontFaceRule(svgFontFaceElement-&gt;fontFaceRule(), svgFontFaceElement-&gt;isInUserAgentShadowTree());
</span><span class="cx">     }
</span><span class="cx"> #endif
</span><del>-
-    appendAuthorStyleSheets(0, styleSheetCollection.activeAuthorStyleSheets());
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void StyleResolver::appendAuthorStyleSheets(unsigned firstNew, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; styleSheets)
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleSheetListcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleSheetList.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleSheetList.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/css/StyleSheetList.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -21,9 +21,9 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;StyleSheetList.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> #include &quot;HTMLStyleElement.h&quot;
</span><span class="cx"> #include &lt;wtf/text/WTFString.h&gt;
</span><span class="lines">@@ -45,13 +45,13 @@
</span><span class="cx"> {
</span><span class="cx">     if (!m_document)
</span><span class="cx">         return m_detachedStyleSheets;
</span><del>-    return m_document-&gt;styleSheetCollection().styleSheetsForStyleSheetList();
</del><ins>+    return m_document-&gt;authorStyleSheets().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-&gt;styleSheetCollection().styleSheetsForStyleSheetList();
-    m_document = 0;
</del><ins>+    m_detachedStyleSheets = m_document-&gt;authorStyleSheets().styleSheetsForStyleSheetList();
+    m_document = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> unsigned StyleSheetList::length() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetscppfromrev190153trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/AuthorStyleSheets.cpp (from rev 190153, trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp) (0 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.cpp                                (rev 0)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -0,0 +1,363 @@
</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 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 &quot;config.h&quot;
+#include &quot;AuthorStyleSheets.h&quot;
+
+#include &quot;CSSStyleSheet.h&quot;
+#include &quot;Element.h&quot;
+#include &quot;ExtensionStyleSheets.h&quot;
+#include &quot;HTMLIFrameElement.h&quot;
+#include &quot;HTMLLinkElement.h&quot;
+#include &quot;HTMLStyleElement.h&quot;
+#include &quot;InspectorInstrumentation.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;PageGroup.h&quot;
+#include &quot;ProcessingInstruction.h&quot;
+#include &quot;SVGNames.h&quot;
+#include &quot;SVGStyleElement.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;StyleInvalidationAnalysis.h&quot;
+#include &quot;StyleResolver.h&quot;
+#include &quot;StyleSheetContents.h&quot;
+#include &quot;StyleSheetList.h&quot;
+#include &quot;UserContentController.h&quot;
+#include &quot;UserContentURLPattern.h&quot;
+#include &quot;UserStyleSheet.h&quot;
+
+namespace WebCore {
+
+using namespace ContentExtensions;
+using namespace HTMLNames;
+
+AuthorStyleSheets::AuthorStyleSheets(TreeScope&amp; treeScope)
+    : m_document(treeScope.documentScope())
+{
+}
+
+// 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 &gt; 0);
+
+    m_pendingStyleSheetCount--;
+    
+#ifdef INSTRUMENT_LAYOUT_SCHEDULING
+    if (!ownerElement())
+        printf(&quot;Stylesheet loaded at time %d. %d stylesheets still remain.\n&quot;, elapsedTime(), m_pendingStylesheets);
+#endif
+
+    if (m_pendingStyleSheetCount)
+        return;
+
+    if (notification == RemovePendingSheetNotifyLater) {
+        m_document.setNeedsNotifyRemoveAllPendingStylesheet();
+        return;
+    }
+    
+    m_document.didRemoveAllPendingStylesheet();
+}
+
+void AuthorStyleSheets::addStyleSheetCandidateNode(Node&amp; node, bool createdByParser)
+{
+    if (!node.inDocument())
+        return;
+    
+    // Until the &lt;body&gt; 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 &amp;&amp; m_document.bodyOrFrameset()) || m_styleSheetCandidateNodes.isEmpty()) {
+        m_styleSheetCandidateNodes.add(&amp;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-&gt;compareDocumentPosition(&amp;node);
+        if (position == Node::DOCUMENT_POSITION_FOLLOWING) {
+            m_styleSheetCandidateNodes.insertBefore(followingNode, &amp;node);
+            return;
+        }
+        followingNode = n;
+    } while (it != begin);
+    
+    m_styleSheetCandidateNodes.insertBefore(followingNode, &amp;node);
+}
+
+void AuthorStyleSheets::removeStyleSheetCandidateNode(Node&amp; node)
+{
+    m_styleSheetCandidateNodes.remove(&amp;node);
+}
+
+void AuthorStyleSheets::collectActiveStyleSheets(Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; sheets)
+{
+    if (m_document.settings() &amp;&amp; !m_document.settings()-&gt;authorAndUserStylesEnabled())
+        return;
+
+    for (auto&amp; node : m_styleSheetCandidateNodes) {
+        StyleSheet* sheet = nullptr;
+        if (is&lt;ProcessingInstruction&gt;(*node)) {
+            // Processing instruction (XML documents only).
+            // We don't support linking to embedded CSS stylesheets, see &lt;https://bugs.webkit.org/show_bug.cgi?id=49281&gt; for discussion.
+            ProcessingInstruction&amp; pi = downcast&lt;ProcessingInstruction&gt;(*node);
+            sheet = pi.sheet();
+#if ENABLE(XSLT)
+            // Don't apply XSL transforms to already transformed documents -- &lt;rdar://problem/4132806&gt;
+            if (pi.isXSL() &amp;&amp; !m_document.transformSourceDocument()) {
+                // Don't apply XSL transforms until loading is finished.
+                if (!m_document.parsing())
+                    m_document.applyXSLTransform(&amp;pi);
+                return;
+            }
+#endif
+        } else if (is&lt;HTMLLinkElement&gt;(*node) || is&lt;HTMLStyleElement&gt;(*node) || is&lt;SVGStyleElement&gt;(*node)) {
+            Element&amp; element = downcast&lt;Element&gt;(*node);
+            AtomicString title = element.fastGetAttribute(titleAttr);
+            bool enabledViaScript = false;
+            if (is&lt;HTMLLinkElement&gt;(element)) {
+                // &lt;LINK&gt; element
+                HTMLLinkElement&amp; linkElement = downcast&lt;HTMLLinkElement&gt;(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 &amp;&amp; !title.isEmpty() &amp;&amp; m_preferredStylesheetSetName.isEmpty()) {
+                        if (!linkElement.fastGetAttribute(relAttr).contains(&quot;alternate&quot;)) {
+                            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&lt;SVGStyleElement&gt;(element))
+                sheet = downcast&lt;SVGStyleElement&gt;(element).sheet();
+            else if (is&lt;HTMLLinkElement&gt;(element))
+                sheet = downcast&lt;HTMLLinkElement&gt;(element).sheet();
+            else
+                sheet = downcast&lt;HTMLStyleElement&gt;(element).sheet();
+            // Check to see if this sheet belongs to a styleset
+            // (thus making it PREFERRED or ALTERNATE rather than
+            // PERSISTENT).
+            auto&amp; rel = element.fastGetAttribute(relAttr);
+            if (!enabledViaScript &amp;&amp; !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&lt;HTMLStyleElement&gt;(element) || !rel.contains(&quot;alternate&quot;))
+                        m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
+                }
+                if (title != m_preferredStylesheetSetName)
+                    sheet = nullptr;
+            }
+
+            if (rel.contains(&quot;alternate&quot;) &amp;&amp; title.isEmpty())
+                sheet = nullptr;
+        }
+        if (sheet)
+            sheets.append(sheet);
+    }
+}
+
+void AuthorStyleSheets::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, StyleResolverUpdateType&amp; styleResolverUpdateType, bool&amp; requiresFullStyleRecalc)
+{
+    styleResolverUpdateType = Reconstruct;
+    requiresFullStyleRecalc = true;
+    
+    // Stylesheets of &lt;style&gt; elements that @import stylesheets are active but loading. We need to trigger a full recalc when such loads are done.
+    bool hasActiveLoadingStylesheet = false;
+    unsigned newStylesheetCount = newStylesheets.size();
+    for (unsigned i = 0; i &lt; newStylesheetCount; ++i) {
+        if (newStylesheets[i]-&gt;isLoading())
+            hasActiveLoadingStylesheet = true;
+    }
+    if (m_hadActiveLoadingStylesheet &amp;&amp; !hasActiveLoadingStylesheet) {
+        m_hadActiveLoadingStylesheet = false;
+        return;
+    }
+    m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet;
+
+    if (updateFlag != OptimizedUpdate)
+        return;
+    if (!m_document.styleResolverIfExists())
+        return;
+    StyleResolver&amp; styleResolver = *m_document.styleResolverIfExists();
+
+    // Find out which stylesheets are new.
+    unsigned oldStylesheetCount = m_activeStyleSheets.size();
+    if (newStylesheetCount &lt; oldStylesheetCount)
+        return;
+    Vector&lt;StyleSheetContents*&gt; addedSheets;
+    unsigned newIndex = 0;
+    for (unsigned oldIndex = 0; oldIndex &lt; oldStylesheetCount; ++oldIndex) {
+        if (newIndex &gt;= newStylesheetCount)
+            return;
+        while (m_activeStyleSheets[oldIndex] != newStylesheets[newIndex]) {
+            addedSheets.append(&amp;newStylesheets[newIndex]-&gt;contents());
+            ++newIndex;
+            if (newIndex == newStylesheetCount)
+                return;
+        }
+        ++newIndex;
+    }
+    bool hasInsertions = !addedSheets.isEmpty();
+    while (newIndex &lt; newStylesheetCount) {
+        addedSheets.append(&amp;newStylesheets[newIndex]-&gt;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.
+    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;
+    StyleInvalidationAnalysis invalidationAnalysis(addedSheets, styleResolver.mediaQueryEvaluator());
+    if (invalidationAnalysis.dirtiesAllStyle())
+        return;
+    invalidationAnalysis.invalidateStyle(m_document);
+    requiresFullStyleRecalc = false;
+}
+
+static void filterEnabledNonemptyCSSStyleSheets(Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; result, const Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; sheets)
+{
+    for (unsigned i = 0; i &lt; sheets.size(); ++i) {
+        if (!is&lt;CSSStyleSheet&gt;(*sheets[i]))
+            continue;
+        CSSStyleSheet&amp; sheet = downcast&lt;CSSStyleSheet&gt;(*sheets[i]);
+        if (sheet.disabled())
+            continue;
+        if (!sheet.length())
+            continue;
+        result.append(&amp;sheet);
+    }
+}
+
+bool AuthorStyleSheets::updateActiveStyleSheets(UpdateFlag updateFlag)
+{
+    if (m_document.inStyleRecalc()) {
+        // SVG &lt;use&gt; element may manage to invalidate style selector in the middle of a style recalc.
+        // https://bugs.webkit.org/show_bug.cgi?id=54344
+        // FIXME: This should be fixed in SVG and the call site replaced by ASSERT(!m_inStyleRecalc).
+        m_pendingUpdateType = FullUpdate;
+        m_document.scheduleForcedStyleRecalc();
+        return false;
+
+    }
+    if (!m_document.hasLivingRenderTree())
+        return false;
+
+    Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; activeStyleSheets;
+    collectActiveStyleSheets(activeStyleSheets);
+
+    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; activeCSSStyleSheets;
+    activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
+    activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
+    filterEnabledNonemptyCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
+
+    StyleResolverUpdateType styleResolverUpdateType;
+    bool requiresFullStyleRecalc;
+    analyzeStyleSheetChange(updateFlag, activeCSSStyleSheets, styleResolverUpdateType, requiresFullStyleRecalc);
+
+    if (styleResolverUpdateType == Reconstruct)
+        m_document.clearStyleResolver();
+    else {
+        StyleResolver&amp; styleResolver = m_document.ensureStyleResolver();
+        if (styleResolverUpdateType == Reset) {
+            styleResolver.ruleSets().resetAuthorStyle();
+            styleResolver.appendAuthorStyleSheets(0, activeCSSStyleSheets);
+        } else {
+            ASSERT(styleResolverUpdateType == Additive);
+            styleResolver.appendAuthorStyleSheets(m_activeStyleSheets.size(), activeCSSStyleSheets);
+        }
+    }
+
+    m_weakCopyOfActiveStyleSheetListForFastLookup = nullptr;
+    m_activeStyleSheets.swap(activeCSSStyleSheets);
+    m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
+
+    InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
+
+    for (const auto&amp; sheet : m_activeStyleSheets) {
+        if (sheet-&gt;contents().usesRemUnits())
+            m_usesRemUnits = true;
+        if (sheet-&gt;contents().usesStyleBasedEditability())
+            m_usesStyleBasedEditability = true;
+    }
+    m_pendingUpdateType = NoUpdate;
+
+    return requiresFullStyleRecalc;
+}
+
+const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; AuthorStyleSheets::activeStyleSheetsForInspector() const
+{
+    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; result;
+
+    result.appendVector(m_document.extensionStyleSheets().injectedAuthorStyleSheets());
+    result.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
+
+    for (auto&amp; styleSheet : m_styleSheetsForStyleSheetList) {
+        if (!is&lt;CSSStyleSheet&gt;(*styleSheet))
+            continue;
+
+        CSSStyleSheet&amp; sheet = downcast&lt;CSSStyleSheet&gt;(*styleSheet);
+        if (sheet.disabled())
+            continue;
+
+        result.append(&amp;sheet);
+    }
+
+    return result;
+}
+
+bool AuthorStyleSheets::activeStyleSheetsContains(const CSSStyleSheet* sheet) const
+{
+    if (!m_weakCopyOfActiveStyleSheetListForFastLookup) {
+        m_weakCopyOfActiveStyleSheetListForFastLookup = std::make_unique&lt;HashSet&lt;const CSSStyleSheet*&gt;&gt;();
+        for (unsigned i = 0; i &lt; m_activeStyleSheets.size(); ++i)
+            m_weakCopyOfActiveStyleSheetListForFastLookup-&gt;add(m_activeStyleSheets[i].get());
+    }
+    return m_weakCopyOfActiveStyleSheetListForFastLookup-&gt;contains(sheet);
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetshfromrev190074trunkSourceWebCoredomDocumentStyleSheetCollectionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/AuthorStyleSheets.h (from rev 190074, trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h) (0 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.h                                (rev 0)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -0,0 +1,138 @@
</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 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 &quot;Timer.h&quot;
+#include &lt;memory&gt;
+#include &lt;wtf/FastMalloc.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/ListHashSet.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+class CSSStyleSheet;
+class Document;
+class Node;
+class StyleSheet;
+class StyleSheetContents;
+class StyleSheetList;
+class TreeScope;
+
+class AuthorStyleSheets {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit AuthorStyleSheets(TreeScope&amp;);
+
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; activeStyleSheets() const { return m_activeStyleSheets; }
+
+    const Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; activeStyleSheetsForInspector() const;
+
+    void addStyleSheetCandidateNode(Node&amp;, bool createdByParser);
+    void removeStyleSheetCandidateNode(Node&amp;);
+
+    enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
+
+    UpdateFlag pendingUpdateType() const { return m_pendingUpdateType; }
+    void setPendingUpdateType(UpdateFlag updateType)
+    {
+        if (updateType &gt; m_pendingUpdateType)
+            m_pendingUpdateType = updateType;
+    }
+
+    void flushPendingUpdates()
+    {
+        if (m_pendingUpdateType != NoUpdate)
+            updateActiveStyleSheets(m_pendingUpdateType);
+    }
+
+    bool updateActiveStyleSheets(UpdateFlag);
+
+    String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
+    String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
+    void setPreferredStylesheetSetName(const String&amp; name) { m_preferredStylesheetSetName = name; }
+    void setSelectedStylesheetSetName(const String&amp; name) { m_selectedStylesheetSetName = name; }
+
+    void addPendingSheet() { m_pendingStyleSheetCount++; }
+    enum RemovePendingSheetNotificationType {
+        RemovePendingSheetNotifyImmediately,
+        RemovePendingSheetNotifyLater
+    };
+    void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
+
+    bool hasPendingSheets() const { return m_pendingStyleSheetCount &gt; 0; }
+
+    bool usesRemUnits() const { return m_usesRemUnits; }
+    void setUsesRemUnit(bool b) { m_usesRemUnits = b; }
+    bool usesStyleBasedEditability() { return m_usesStyleBasedEditability; }
+
+    bool activeStyleSheetsContains(const CSSStyleSheet*) const;
+
+private:
+    void collectActiveStyleSheets(Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp;);
+    enum StyleResolverUpdateType {
+        Reconstruct,
+        Reset,
+        Additive
+    };
+    void analyzeStyleSheetChange(UpdateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, StyleResolverUpdateType&amp;, bool&amp; requiresFullStyleRecalc);
+
+    Document&amp; m_document;
+
+    Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; m_styleSheetsForStyleSheetList;
+    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_activeStyleSheets;
+
+    // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().
+    mutable std::unique_ptr&lt;HashSet&lt;const CSSStyleSheet*&gt;&gt; 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_hadActiveLoadingStylesheet { false };
+    UpdateFlag m_pendingUpdateType { NoUpdate };
+
+    ListHashSet&lt;Node*&gt; m_styleSheetCandidateNodes;
+
+    String m_preferredStylesheetSetName;
+    String m_selectedStylesheetSetName;
+
+    bool m_usesRemUnits { false };
+    bool m_usesStyleBasedEditability { false };
+};
+
+}
+
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebCoredomDOMAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMAllInOne.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/DOMAllInOne.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;ActiveDOMObject.cpp&quot;
</span><span class="cx"> #include &quot;AnimationEvent.cpp&quot;
</span><ins>+#include &quot;AuthorStyleSheets.cpp&quot;
</ins><span class="cx"> #include &quot;Attr.cpp&quot;
</span><span class="cx"> #include &quot;BeforeTextInsertedEvent.cpp&quot;
</span><span class="cx"> #include &quot;BeforeUnloadEvent.cpp&quot;
</span><span class="lines">@@ -69,7 +70,6 @@
</span><span class="cx"> #include &quot;DocumentOrderedMap.cpp&quot;
</span><span class="cx"> #include &quot;DocumentParser.cpp&quot;
</span><span class="cx"> #include &quot;DocumentSharedObjectPool.cpp&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.cpp&quot;
</del><span class="cx"> #include &quot;DocumentType.cpp&quot;
</span><span class="cx"> #include &quot;Element.cpp&quot;
</span><span class="cx"> #include &quot;ElementData.cpp&quot;
</span><span class="lines">@@ -85,6 +85,7 @@
</span><span class="cx"> #include &quot;EventTarget.cpp&quot;
</span><span class="cx"> #include &quot;ExceptionBase.cpp&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.cpp&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.cpp&quot;
</ins><span class="cx"> #include &quot;FocusEvent.cpp&quot;
</span><span class="cx"> #include &quot;GenericEventQueue.cpp&quot;
</span><span class="cx"> #include &quot;IdTargetObserver.cpp&quot;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/Document.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;AnimationController.h&quot;
</span><span class="cx"> #include &quot;Attr.h&quot;
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CDATASection.h&quot;
</span><span class="cx"> #include &quot;CSSFontSelector.h&quot;
</span><span class="cx"> #include &quot;CSSStyleDeclaration.h&quot;
</span><span class="lines">@@ -57,6 +58,7 @@
</span><span class="cx"> #include &quot;EntityReference.h&quot;
</span><span class="cx"> #include &quot;EventFactory.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;FocusController.h&quot;
</span><span class="cx"> #include &quot;FontLoader.h&quot;
</span><span class="cx"> #include &quot;FormController.h&quot;
</span><span class="lines">@@ -439,7 +441,8 @@
</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_styleSheetCollection(*this)
</del><ins>+    , m_authorStyleSheets(std::make_unique&lt;AuthorStyleSheets&gt;(*this))
+    , m_extensionStyleSheets(std::make_unique&lt;ExtensionStyleSheets&gt;(*this))
</ins><span class="cx">     , m_visitedLinkState(std::make_unique&lt;VisitedLinkState&gt;(*this))
</span><span class="cx">     , m_visuallyOrdered(false)
</span><span class="cx">     , m_readyState(Complete)
</span><span class="lines">@@ -624,7 +627,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_elementSheet)
</span><span class="cx">         m_elementSheet-&gt;detachFromDocument();
</span><del>-    m_styleSheetCollection.detachFromDocument();
</del><ins>+    extensionStyleSheets().detachFromDocument();
</ins><span class="cx"> 
</span><span class="cx">     clearStyleResolver(); // We need to destroy CSSFontSelector before destroying m_cachedResourceLoader.
</span><span class="cx"> 
</span><span class="lines">@@ -791,8 +794,8 @@
</span><span class="cx"> 
</span><span class="cx">     if (inQuirksMode() != wasInQuirksMode) {
</span><span class="cx">         // All user stylesheets have to reparse using the different mode.
</span><del>-        m_styleSheetCollection.clearPageUserSheet();
-        m_styleSheetCollection.invalidateInjectedStyleSheetCache();
</del><ins>+        extensionStyleSheets().clearPageUserSheet();
+        extensionStyleSheets().invalidateInjectedStyleSheetCache();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1810,7 +1813,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>-    m_styleSheetCollection.flushPendingUpdates();
</del><ins>+    authorStyleSheets().flushPendingUpdates();
</ins><span class="cx"> 
</span><span class="cx">     frameView.willRecalcStyle();
</span><span class="cx"> 
</span><span class="lines">@@ -1818,7 +1821,7 @@
</span><span class="cx"> 
</span><span class="cx">     // FIXME: We never reset this flags.
</span><span class="cx">     if (m_elementSheet &amp;&amp; m_elementSheet-&gt;contents().usesRemUnits())
</span><del>-        m_styleSheetCollection.setUsesRemUnit(true);
</del><ins>+        authorStyleSheets().setUsesRemUnit(true);
</ins><span class="cx">     // We don't call setUsesStyleBasedEditability here because the whole point of the flag is to avoid style recalc.
</span><span class="cx">     // i.e. updating the flag here would be too late.
</span><span class="cx"> 
</span><span class="lines">@@ -1845,10 +1848,6 @@
</span><span class="cx">         unscheduleStyleRecalc();
</span><span class="cx"> 
</span><span class="cx">         m_inStyleRecalc = false;
</span><del>-
-        // Pseudo element removal and similar may only work with these flags still set. Reset them after the style recalc.
-        if (m_styleResolver)
-            m_styleSheetCollection.resetCSSFeatureFlags();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // If we wanted to call implicitClose() during recalcStyle, do so now that we're finished.
</span><span class="lines">@@ -2117,7 +2116,7 @@
</span><span class="cx">     if (Settings* settings = this-&gt;settings())
</span><span class="cx">         matchAuthorAndUserStyles = settings-&gt;authorAndUserStylesEnabled();
</span><span class="cx">     m_styleResolver = std::make_unique&lt;StyleResolver&gt;(*this, matchAuthorAndUserStyles);
</span><del>-    m_styleSheetCollection.combineCSSFeatureFlags();
</del><ins>+    m_styleResolver-&gt;appendAuthorStyleSheets(0, authorStyleSheets().activeStyleSheets());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::fontsNeedUpdate(FontSelector&amp;)
</span><span class="lines">@@ -3077,9 +3076,9 @@
</span><span class="cx">     ASSERT(!m_renderView || !m_renderView-&gt;frameView().isPainting());
</span><span class="cx">     ASSERT(!m_inStyleRecalc);
</span><span class="cx"> 
</span><del>-    auto&amp; collection = document().styleSheetCollection();
-    collection.flushPendingUpdates();
-    return collection.usesStyleBasedEditability();
</del><ins>+    auto&amp; authorSheets = const_cast&lt;AuthorStyleSheets&amp;&gt;(authorStyleSheets());
+    authorSheets.flushPendingUpdates();
+    return authorSheets.usesStyleBasedEditability();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::processHttpEquiv(const String&amp; equiv, const String&amp; content)
</span><span class="lines">@@ -3119,8 +3118,8 @@
</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>-        m_styleSheetCollection.setSelectedStylesheetSetName(content);
-        m_styleSheetCollection.setPreferredStylesheetSetName(content);
</del><ins>+        authorStyleSheets().setSelectedStylesheetSetName(content);
+        authorStyleSheets().setPreferredStylesheetSetName(content);
</ins><span class="cx">         styleResolverChanged(DeferRecalcStyle);
</span><span class="cx">         break;
</span><span class="cx"> 
</span><span class="lines">@@ -3473,17 +3472,17 @@
</span><span class="cx"> 
</span><span class="cx"> String Document::preferredStylesheetSet() const
</span><span class="cx"> {
</span><del>-    return m_styleSheetCollection.preferredStylesheetSetName();
</del><ins>+    return authorStyleSheets().preferredStylesheetSetName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String Document::selectedStylesheetSet() const
</span><span class="cx"> {
</span><del>-    return m_styleSheetCollection.selectedStylesheetSetName();
</del><ins>+    return authorStyleSheets().selectedStylesheetSetName();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::setSelectedStylesheetSet(const String&amp; aString)
</span><span class="cx"> {
</span><del>-    m_styleSheetCollection.setSelectedStylesheetSetName(aString);
</del><ins>+    authorStyleSheets().setSelectedStylesheetSetName(aString);
</ins><span class="cx">     styleResolverChanged(DeferRecalcStyle);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3502,7 +3501,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_optimizedStyleSheetUpdateTimer.isActive())
</span><span class="cx">         return;
</span><del>-    m_styleSheetCollection.setPendingUpdateType(DocumentStyleSheetCollection::OptimizedUpdate);
</del><ins>+    authorStyleSheets().setPendingUpdateType(AuthorStyleSheets::OptimizedUpdate);
</ins><span class="cx">     m_optimizedStyleSheetUpdateTimer.startOneShot(0);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3589,10 +3588,10 @@
</span><span class="cx">         printf(&quot;Beginning update of style selector at time %lld.\n&quot;, elapsedTime().count());
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    DocumentStyleSheetCollection::UpdateFlag styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
-        ? DocumentStyleSheetCollection::OptimizedUpdate
-        : DocumentStyleSheetCollection::FullUpdate;
-    bool stylesheetChangeRequiresStyleRecalc = m_styleSheetCollection.updateActiveStyleSheets(styleSheetUpdate);
</del><ins>+    auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
+        ? AuthorStyleSheets::OptimizedUpdate
+        : AuthorStyleSheets::FullUpdate;
+    bool stylesheetChangeRequiresStyleRecalc = authorStyleSheets().updateActiveStyleSheets(styleSheetUpdate);
</ins><span class="cx"> 
</span><span class="cx">     if (updateFlag == DeferRecalcStyle) {
</span><span class="cx">         scheduleForcedStyleRecalc();
</span><span class="lines">@@ -6487,7 +6486,7 @@
</span><span class="cx"> 
</span><span class="cx"> bool Document::haveStylesheetsLoaded() const
</span><span class="cx"> {
</span><del>-    return !m_styleSheetCollection.hasPendingSheets() || m_ignorePendingStylesheets;
</del><ins>+    return !authorStyleSheets().hasPendingSheets() || m_ignorePendingStylesheets;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Locale&amp; Document::getCachedLocale(const AtomicString&amp; locale)
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/Document.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx">  *           (C) 1999 Antti Koivisto (koivisto@kde.org)
</span><span class="cx">  *           (C) 2001 Dirk Mueller (mueller@kde.org)
</span><span class="cx">  *           (C) 2006 Alexey Proskuryakov (ap@webkit.org)
</span><del>- * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2010, 2012-2013, 2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="cx">  * Copyright (C) 2011 Google Inc. All rights reserved.
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;Color.h&quot;
</span><span class="cx"> #include &quot;ContainerNode.h&quot;
</span><span class="cx"> #include &quot;DocumentEventQueue.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;DocumentTiming.h&quot;
</span><span class="cx"> #include &quot;FocusDirection.h&quot;
</span><span class="cx"> #include &quot;FontSelector.h&quot;
</span><span class="lines">@@ -70,6 +69,7 @@
</span><span class="cx"> 
</span><span class="cx"> class AXObjectCache;
</span><span class="cx"> class Attr;
</span><ins>+class AuthorStyleSheets;
</ins><span class="cx"> class CDATASection;
</span><span class="cx"> class CSSFontSelector;
</span><span class="cx"> class CSSStyleDeclaration;
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> class EntityReference;
</span><span class="cx"> class Event;
</span><span class="cx"> class EventListener;
</span><ins>+class ExtensionStyleSheets;
</ins><span class="cx"> class FloatRect;
</span><span class="cx"> class FloatQuad;
</span><span class="cx"> class FormController;
</span><span class="lines">@@ -503,7 +504,10 @@
</span><span class="cx">     // This is a DOM function.
</span><span class="cx">     StyleSheetList&amp; styleSheets();
</span><span class="cx"> 
</span><del>-    DocumentStyleSheetCollection&amp; styleSheetCollection() { return m_styleSheetCollection; }
</del><ins>+    AuthorStyleSheets&amp; authorStyleSheets() { return *m_authorStyleSheets; }
+    const AuthorStyleSheets&amp; authorStyleSheets() const { return *m_authorStyleSheets; }
+    ExtensionStyleSheets&amp; extensionStyleSheets() { return *m_extensionStyleSheets; }
+    const ExtensionStyleSheets&amp; extensionStyleSheets() const { return *m_extensionStyleSheets; }
</ins><span class="cx"> 
</span><span class="cx">     bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfterStylesheetsLoad; }
</span><span class="cx">     void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAfterStylesheetsLoad = b; }
</span><span class="lines">@@ -1459,7 +1463,8 @@
</span><span class="cx"> 
</span><span class="cx">     MutationObserverOptions m_mutationObserverTypes;
</span><span class="cx"> 
</span><del>-    DocumentStyleSheetCollection m_styleSheetCollection;
</del><ins>+    std::unique_ptr&lt;AuthorStyleSheets&gt; m_authorStyleSheets;
+    std::unique_ptr&lt;ExtensionStyleSheets&gt; m_extensionStyleSheets;
</ins><span class="cx">     RefPtr&lt;StyleSheetList&gt; m_styleSheetList;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;FormController&gt; m_formController;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -1,545 +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, 2005, 2006, 2007, 2008, 2009, 2011, 2012 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 &quot;config.h&quot;
-#include &quot;DocumentStyleSheetCollection.h&quot;
-
-#include &quot;CSSStyleSheet.h&quot;
-#include &quot;Element.h&quot;
-#include &quot;HTMLIFrameElement.h&quot;
-#include &quot;HTMLLinkElement.h&quot;
-#include &quot;HTMLStyleElement.h&quot;
-#include &quot;InspectorInstrumentation.h&quot;
-#include &quot;Page.h&quot;
-#include &quot;PageGroup.h&quot;
-#include &quot;ProcessingInstruction.h&quot;
-#include &quot;SVGNames.h&quot;
-#include &quot;SVGStyleElement.h&quot;
-#include &quot;Settings.h&quot;
-#include &quot;StyleInvalidationAnalysis.h&quot;
-#include &quot;StyleResolver.h&quot;
-#include &quot;StyleSheetContents.h&quot;
-#include &quot;StyleSheetList.h&quot;
-#include &quot;UserContentController.h&quot;
-#include &quot;UserContentURLPattern.h&quot;
-#include &quot;UserStyleSheet.h&quot;
-
-namespace WebCore {
-
-using namespace ContentExtensions;
-using namespace HTMLNames;
-
-DocumentStyleSheetCollection::DocumentStyleSheetCollection(Document&amp; document)
-    : m_document(document)
-    , m_pendingStylesheets(0)
-    , m_injectedStyleSheetCacheValid(false)
-    , m_hadActiveLoadingStylesheet(false)
-    , m_pendingUpdateType(NoUpdate)
-    , m_usesFirstLineRules(false)
-    , m_usesFirstLetterRules(false)
-    , m_usesRemUnits(false)
-    , m_usesStyleBasedEditability(false)
-    , m_styleResolverChangedTimer(*this, &amp;DocumentStyleSheetCollection::styleResolverChangedTimerFired)
-{
-}
-
-void DocumentStyleSheetCollection::combineCSSFeatureFlags()
-{
-    // Delay resetting the flags until after next style recalc since unapplying the style may not work without these set (this is true at least with before/after).
-    const StyleResolver&amp; styleResolver = m_document.ensureStyleResolver();
-    m_usesFirstLineRules = m_usesFirstLineRules || styleResolver.usesFirstLineRules();
-    m_usesFirstLetterRules = m_usesFirstLetterRules || styleResolver.usesFirstLetterRules();
-}
-
-void DocumentStyleSheetCollection::resetCSSFeatureFlags()
-{
-    const StyleResolver&amp; styleResolver = m_document.ensureStyleResolver();
-    m_usesFirstLineRules = styleResolver.usesFirstLineRules();
-    m_usesFirstLetterRules = styleResolver.usesFirstLetterRules();
-}
-
-CSSStyleSheet* DocumentStyleSheetCollection::pageUserSheet()
-{
-    if (m_pageUserSheet)
-        return m_pageUserSheet.get();
-    
-    Page* owningPage = m_document.page();
-    if (!owningPage)
-        return 0;
-    
-    String userSheetText = owningPage-&gt;userStyleSheet();
-    if (userSheetText.isEmpty())
-        return 0;
-    
-    // Parse the sheet and cache it.
-    m_pageUserSheet = CSSStyleSheet::createInline(m_document, m_document.settings()-&gt;userStyleSheetLocation());
-    m_pageUserSheet-&gt;contents().setIsUserStyleSheet(true);
-    m_pageUserSheet-&gt;contents().parseString(userSheetText);
-    return m_pageUserSheet.get();
-}
-
-void DocumentStyleSheetCollection::clearPageUserSheet()
-{
-    if (m_pageUserSheet) {
-        m_pageUserSheet = nullptr;
-        m_document.styleResolverChanged(DeferRecalcStyle);
-    }
-}
-
-void DocumentStyleSheetCollection::updatePageUserSheet()
-{
-    clearPageUserSheet();
-    if (pageUserSheet())
-        m_document.styleResolverChanged(RecalcStyleImmediately);
-}
-
-const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; DocumentStyleSheetCollection::injectedUserStyleSheets() const
-{
-    updateInjectedStyleSheetCache();
-    return m_injectedUserStyleSheets;
-}
-
-const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; DocumentStyleSheetCollection::injectedAuthorStyleSheets() const
-{
-    updateInjectedStyleSheetCache();
-    return m_injectedAuthorStyleSheets;
-}
-
-void DocumentStyleSheetCollection::updateInjectedStyleSheetCache() const
-{
-    if (m_injectedStyleSheetCacheValid)
-        return;
-    m_injectedStyleSheetCacheValid = true;
-    m_injectedUserStyleSheets.clear();
-    m_injectedAuthorStyleSheets.clear();
-
-    Page* owningPage = m_document.page();
-    if (!owningPage)
-        return;
-
-    const auto* userContentController = owningPage-&gt;userContentController();
-    if (!userContentController)
-        return;
-
-    const UserStyleSheetMap* userStyleSheets = userContentController-&gt;userStyleSheets();
-    if (!userStyleSheets)
-        return;
-
-    for (auto&amp; styleSheets : userStyleSheets-&gt;values()) {
-        for (const auto&amp; sheet : *styleSheets) {
-            if (sheet-&gt;injectedFrames() == InjectInTopFrameOnly &amp;&amp; m_document.ownerElement())
-                continue;
-
-            if (!UserContentURLPattern::matchesPatterns(m_document.url(), sheet-&gt;whitelist(), sheet-&gt;blacklist()))
-                continue;
-
-            RefPtr&lt;CSSStyleSheet&gt; groupSheet = CSSStyleSheet::createInline(const_cast&lt;Document&amp;&gt;(m_document), sheet-&gt;url());
-            bool isUserStyleSheet = sheet-&gt;level() == UserStyleUserLevel;
-            if (isUserStyleSheet)
-                m_injectedUserStyleSheets.append(groupSheet);
-            else
-                m_injectedAuthorStyleSheets.append(groupSheet);
-
-            groupSheet-&gt;contents().setIsUserStyleSheet(isUserStyleSheet);
-            groupSheet-&gt;contents().parseString(sheet-&gt;source());
-        }
-    }
-}
-
-void DocumentStyleSheetCollection::invalidateInjectedStyleSheetCache()
-{
-    if (!m_injectedStyleSheetCacheValid)
-        return;
-    m_injectedStyleSheetCacheValid = false;
-    if (m_injectedUserStyleSheets.isEmpty() &amp;&amp; m_injectedAuthorStyleSheets.isEmpty())
-        return;
-    m_document.styleResolverChanged(DeferRecalcStyle);
-}
-
-void DocumentStyleSheetCollection::addAuthorSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; authorSheet)
-{
-    ASSERT(!authorSheet.get().isUserStyleSheet());
-    m_authorStyleSheets.append(CSSStyleSheet::create(WTF::move(authorSheet), &amp;m_document));
-    m_document.styleResolverChanged(RecalcStyleImmediately);
-}
-
-void DocumentStyleSheetCollection::addUserSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet)
-{
-    ASSERT(userSheet.get().isUserStyleSheet());
-    m_userStyleSheets.append(CSSStyleSheet::create(WTF::move(userSheet), &amp;m_document));
-    m_document.styleResolverChanged(RecalcStyleImmediately);
-}
-
-#if ENABLE(CONTENT_EXTENSIONS)
-void DocumentStyleSheetCollection::addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID)
-{
-    auto result = m_contentExtensionSelectorSheets.add(identifier, nullptr);
-    if (result.isNewEntry) {
-        result.iterator-&gt;value = ContentExtensionStyleSheet::create(m_document);
-        m_userStyleSheets.append(&amp;result.iterator-&gt;value-&gt;styleSheet());
-    }
-
-    result.iterator-&gt;value-&gt;addDisplayNoneSelector(selector, selectorID);
-    m_styleResolverChangedTimer.startOneShot(0);
-}
-
-void DocumentStyleSheetCollection::maybeAddContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp; sheet)
-{
-    ASSERT(sheet.isUserStyleSheet());
-
-    if (m_contentExtensionSheets.contains(identifier))
-        return;
-
-    Ref&lt;CSSStyleSheet&gt; cssSheet = CSSStyleSheet::create(sheet, &amp;m_document);
-    m_contentExtensionSheets.set(identifier, &amp;cssSheet.get());
-    m_userStyleSheets.append(adoptRef(cssSheet.leakRef()));
-    m_styleResolverChangedTimer.startOneShot(0);
-}
-#endif // ENABLE(CONTENT_EXTENSIONS)
-
-void DocumentStyleSheetCollection::styleResolverChangedTimerFired()
-{
-    m_document.styleResolverChanged(RecalcStyleImmediately);
-}
-
-// This method is called whenever a top-level stylesheet has finished loading.
-void DocumentStyleSheetCollection::removePendingSheet(RemovePendingSheetNotificationType notification)
-{
-    // Make sure we knew this sheet was pending, and that our count isn't out of sync.
-    ASSERT(m_pendingStylesheets &gt; 0);
-
-    m_pendingStylesheets--;
-    
-#ifdef INSTRUMENT_LAYOUT_SCHEDULING
-    if (!ownerElement())
-        printf(&quot;Stylesheet loaded at time %d. %d stylesheets still remain.\n&quot;, elapsedTime(), m_pendingStylesheets);
-#endif
-
-    if (m_pendingStylesheets)
-        return;
-
-    if (notification == RemovePendingSheetNotifyLater) {
-        m_document.setNeedsNotifyRemoveAllPendingStylesheet();
-        return;
-    }
-    
-    m_document.didRemoveAllPendingStylesheet();
-}
-
-void DocumentStyleSheetCollection::addStyleSheetCandidateNode(Node&amp; node, bool createdByParser)
-{
-    if (!node.inDocument())
-        return;
-    
-    // Until the &lt;body&gt; 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 &amp;&amp; m_document.bodyOrFrameset()) || m_styleSheetCandidateNodes.isEmpty()) {
-        m_styleSheetCandidateNodes.add(&amp;node);
-        return;
-    }
-
-    // Determine an appropriate insertion point.
-    StyleSheetCandidateListHashSet::iterator begin = m_styleSheetCandidateNodes.begin();
-    StyleSheetCandidateListHashSet::iterator end = m_styleSheetCandidateNodes.end();
-    StyleSheetCandidateListHashSet::iterator it = end;
-    Node* followingNode = 0;
-    do {
-        --it;
-        Node* n = *it;
-        unsigned short position = n-&gt;compareDocumentPosition(&amp;node);
-        if (position == Node::DOCUMENT_POSITION_FOLLOWING) {
-            m_styleSheetCandidateNodes.insertBefore(followingNode, &amp;node);
-            return;
-        }
-        followingNode = n;
-    } while (it != begin);
-    
-    m_styleSheetCandidateNodes.insertBefore(followingNode, &amp;node);
-}
-
-void DocumentStyleSheetCollection::removeStyleSheetCandidateNode(Node&amp; node)
-{
-    m_styleSheetCandidateNodes.remove(&amp;node);
-}
-
-void DocumentStyleSheetCollection::collectActiveStyleSheets(Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; sheets)
-{
-    if (m_document.settings() &amp;&amp; !m_document.settings()-&gt;authorAndUserStylesEnabled())
-        return;
-
-    for (auto&amp; node : m_styleSheetCandidateNodes) {
-        StyleSheet* sheet = nullptr;
-        if (is&lt;ProcessingInstruction&gt;(*node)) {
-            // Processing instruction (XML documents only).
-            // We don't support linking to embedded CSS stylesheets, see &lt;https://bugs.webkit.org/show_bug.cgi?id=49281&gt; for discussion.
-            ProcessingInstruction&amp; pi = downcast&lt;ProcessingInstruction&gt;(*node);
-            sheet = pi.sheet();
-#if ENABLE(XSLT)
-            // Don't apply XSL transforms to already transformed documents -- &lt;rdar://problem/4132806&gt;
-            if (pi.isXSL() &amp;&amp; !m_document.transformSourceDocument()) {
-                // Don't apply XSL transforms until loading is finished.
-                if (!m_document.parsing())
-                    m_document.applyXSLTransform(&amp;pi);
-                return;
-            }
-#endif
-        } else if (is&lt;HTMLLinkElement&gt;(*node) || is&lt;HTMLStyleElement&gt;(*node) || is&lt;SVGStyleElement&gt;(*node)) {
-            Element&amp; element = downcast&lt;Element&gt;(*node);
-            AtomicString title = element.fastGetAttribute(titleAttr);
-            bool enabledViaScript = false;
-            if (is&lt;HTMLLinkElement&gt;(element)) {
-                // &lt;LINK&gt; element
-                HTMLLinkElement&amp; linkElement = downcast&lt;HTMLLinkElement&gt;(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 &amp;&amp; !title.isEmpty() &amp;&amp; m_preferredStylesheetSetName.isEmpty()) {
-                        if (!linkElement.fastGetAttribute(relAttr).contains(&quot;alternate&quot;)) {
-                            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&lt;SVGStyleElement&gt;(element))
-                sheet = downcast&lt;SVGStyleElement&gt;(element).sheet();
-            else if (is&lt;HTMLLinkElement&gt;(element))
-                sheet = downcast&lt;HTMLLinkElement&gt;(element).sheet();
-            else
-                sheet = downcast&lt;HTMLStyleElement&gt;(element).sheet();
-            // Check to see if this sheet belongs to a styleset
-            // (thus making it PREFERRED or ALTERNATE rather than
-            // PERSISTENT).
-            auto&amp; rel = element.fastGetAttribute(relAttr);
-            if (!enabledViaScript &amp;&amp; !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&lt;HTMLStyleElement&gt;(element) || !rel.contains(&quot;alternate&quot;))
-                        m_preferredStylesheetSetName = m_selectedStylesheetSetName = title;
-                }
-                if (title != m_preferredStylesheetSetName)
-                    sheet = nullptr;
-            }
-
-            if (rel.contains(&quot;alternate&quot;) &amp;&amp; title.isEmpty())
-                sheet = nullptr;
-        }
-        if (sheet)
-            sheets.append(sheet);
-    }
-}
-
-void DocumentStyleSheetCollection::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, StyleResolverUpdateType&amp; styleResolverUpdateType, bool&amp; requiresFullStyleRecalc)
-{
-    styleResolverUpdateType = Reconstruct;
-    requiresFullStyleRecalc = true;
-    
-    // Stylesheets of &lt;style&gt; elements that @import stylesheets are active but loading. We need to trigger a full recalc when such loads are done.
-    bool hasActiveLoadingStylesheet = false;
-    unsigned newStylesheetCount = newStylesheets.size();
-    for (unsigned i = 0; i &lt; newStylesheetCount; ++i) {
-        if (newStylesheets[i]-&gt;isLoading())
-            hasActiveLoadingStylesheet = true;
-    }
-    if (m_hadActiveLoadingStylesheet &amp;&amp; !hasActiveLoadingStylesheet) {
-        m_hadActiveLoadingStylesheet = false;
-        return;
-    }
-    m_hadActiveLoadingStylesheet = hasActiveLoadingStylesheet;
-
-    if (updateFlag != OptimizedUpdate)
-        return;
-    if (!m_document.styleResolverIfExists())
-        return;
-    StyleResolver&amp; styleResolver = *m_document.styleResolverIfExists();
-
-    // Find out which stylesheets are new.
-    unsigned oldStylesheetCount = m_activeAuthorStyleSheets.size();
-    if (newStylesheetCount &lt; oldStylesheetCount)
-        return;
-    Vector&lt;StyleSheetContents*&gt; addedSheets;
-    unsigned newIndex = 0;
-    for (unsigned oldIndex = 0; oldIndex &lt; oldStylesheetCount; ++oldIndex) {
-        if (newIndex &gt;= newStylesheetCount)
-            return;
-        while (m_activeAuthorStyleSheets[oldIndex] != newStylesheets[newIndex]) {
-            addedSheets.append(&amp;newStylesheets[newIndex]-&gt;contents());
-            ++newIndex;
-            if (newIndex == newStylesheetCount)
-                return;
-        }
-        ++newIndex;
-    }
-    bool hasInsertions = !addedSheets.isEmpty();
-    while (newIndex &lt; newStylesheetCount) {
-        addedSheets.append(&amp;newStylesheets[newIndex]-&gt;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.
-    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;
-    StyleInvalidationAnalysis invalidationAnalysis(addedSheets, styleResolver.mediaQueryEvaluator());
-    if (invalidationAnalysis.dirtiesAllStyle())
-        return;
-    invalidationAnalysis.invalidateStyle(m_document);
-    requiresFullStyleRecalc = false;
-}
-
-static void filterEnabledNonemptyCSSStyleSheets(Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; result, const Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; sheets)
-{
-    for (unsigned i = 0; i &lt; sheets.size(); ++i) {
-        if (!is&lt;CSSStyleSheet&gt;(*sheets[i]))
-            continue;
-        CSSStyleSheet&amp; sheet = downcast&lt;CSSStyleSheet&gt;(*sheets[i]);
-        if (sheet.disabled())
-            continue;
-        if (!sheet.length())
-            continue;
-        result.append(&amp;sheet);
-    }
-}
-
-bool DocumentStyleSheetCollection::updateActiveStyleSheets(UpdateFlag updateFlag)
-{
-    if (m_document.inStyleRecalc()) {
-        // SVG &lt;use&gt; element may manage to invalidate style selector in the middle of a style recalc.
-        // https://bugs.webkit.org/show_bug.cgi?id=54344
-        // FIXME: This should be fixed in SVG and the call site replaced by ASSERT(!m_inStyleRecalc).
-        m_pendingUpdateType = FullUpdate;
-        m_document.scheduleForcedStyleRecalc();
-        return false;
-
-    }
-    if (!m_document.hasLivingRenderTree())
-        return false;
-
-    Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; activeStyleSheets;
-    collectActiveStyleSheets(activeStyleSheets);
-
-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; activeCSSStyleSheets;
-    activeCSSStyleSheets.appendVector(injectedAuthorStyleSheets());
-    activeCSSStyleSheets.appendVector(documentAuthorStyleSheets());
-    filterEnabledNonemptyCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
-
-    StyleResolverUpdateType styleResolverUpdateType;
-    bool requiresFullStyleRecalc;
-    analyzeStyleSheetChange(updateFlag, activeCSSStyleSheets, styleResolverUpdateType, requiresFullStyleRecalc);
-
-    if (styleResolverUpdateType == Reconstruct)
-        m_document.clearStyleResolver();
-    else {
-        StyleResolver&amp; styleResolver = m_document.ensureStyleResolver();
-        if (styleResolverUpdateType == Reset) {
-            styleResolver.ruleSets().resetAuthorStyle();
-            styleResolver.appendAuthorStyleSheets(0, activeCSSStyleSheets);
-        } else {
-            ASSERT(styleResolverUpdateType == Additive);
-            styleResolver.appendAuthorStyleSheets(m_activeAuthorStyleSheets.size(), activeCSSStyleSheets);
-        }
-        resetCSSFeatureFlags();
-    }
-
-    m_weakCopyOfActiveStyleSheetListForFastLookup = nullptr;
-    m_activeAuthorStyleSheets.swap(activeCSSStyleSheets);
-    m_styleSheetsForStyleSheetList.swap(activeStyleSheets);
-
-    InspectorInstrumentation::activeStyleSheetsUpdated(m_document);
-
-    for (const auto&amp; sheet : m_activeAuthorStyleSheets) {
-        if (sheet-&gt;contents().usesRemUnits())
-            m_usesRemUnits = true;
-        if (sheet-&gt;contents().usesStyleBasedEditability())
-            m_usesStyleBasedEditability = true;
-    }
-    m_pendingUpdateType = NoUpdate;
-
-    return requiresFullStyleRecalc;
-}
-
-const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; DocumentStyleSheetCollection::activeStyleSheetsForInspector() const
-{
-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; result;
-
-    result.appendVector(injectedAuthorStyleSheets());
-    result.appendVector(documentAuthorStyleSheets());
-
-    for (auto&amp; styleSheet : m_styleSheetsForStyleSheetList) {
-        if (!is&lt;CSSStyleSheet&gt;(*styleSheet))
-            continue;
-
-        CSSStyleSheet&amp; sheet = downcast&lt;CSSStyleSheet&gt;(*styleSheet);
-        if (sheet.disabled())
-            continue;
-
-        result.append(&amp;sheet);
-    }
-
-    return result;
-}
-
-bool DocumentStyleSheetCollection::activeStyleSheetsContains(const CSSStyleSheet* sheet) const
-{
-    if (!m_weakCopyOfActiveStyleSheetListForFastLookup) {
-        m_weakCopyOfActiveStyleSheetListForFastLookup = std::make_unique&lt;HashSet&lt;const CSSStyleSheet*&gt;&gt;();
-        for (unsigned i = 0; i &lt; m_activeAuthorStyleSheets.size(); ++i)
-            m_weakCopyOfActiveStyleSheetListForFastLookup-&gt;add(m_activeAuthorStyleSheets[i].get());
-    }
-    return m_weakCopyOfActiveStyleSheetListForFastLookup-&gt;contains(sheet);
-}
-
-void DocumentStyleSheetCollection::detachFromDocument()
-{
-    if (m_pageUserSheet)
-        m_pageUserSheet-&gt;detachFromDocument();
-    for (unsigned i = 0; i &lt; m_injectedUserStyleSheets.size(); ++i)
-        m_injectedUserStyleSheets[i]-&gt;detachFromDocument();
-    for (unsigned i = 0; i &lt; m_injectedAuthorStyleSheets.size(); ++i)
-        m_injectedAuthorStyleSheets[i]-&gt;detachFromDocument();
-    for (unsigned i = 0; i &lt; m_userStyleSheets.size(); ++i)
-        m_userStyleSheets[i]-&gt;detachFromDocument();
-    for (unsigned i = 0; i &lt; m_authorStyleSheets.size(); ++i)
-        m_authorStyleSheets[i]-&gt;detachFromDocument();
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoredomDocumentStyleSheetCollectionh"></a>
<div class="delfile"><h4>Deleted: trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -1,190 +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, 2005, 2006, 2007, 2008, 2009, 2010, 2012, 2013 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 DocumentStyleSheetCollection_h
-#define DocumentStyleSheetCollection_h
-
-#include &quot;Timer.h&quot;
-#include &lt;memory&gt;
-#include &lt;wtf/FastMalloc.h&gt;
-#include &lt;wtf/HashMap.h&gt;
-#include &lt;wtf/ListHashSet.h&gt;
-#include &lt;wtf/RefPtr.h&gt;
-#include &lt;wtf/Vector.h&gt;
-#include &lt;wtf/text/WTFString.h&gt;
-
-#if ENABLE(CONTENT_EXTENSIONS)
-#include &quot;ContentExtensionStyleSheet.h&quot;
-#endif
-
-namespace WebCore {
-
-class CSSStyleSheet;
-class Document;
-class Node;
-class StyleSheet;
-class StyleSheetContents;
-class StyleSheetList;
-
-class DocumentStyleSheetCollection {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    explicit DocumentStyleSheetCollection(Document&amp;);
-
-    const Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp; styleSheetsForStyleSheetList() const { return m_styleSheetsForStyleSheetList; }
-
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; activeAuthorStyleSheets() const { return m_activeAuthorStyleSheets; }
-
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; activeStyleSheetsForInspector() const;
-
-    CSSStyleSheet* pageUserSheet();
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; documentUserStyleSheets() const { return m_userStyleSheets; }
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; documentAuthorStyleSheets() const { return m_authorStyleSheets; }
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; injectedUserStyleSheets() const;
-    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; injectedAuthorStyleSheets() const;
-
-    void addStyleSheetCandidateNode(Node&amp;, bool createdByParser);
-    void removeStyleSheetCandidateNode(Node&amp;);
-
-    void clearPageUserSheet();
-    void updatePageUserSheet();
-    void invalidateInjectedStyleSheetCache();
-    void updateInjectedStyleSheetCache() const;
-
-    WEBCORE_EXPORT void addAuthorSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; authorSheet);
-    WEBCORE_EXPORT void addUserSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet);
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    void addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID);
-    void maybeAddContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp;);
-#endif
-
-    enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
-
-    UpdateFlag pendingUpdateType() const { return m_pendingUpdateType; }
-    void setPendingUpdateType(UpdateFlag updateType)
-    {
-        if (updateType &gt; m_pendingUpdateType)
-            m_pendingUpdateType = updateType;
-    }
-
-    void flushPendingUpdates()
-    {
-        if (m_pendingUpdateType != NoUpdate)
-            updateActiveStyleSheets(m_pendingUpdateType);
-    }
-
-    bool updateActiveStyleSheets(UpdateFlag);
-
-    String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
-    String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
-    void setPreferredStylesheetSetName(const String&amp; name) { m_preferredStylesheetSetName = name; }
-    void setSelectedStylesheetSetName(const String&amp; name) { m_selectedStylesheetSetName = name; }
-
-    void addPendingSheet() { m_pendingStylesheets++; }
-    enum RemovePendingSheetNotificationType {
-        RemovePendingSheetNotifyImmediately,
-        RemovePendingSheetNotifyLater
-    };
-    void removePendingSheet(RemovePendingSheetNotificationType = RemovePendingSheetNotifyImmediately);
-
-    bool hasPendingSheets() const { return m_pendingStylesheets &gt; 0; }
-
-    bool usesFirstLineRules() const { return m_usesFirstLineRules; }
-    bool usesFirstLetterRules() const { return m_usesFirstLetterRules; }
-    bool usesRemUnits() const { return m_usesRemUnits; }
-    void setUsesRemUnit(bool b) { m_usesRemUnits = b; }
-    bool usesStyleBasedEditability() { return m_usesStyleBasedEditability; }
-    void setUsesStyleBasedEditability(bool b) { m_usesStyleBasedEditability = b; }
-
-    void combineCSSFeatureFlags();
-    void resetCSSFeatureFlags();
-
-    bool activeStyleSheetsContains(const CSSStyleSheet*) const;
-
-    void detachFromDocument();
-
-private:
-    void collectActiveStyleSheets(Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp;);
-    enum StyleResolverUpdateType {
-        Reconstruct,
-        Reset,
-        Additive
-    };
-    void analyzeStyleSheetChange(UpdateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, StyleResolverUpdateType&amp;, bool&amp; requiresFullStyleRecalc);
-
-    void styleResolverChangedTimerFired();
-
-    Document&amp; m_document;
-
-    Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; m_styleSheetsForStyleSheetList;
-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_activeAuthorStyleSheets;
-
-    // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().
-    mutable std::unique_ptr&lt;HashSet&lt;const CSSStyleSheet*&gt;&gt; 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_pendingStylesheets;
-
-    RefPtr&lt;CSSStyleSheet&gt; m_pageUserSheet;
-
-    mutable Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_injectedUserStyleSheets;
-    mutable Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_injectedAuthorStyleSheets;
-    mutable bool m_injectedStyleSheetCacheValid;
-
-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_userStyleSheets;
-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_authorStyleSheets;
-
-#if ENABLE(CONTENT_EXTENSIONS)
-    HashMap&lt;String, RefPtr&lt;CSSStyleSheet&gt;&gt; m_contentExtensionSheets;
-    HashMap&lt;String, RefPtr&lt;ContentExtensions::ContentExtensionStyleSheet&gt;&gt; m_contentExtensionSelectorSheets;
-#endif
-
-    bool m_hadActiveLoadingStylesheet;
-    UpdateFlag m_pendingUpdateType;
-
-    typedef ListHashSet&lt;Node*&gt; StyleSheetCandidateListHashSet;
-    StyleSheetCandidateListHashSet m_styleSheetCandidateNodes;
-
-    String m_preferredStylesheetSetName;
-    String m_selectedStylesheetSetName;
-
-    bool m_usesFirstLineRules;
-    bool m_usesFirstLetterRules;
-    bool m_usesRemUnits;
-    bool m_usesStyleBasedEditability;
-
-    Timer m_styleResolverChangedTimer;
-};
-
-}
-
-#endif
-
</del></span></pre></div>
<a id="trunkSourceWebCoredomExtensionStyleSheetscppfromrev190074trunkSourceWebCoredomDocumentStyleSheetCollectioncpp"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp (from rev 190074, trunk/Source/WebCore/dom/DocumentStyleSheetCollection.cpp) (0 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp                                (rev 0)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -0,0 +1,220 @@
</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 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 &quot;config.h&quot;
+#include &quot;ExtensionStyleSheets.h&quot;
+
+#include &quot;CSSStyleSheet.h&quot;
+#include &quot;Element.h&quot;
+#include &quot;HTMLIFrameElement.h&quot;
+#include &quot;HTMLLinkElement.h&quot;
+#include &quot;HTMLStyleElement.h&quot;
+#include &quot;InspectorInstrumentation.h&quot;
+#include &quot;Page.h&quot;
+#include &quot;PageGroup.h&quot;
+#include &quot;ProcessingInstruction.h&quot;
+#include &quot;SVGNames.h&quot;
+#include &quot;SVGStyleElement.h&quot;
+#include &quot;Settings.h&quot;
+#include &quot;StyleInvalidationAnalysis.h&quot;
+#include &quot;StyleResolver.h&quot;
+#include &quot;StyleSheetContents.h&quot;
+#include &quot;StyleSheetList.h&quot;
+#include &quot;UserContentController.h&quot;
+#include &quot;UserContentURLPattern.h&quot;
+#include &quot;UserStyleSheet.h&quot;
+
+namespace WebCore {
+
+using namespace ContentExtensions;
+using namespace HTMLNames;
+
+ExtensionStyleSheets::ExtensionStyleSheets(Document&amp; document)
+    : m_document(document)
+    , m_styleResolverChangedTimer(*this, &amp;ExtensionStyleSheets::styleResolverChangedTimerFired)
+{
+}
+
+CSSStyleSheet* ExtensionStyleSheets::pageUserSheet()
+{
+    if (m_pageUserSheet)
+        return m_pageUserSheet.get();
+    
+    Page* owningPage = m_document.page();
+    if (!owningPage)
+        return 0;
+    
+    String userSheetText = owningPage-&gt;userStyleSheet();
+    if (userSheetText.isEmpty())
+        return 0;
+    
+    // Parse the sheet and cache it.
+    m_pageUserSheet = CSSStyleSheet::createInline(m_document, m_document.settings()-&gt;userStyleSheetLocation());
+    m_pageUserSheet-&gt;contents().setIsUserStyleSheet(true);
+    m_pageUserSheet-&gt;contents().parseString(userSheetText);
+    return m_pageUserSheet.get();
+}
+
+void ExtensionStyleSheets::clearPageUserSheet()
+{
+    if (m_pageUserSheet) {
+        m_pageUserSheet = nullptr;
+        m_document.styleResolverChanged(DeferRecalcStyle);
+    }
+}
+
+void ExtensionStyleSheets::updatePageUserSheet()
+{
+    clearPageUserSheet();
+    if (pageUserSheet())
+        m_document.styleResolverChanged(RecalcStyleImmediately);
+}
+
+const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; ExtensionStyleSheets::injectedUserStyleSheets() const
+{
+    updateInjectedStyleSheetCache();
+    return m_injectedUserStyleSheets;
+}
+
+const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; ExtensionStyleSheets::injectedAuthorStyleSheets() const
+{
+    updateInjectedStyleSheetCache();
+    return m_injectedAuthorStyleSheets;
+}
+
+void ExtensionStyleSheets::updateInjectedStyleSheetCache() const
+{
+    if (m_injectedStyleSheetCacheValid)
+        return;
+    m_injectedStyleSheetCacheValid = true;
+    m_injectedUserStyleSheets.clear();
+    m_injectedAuthorStyleSheets.clear();
+
+    Page* owningPage = m_document.page();
+    if (!owningPage)
+        return;
+
+    const auto* userContentController = owningPage-&gt;userContentController();
+    if (!userContentController)
+        return;
+
+    const UserStyleSheetMap* userStyleSheets = userContentController-&gt;userStyleSheets();
+    if (!userStyleSheets)
+        return;
+
+    for (auto&amp; styleSheets : userStyleSheets-&gt;values()) {
+        for (const auto&amp; sheet : *styleSheets) {
+            if (sheet-&gt;injectedFrames() == InjectInTopFrameOnly &amp;&amp; m_document.ownerElement())
+                continue;
+
+            if (!UserContentURLPattern::matchesPatterns(m_document.url(), sheet-&gt;whitelist(), sheet-&gt;blacklist()))
+                continue;
+
+            RefPtr&lt;CSSStyleSheet&gt; groupSheet = CSSStyleSheet::createInline(const_cast&lt;Document&amp;&gt;(m_document), sheet-&gt;url());
+            bool isUserStyleSheet = sheet-&gt;level() == UserStyleUserLevel;
+            if (isUserStyleSheet)
+                m_injectedUserStyleSheets.append(groupSheet);
+            else
+                m_injectedAuthorStyleSheets.append(groupSheet);
+
+            groupSheet-&gt;contents().setIsUserStyleSheet(isUserStyleSheet);
+            groupSheet-&gt;contents().parseString(sheet-&gt;source());
+        }
+    }
+}
+
+void ExtensionStyleSheets::invalidateInjectedStyleSheetCache()
+{
+    if (!m_injectedStyleSheetCacheValid)
+        return;
+    m_injectedStyleSheetCacheValid = false;
+    if (m_injectedUserStyleSheets.isEmpty() &amp;&amp; m_injectedAuthorStyleSheets.isEmpty())
+        return;
+    m_document.styleResolverChanged(DeferRecalcStyle);
+}
+
+void ExtensionStyleSheets::addUserStyleSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet)
+{
+    ASSERT(userSheet.get().isUserStyleSheet());
+    m_userStyleSheets.append(CSSStyleSheet::create(WTF::move(userSheet), &amp;m_document));
+    m_document.styleResolverChanged(RecalcStyleImmediately);
+}
+
+void ExtensionStyleSheets::addAuthorStyleSheetForTesting(Ref&lt;StyleSheetContents&gt;&amp;&amp; authorSheet)
+{
+    ASSERT(!authorSheet.get().isUserStyleSheet());
+    m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTF::move(authorSheet), &amp;m_document));
+    m_document.styleResolverChanged(RecalcStyleImmediately);
+}
+
+#if ENABLE(CONTENT_EXTENSIONS)
+void ExtensionStyleSheets::addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID)
+{
+    auto result = m_contentExtensionSelectorSheets.add(identifier, nullptr);
+    if (result.isNewEntry) {
+        result.iterator-&gt;value = ContentExtensionStyleSheet::create(m_document);
+        m_userStyleSheets.append(&amp;result.iterator-&gt;value-&gt;styleSheet());
+    }
+
+    result.iterator-&gt;value-&gt;addDisplayNoneSelector(selector, selectorID);
+    m_styleResolverChangedTimer.startOneShot(0);
+}
+
+void ExtensionStyleSheets::maybeAddContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp; sheet)
+{
+    ASSERT(sheet.isUserStyleSheet());
+
+    if (m_contentExtensionSheets.contains(identifier))
+        return;
+
+    Ref&lt;CSSStyleSheet&gt; cssSheet = CSSStyleSheet::create(sheet, &amp;m_document);
+    m_contentExtensionSheets.set(identifier, &amp;cssSheet.get());
+    m_userStyleSheets.append(adoptRef(cssSheet.leakRef()));
+    m_styleResolverChangedTimer.startOneShot(0);
+}
+#endif // ENABLE(CONTENT_EXTENSIONS)
+
+void ExtensionStyleSheets::styleResolverChangedTimerFired()
+{
+    m_document.styleResolverChanged(RecalcStyleImmediately);
+}
+
+void ExtensionStyleSheets::detachFromDocument()
+{
+    if (m_pageUserSheet)
+        m_pageUserSheet-&gt;detachFromDocument();
+    for (auto&amp; sheet : m_injectedUserStyleSheets)
+        sheet-&gt;detachFromDocument();
+    for (auto&amp; sheet :  m_injectedAuthorStyleSheets)
+        sheet-&gt;detachFromDocument();
+    for (auto&amp; sheet : m_userStyleSheets)
+        sheet-&gt;detachFromDocument();
+    for (auto&amp; sheet : m_authorStyleSheetsForTesting)
+        sheet-&gt;detachFromDocument();
+}
+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoredomExtensionStyleSheetshfromrev190074trunkSourceWebCoredomDocumentStyleSheetCollectionh"></a>
<div class="copfile"><h4>Copied: trunk/Source/WebCore/dom/ExtensionStyleSheets.h (from rev 190074, trunk/Source/WebCore/dom/DocumentStyleSheetCollection.h) (0 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExtensionStyleSheets.h                                (rev 0)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -0,0 +1,105 @@
</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 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 ExtensionStyleSheets_h
+#define ExtensionStyleSheets_h
+
+#include &quot;Timer.h&quot;
+#include &lt;memory&gt;
+#include &lt;wtf/FastMalloc.h&gt;
+#include &lt;wtf/HashMap.h&gt;
+#include &lt;wtf/ListHashSet.h&gt;
+#include &lt;wtf/RefPtr.h&gt;
+#include &lt;wtf/Vector.h&gt;
+#include &lt;wtf/text/WTFString.h&gt;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+#include &quot;ContentExtensionStyleSheet.h&quot;
+#endif
+
+namespace WebCore {
+
+class CSSStyleSheet;
+class Document;
+class Node;
+class StyleSheet;
+class StyleSheetContents;
+class StyleSheetList;
+
+class ExtensionStyleSheets {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    explicit ExtensionStyleSheets(Document&amp;);
+
+    CSSStyleSheet* pageUserSheet();
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; documentUserStyleSheets() const { return m_userStyleSheets; }
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; injectedUserStyleSheets() const;
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; injectedAuthorStyleSheets() const;
+    const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; authorStyleSheetsForTesting() const { return m_authorStyleSheetsForTesting; }
+
+    void clearPageUserSheet();
+    void updatePageUserSheet();
+    void invalidateInjectedStyleSheetCache();
+    void updateInjectedStyleSheetCache() const;
+
+    WEBCORE_EXPORT void addUserStyleSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp;);
+
+    WEBCORE_EXPORT void addAuthorStyleSheetForTesting(Ref&lt;StyleSheetContents&gt;&amp;&amp;);
+
+#if ENABLE(CONTENT_EXTENSIONS)
+    void addDisplayNoneSelector(const String&amp; identifier, const String&amp; selector, uint32_t selectorID);
+    void maybeAddContentExtensionSheet(const String&amp; identifier, StyleSheetContents&amp;);
+#endif
+
+    void detachFromDocument();
+
+private:
+    void styleResolverChangedTimerFired();
+
+    Document&amp; m_document;
+
+    RefPtr&lt;CSSStyleSheet&gt; m_pageUserSheet;
+
+    mutable Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_injectedUserStyleSheets;
+    mutable Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_injectedAuthorStyleSheets;
+    mutable bool m_injectedStyleSheetCacheValid { false };
+
+    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_userStyleSheets;
+    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_authorStyleSheetsForTesting;
+
+#if ENABLE(CONTENT_EXTENSIONS)
+    HashMap&lt;String, RefPtr&lt;CSSStyleSheet&gt;&gt; m_contentExtensionSheets;
+    HashMap&lt;String, RefPtr&lt;ContentExtensions::ContentExtensionStyleSheet&gt;&gt; m_contentExtensionSelectorSheets;
+#endif
+
+    Timer m_styleResolverChangedTimer;
+};
+
+}
+
+#endif
+
</ins></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;InlineStyleSheetOwner.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;ContentSecurityPolicy.h&quot;
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;MediaList.h&quot;
</span><span class="lines">@@ -47,7 +48,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InlineStyleSheetOwner::insertedIntoDocument(Document&amp; document, Element&amp; element)
</span><span class="cx"> {
</span><del>-    document.styleSheetCollection().addStyleSheetCandidateNode(element, m_isParsingChildren);
</del><ins>+    document.authorStyleSheets().addStyleSheetCandidateNode(element, m_isParsingChildren);
</ins><span class="cx"> 
</span><span class="cx">     if (m_isParsingChildren)
</span><span class="cx">         return;
</span><span class="lines">@@ -56,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InlineStyleSheetOwner::removedFromDocument(Document&amp; document, Element&amp; element)
</span><span class="cx"> {
</span><del>-    document.styleSheetCollection().removeStyleSheetCandidateNode(element);
</del><ins>+    document.authorStyleSheets().removeStyleSheetCandidateNode(element);
</ins><span class="cx"> 
</span><span class="cx">     if (m_sheet)
</span><span class="cx">         clearSheet();
</span><span class="lines">@@ -73,7 +74,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!element.inDocument())
</span><span class="cx">         return;
</span><del>-    document.styleSheetCollection().removeStyleSheetCandidateNode(element);
</del><ins>+    document.authorStyleSheets().removeStyleSheetCandidateNode(element);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InlineStyleSheetOwner::childrenChanged(Element&amp; element)
</span><span class="lines">@@ -117,7 +118,7 @@
</span><span class="cx">     Document&amp; document = element.document();
</span><span class="cx">     if (m_sheet) {
</span><span class="cx">         if (m_sheet-&gt;isLoading())
</span><del>-            document.styleSheetCollection().removePendingSheet();
</del><ins>+            document.authorStyleSheets().removePendingSheet();
</ins><span class="cx">         clearSheet();
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -137,7 +138,7 @@
</span><span class="cx">     if (!screenEval.eval(mediaQueries.get()) &amp;&amp; !printEval.eval(mediaQueries.get()))
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    document.styleSheetCollection().addPendingSheet();
</del><ins>+    document.authorStyleSheets().addPendingSheet();
</ins><span class="cx"> 
</span><span class="cx">     m_loading = true;
</span><span class="cx"> 
</span><span class="lines">@@ -164,13 +165,13 @@
</span><span class="cx">     if (isLoading())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    document.styleSheetCollection().removePendingSheet();
</del><ins>+    document.authorStyleSheets().removePendingSheet();
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InlineStyleSheetOwner::startLoadingDynamicSheet(Document&amp; document)
</span><span class="cx"> {
</span><del>-    document.styleSheetCollection().addPendingSheet();
</del><ins>+    document.authorStyleSheets().addPendingSheet();
</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 (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -22,6 +22,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ProcessingInstruction.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CachedCSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="lines">@@ -66,7 +67,7 @@
</span><span class="cx">         m_cachedSheet-&gt;removeClient(this);
</span><span class="cx"> 
</span><span class="cx">     if (inDocument())
</span><del>-        document().styleSheetCollection().removeStyleSheetCandidateNode(*this);
</del><ins>+        document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String ProcessingInstruction::nodeName() const
</span><span class="lines">@@ -142,7 +143,7 @@
</span><span class="cx">                 return;
</span><span class="cx">             
</span><span class="cx">             m_loading = true;
</span><del>-            document().styleSheetCollection().addPendingSheet();
</del><ins>+            document().authorStyleSheets().addPendingSheet();
</ins><span class="cx">             
</span><span class="cx">             CachedResourceRequest request(ResourceRequest(document().completeURL(href)));
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="lines">@@ -163,7 +164,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().styleSheetCollection().removePendingSheet();
</del><ins>+                document().authorStyleSheets().removePendingSheet();
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="lines">@@ -181,7 +182,7 @@
</span><span class="cx"> bool ProcessingInstruction::sheetLoaded()
</span><span class="cx"> {
</span><span class="cx">     if (!isLoading()) {
</span><del>-        document().styleSheetCollection().removePendingSheet();
</del><ins>+        document().authorStyleSheets().removePendingSheet();
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="lines">@@ -265,7 +266,7 @@
</span><span class="cx">     CharacterData::insertedInto(insertionPoint);
</span><span class="cx">     if (!insertionPoint.inDocument())
</span><span class="cx">         return InsertionDone;
</span><del>-    document().styleSheetCollection().addStyleSheetCandidateNode(*this, m_createdByParser);
</del><ins>+    document().authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);
</ins><span class="cx">     checkStyleSheet();
</span><span class="cx">     return InsertionDone;
</span><span class="cx"> }
</span><span class="lines">@@ -276,7 +277,7 @@
</span><span class="cx">     if (!insertionPoint.inDocument())
</span><span class="cx">         return;
</span><span class="cx">     
</span><del>-    document().styleSheetCollection().removeStyleSheetCandidateNode(*this);
</del><ins>+    document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</ins><span class="cx"> 
</span><span class="cx">     if (m_sheet) {
</span><span class="cx">         ASSERT(m_sheet-&gt;ownerNode() == this);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -27,12 +27,12 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Attribute.h&quot;
</span><span class="cx"> #include &quot;AttributeDOMTokenList.h&quot;
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CachedCSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CachedResource.h&quot;
</span><span class="cx"> #include &quot;CachedResourceLoader.h&quot;
</span><span class="cx"> #include &quot;CachedResourceRequest.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;Event.h&quot;
</span><span class="cx"> #include &quot;EventSender.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="lines">@@ -94,7 +94,7 @@
</span><span class="cx">         m_cachedSheet-&gt;removeClient(this);
</span><span class="cx"> 
</span><span class="cx">     if (inDocument())
</span><del>-        document().styleSheetCollection().removeStyleSheetCandidateNode(*this);
</del><ins>+        document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</ins><span class="cx"> 
</span><span class="cx">     linkLoadEventSender().cancelEvent(*this);
</span><span class="cx"> }
</span><span class="lines">@@ -279,7 +279,7 @@
</span><span class="cx">     if (m_isInShadowTree)
</span><span class="cx">         return InsertionDone;
</span><span class="cx"> 
</span><del>-    document().styleSheetCollection().addStyleSheetCandidateNode(*this, m_createdByParser);
</del><ins>+    document().authorStyleSheets().addStyleSheetCandidateNode(*this, m_createdByParser);
</ins><span class="cx"> 
</span><span class="cx">     process();
</span><span class="cx">     return InsertionDone;
</span><span class="lines">@@ -295,7 +295,7 @@
</span><span class="cx">         ASSERT(!m_sheet);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-    document().styleSheetCollection().removeStyleSheetCandidateNode(*this);
</del><ins>+    document().authorStyleSheets().removeStyleSheetCandidateNode(*this);
</ins><span class="cx"> 
</span><span class="cx">     if (m_sheet)
</span><span class="cx">         clearSheet();
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (m_pendingSheetType == InactiveSheet)
</span><span class="cx">         return;
</span><del>-    document().styleSheetCollection().addPendingSheet();
</del><ins>+    document().authorStyleSheets().addPendingSheet();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void HTMLLinkElement::removePendingSheet(RemovePendingSheetNotificationType notification)
</span><span class="lines">@@ -527,14 +527,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().styleSheetCollection().updateActiveStyleSheets(DocumentStyleSheetCollection::OptimizedUpdate);
</del><ins>+        document().authorStyleSheets().updateActiveStyleSheets(AuthorStyleSheets::OptimizedUpdate);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    document().styleSheetCollection().removePendingSheet(
</del><ins>+    document().authorStyleSheets().removePendingSheet(
</ins><span class="cx">         notification == RemovePendingSheetNotifyImmediately
</span><del>-        ? DocumentStyleSheetCollection::RemovePendingSheetNotifyImmediately
-        : DocumentStyleSheetCollection::RemovePendingSheetNotifyLater);
</del><ins>+        ? AuthorStyleSheets::RemovePendingSheetNotifyImmediately
+        : AuthorStyleSheets::RemovePendingSheetNotifyLater);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLQuoteElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLQuoteElement.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLQuoteElement.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/html/HTMLQuoteElement.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include &quot;HTMLQuoteElement.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;HTMLNames.h&quot;
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;InspectorCSSAgent.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSComputedStyleDeclaration.h&quot;
</span><span class="cx"> #include &quot;CSSImportRule.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="lines">@@ -665,7 +666,7 @@
</span><span class="cx"> 
</span><span class="cx"> void InspectorCSSAgent::collectAllDocumentStyleSheets(Document&amp; document, Vector&lt;CSSStyleSheet*&gt;&amp; result)
</span><span class="cx"> {
</span><del>-    Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; cssStyleSheets = document.styleSheetCollection().activeStyleSheetsForInspector();
</del><ins>+    auto cssStyleSheets = document.authorStyleSheets().activeStyleSheetsForInspector();
</ins><span class="cx">     for (auto&amp; cssStyleSheet : cssStyleSheets)
</span><span class="cx">         collectStyleSheets(cssStyleSheet.get(), result);
</span><span class="cx"> }
</span><span class="lines">@@ -1015,7 +1016,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().styleSheetCollection());
</del><ins>+    CSSStyleRule* cssomWrapper = styleResolver.inspectorCSSOMWrappers().getWrapperForRuleInSheets(styleRule, styleResolver.document().authorStyleSheets(), styleResolver.document().extensionStyleSheets());
</ins><span class="cx">     if (!cssomWrapper)
</span><span class="cx">         return nullptr;
</span><span class="cx">     InspectorStyleSheet* inspectorStyleSheet = bindStyleSheet(cssomWrapper-&gt;parentStyleSheet());
</span></span></pre></div>
<a id="trunkSourceWebCoreloaderDocumentLoadercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/DocumentLoader.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/loader/DocumentLoader.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -40,6 +40,7 @@
</span><span class="cx"> #include &quot;DocumentParser.h&quot;
</span><span class="cx"> #include &quot;DocumentWriter.h&quot;
</span><span class="cx"> #include &quot;Event.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;FormState.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="cx"> #include &quot;FrameLoaderClient.h&quot;
</span><span class="lines">@@ -845,13 +846,13 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><del>-    DocumentStyleSheetCollection&amp; styleSheetCollection = m_frame-&gt;document()-&gt;styleSheetCollection();
</del><ins>+    auto&amp; extensionStyleSheets = m_frame-&gt;document()-&gt;extensionStyleSheets();
</ins><span class="cx"> 
</span><span class="cx">     for (auto&amp; pendingStyleSheet : m_pendingNamedContentExtensionStyleSheets)
</span><del>-        styleSheetCollection.maybeAddContentExtensionSheet(pendingStyleSheet.key, *pendingStyleSheet.value);
</del><ins>+        extensionStyleSheets.maybeAddContentExtensionSheet(pendingStyleSheet.key, *pendingStyleSheet.value);
</ins><span class="cx">     for (auto&amp; pendingSelectorEntry : m_pendingContentExtensionDisplayNoneSelectors) {
</span><span class="cx">         for (const auto&amp; pendingSelector : pendingSelectorEntry.value)
</span><del>-            styleSheetCollection.addDisplayNoneSelector(pendingSelectorEntry.key, pendingSelector.first, pendingSelector.second);
</del><ins>+            extensionStyleSheets.addDisplayNoneSelector(pendingSelectorEntry.key, pendingSelector.first, pendingSelector.second);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     m_pendingNamedContentExtensionStyleSheets.clear();
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/page/Page.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include &quot;ContextMenuController.h&quot;
</span><span class="cx"> #include &quot;DatabaseProvider.h&quot;
</span><span class="cx"> #include &quot;DocumentMarkerController.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;DragController.h&quot;
</span><span class="cx"> #include &quot;Editor.h&quot;
</span><span class="cx"> #include &quot;EditorClient.h&quot;
</span><span class="lines">@@ -40,6 +39,7 @@
</span><span class="cx"> #include &quot;EventNames.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><span class="cx"> #include &quot;ExceptionCodePlaceholder.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;FileSystem.h&quot;
</span><span class="cx"> #include &quot;FocusController.h&quot;
</span><span class="cx"> #include &quot;FrameLoader.h&quot;
</span><span class="lines">@@ -1013,7 +1013,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (Frame* frame = &amp;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (frame-&gt;document())
</span><del>-            frame-&gt;document()-&gt;styleSheetCollection().updatePageUserSheet();
</del><ins>+            frame-&gt;document()-&gt;extensionStyleSheets().updatePageUserSheet();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1631,7 +1631,7 @@
</span><span class="cx"> 
</span><span class="cx">     for (Frame* frame = &amp;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (Document *document = frame-&gt;document()) {
</span><del>-            document-&gt;styleSheetCollection().invalidateInjectedStyleSheetCache();
</del><ins>+            document-&gt;extensionStyleSheets().invalidateInjectedStyleSheetCache();
</ins><span class="cx">             document-&gt;styleResolverChanged(DeferRecalcStyle);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageGroupcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/PageGroup.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/PageGroup.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/page/PageGroup.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -30,7 +30,6 @@
</span><span class="cx"> #include &quot;ChromeClient.h&quot;
</span><span class="cx"> #include &quot;DOMWrapperWorld.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><del>-#include &quot;DocumentStyleSheetCollection.h&quot;
</del><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;PageCache.h&quot;
</span></span></pre></div>
<a id="trunkSourceWebCorepageUserContentControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/UserContentController.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/UserContentController.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/page/UserContentController.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;DOMWrapperWorld.h&quot;
</span><span class="cx"> #include &quot;Document.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;MainFrame.h&quot;
</span><span class="cx"> #include &quot;Page.h&quot;
</span><span class="cx"> #include &quot;ResourceLoadInfo.h&quot;
</span><span class="lines">@@ -243,7 +244,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (auto&amp; page : m_pages) {
</span><span class="cx">         for (Frame* frame = &amp;page-&gt;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><del>-            frame-&gt;document()-&gt;styleSheetCollection().invalidateInjectedStyleSheetCache();
</del><ins>+            frame-&gt;document()-&gt;extensionStyleSheets().invalidateInjectedStyleSheetCache();
</ins><span class="cx">             frame-&gt;document()-&gt;styleResolverChanged(DeferRecalcStyle);
</span><span class="cx">         }
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -2824,7 +2824,7 @@
</span><span class="cx">     if (isReplaced() &amp;&amp; linePositionMode == PositionOnContainingLine)
</span><span class="cx">         return RenderBox::lineHeight(firstLine, direction, linePositionMode);
</span><span class="cx"> 
</span><del>-    if (firstLine &amp;&amp; document().styleSheetCollection().usesFirstLineRules()) {
</del><ins>+    if (firstLine &amp;&amp; view().usesFirstLineRules()) {
</ins><span class="cx">         RenderStyle&amp; s = firstLine ? firstLineStyle() : style();
</span><span class="cx">         if (&amp;s != &amp;style())
</span><span class="cx">             return s.computedLineHeight();
</span><span class="lines">@@ -3161,7 +3161,7 @@
</span><span class="cx">     firstLetter = nullptr;
</span><span class="cx">     firstLetterContainer = nullptr;
</span><span class="cx"> 
</span><del>-    if (!document().styleSheetCollection().usesFirstLetterRules())
</del><ins>+    if (!view().usesFirstLetterRules())
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // Don't recur
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -232,7 +232,7 @@
</span><span class="cx"> 
</span><span class="cx"> PassRefPtr&lt;RenderStyle&gt; RenderElement::uncachedFirstLineStyle(RenderStyle* style) const
</span><span class="cx"> {
</span><del>-    if (!document().styleSheetCollection().usesFirstLineRules())
</del><ins>+    if (!view().usesFirstLineRules())
</ins><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     return firstLineStyleForCachedUncachedType(Uncached, *this, style);
</span><span class="lines">@@ -240,7 +240,7 @@
</span><span class="cx"> 
</span><span class="cx"> RenderStyle* RenderElement::cachedFirstLineStyle() const
</span><span class="cx"> {
</span><del>-    ASSERT(document().styleSheetCollection().usesFirstLineRules());
</del><ins>+    ASSERT(view().usesFirstLineRules());
</ins><span class="cx"> 
</span><span class="cx">     RenderStyle&amp; style = this-&gt;style();
</span><span class="cx">     if (RefPtr&lt;RenderStyle&gt; firstLineStyle = firstLineStyleForCachedUncachedType(Cached, *this, &amp;style))
</span><span class="lines">@@ -249,6 +249,11 @@
</span><span class="cx">     return &amp;style;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RenderStyle&amp; RenderElement::firstLineStyle() const
+{
+    return view().usesFirstLineRules() ? *cachedFirstLineStyle() : style();
+}
+
</ins><span class="cx"> StyleDifference RenderElement::adjustStyleDifference(StyleDifference diff, unsigned contextSensitiveProperties) const
</span><span class="cx"> {
</span><span class="cx">     // If transform changed, and we are not composited, need to do a layout.
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderElementh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderElement.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderElement.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderElement.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -346,11 +346,6 @@
</span><span class="cx">     setStyle(WTF::move(animatedStyle), minimalStyleDifference);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline RenderStyle&amp; RenderElement::firstLineStyle() const
-{
-    return document().styleSheetCollection().usesFirstLineRules() ? *cachedFirstLineStyle() : style();
-}
-
</del><span class="cx"> inline void RenderElement::setAncestorLineBoxDirty(bool f)
</span><span class="cx"> {
</span><span class="cx">     m_ancestorLineBoxDirty = f;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderInlinecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderInline.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderInline.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderInline.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -219,7 +219,7 @@
</span><span class="cx">         || parentStyle-&gt;lineHeight() != style().lineHeight()))
</span><span class="cx">         || (flowThread &amp;&amp; flowThread-&gt;isRenderNamedFlowThread()); // FIXME: Enable the optimization once we make overflow computation for culled inlines in regions.
</span><span class="cx"> 
</span><del>-    if (!alwaysCreateLineBoxes &amp;&amp; checkFonts &amp;&amp; document().styleSheetCollection().usesFirstLineRules()) {
</del><ins>+    if (!alwaysCreateLineBoxes &amp;&amp; checkFonts &amp;&amp; view().usesFirstLineRules()) {
</ins><span class="cx">         // Have to check the first line style as well.
</span><span class="cx">         parentStyle = &amp;parent()-&gt;firstLineStyle();
</span><span class="cx">         RenderStyle&amp; childStyle = firstLineStyle();
</span><span class="lines">@@ -1457,7 +1457,7 @@
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderInline::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
</span><span class="cx"> {
</span><del>-    if (firstLine &amp;&amp; document().styleSheetCollection().usesFirstLineRules()) {
</del><ins>+    if (firstLine &amp;&amp; view().usesFirstLineRules()) {
</ins><span class="cx">         const RenderStyle&amp; firstLineStyle = this-&gt;firstLineStyle();
</span><span class="cx">         if (&amp;firstLineStyle != &amp;style())
</span><span class="cx">             return firstLineStyle.computedLineHeight();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderLineBreakcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderLineBreak.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderLineBreak.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderLineBreak.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> LayoutUnit RenderLineBreak::lineHeight(bool firstLine, LineDirectionMode /*direction*/, LinePositionMode /*linePositionMode*/) const
</span><span class="cx"> {
</span><del>-    if (firstLine &amp;&amp; document().styleSheetCollection().usesFirstLineRules()) {
</del><ins>+    if (firstLine &amp;&amp; view().usesFirstLineRules()) {
</ins><span class="cx">         const RenderStyle&amp; firstLineStyle = this-&gt;firstLineStyle();
</span><span class="cx">         if (&amp;firstLineStyle != &amp;style())
</span><span class="cx">             return firstLineStyle.computedLineHeight();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderView.h (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderView.h        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RenderView.h        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -187,6 +187,11 @@
</span><span class="cx">     WEBCORE_EXPORT RenderLayerCompositor&amp; compositor();
</span><span class="cx">     WEBCORE_EXPORT bool usesCompositing() const;
</span><span class="cx"> 
</span><ins>+    bool usesFirstLineRules() const { return m_usesFirstLineRules; }
+    bool usesFirstLetterRules() const { return m_usesFirstLetterRules; }
+    void setUsesFirstLineRules(bool value) { m_usesFirstLineRules = value; }
+    void setUsesFirstLetterRules(bool value) { m_usesFirstLetterRules = value; }
+
</ins><span class="cx">     WEBCORE_EXPORT IntRect unscaledDocumentRect() const;
</span><span class="cx">     LayoutRect unextendedBackgroundRect() const;
</span><span class="cx">     LayoutRect backgroundRect() const;
</span><span class="lines">@@ -369,6 +374,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool m_selectionWasCaret;
</span><span class="cx">     bool m_hasSoftwareFilters;
</span><ins>+    bool m_usesFirstLineRules { false };
+    bool m_usesFirstLetterRules { false };
</ins><span class="cx"> 
</span><span class="cx">     HashSet&lt;RenderElement*&gt; m_renderersWithPausedImageAnimation;
</span><span class="cx">     Vector&lt;RefPtr&lt;RenderWidget&gt;&gt; m_protectedRenderWidgets;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRootInlineBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RootInlineBox.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -999,7 +999,7 @@
</span><span class="cx"> 
</span><span class="cx">     // This method determines the vertical position for inline elements.
</span><span class="cx">     bool firstLine = isFirstLine();
</span><del>-    if (firstLine &amp;&amp; !renderer-&gt;document().styleSheetCollection().usesFirstLineRules())
</del><ins>+    if (firstLine &amp;&amp; !blockFlow().view().usesFirstLineRules())
</ins><span class="cx">         firstLine = false;
</span><span class="cx"> 
</span><span class="cx">     // Check the cache.
</span></span></pre></div>
<a id="trunkSourceWebCorestyleStyleResolveTreecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/style/StyleResolveTree.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/style/StyleResolveTree.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/style/StyleResolveTree.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><span class="cx"> #include &quot;AnimationController.h&quot;
</span><ins>+#include &quot;AuthorStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;CSSFontSelector.h&quot;
</span><span class="cx"> #include &quot;ElementIterator.h&quot;
</span><span class="cx"> #include &quot;ElementRareData.h&quot;
</span><span class="lines">@@ -685,7 +686,7 @@
</span><span class="cx"> 
</span><span class="cx">     // If &quot;rem&quot; units are used anywhere in the document, and if the document element's font size changes, then force font updating
</span><span class="cx">     // all the way down the tree. This is simpler than having to maintain a cache of objects (and such font size changes should be rare anyway).
</span><del>-    if (document.styleSheetCollection().usesRemUnits() &amp;&amp; document.documentElement() == &amp;current &amp;&amp; localChange != NoChange &amp;&amp; currentStyle &amp;&amp; newStyle &amp;&amp; currentStyle-&gt;fontSize() != newStyle-&gt;fontSize()) {
</del><ins>+    if (document.authorStyleSheets().usesRemUnits() &amp;&amp; document.documentElement() == &amp;current &amp;&amp; localChange != NoChange &amp;&amp; currentStyle &amp;&amp; newStyle &amp;&amp; currentStyle-&gt;fontSize() != newStyle-&gt;fontSize()) {
</ins><span class="cx">         // Cached RenderStyles may depend on the re units.
</span><span class="cx">         if (StyleResolver* styleResolver = document.styleResolverIfExists())
</span><span class="cx">             styleResolver-&gt;invalidateMatchedPropertiesCache();
</span><span class="lines">@@ -914,6 +915,8 @@
</span><span class="cx"> 
</span><span class="cx"> void resolveTree(Document&amp; document, Change change)
</span><span class="cx"> {
</span><ins>+    auto&amp; renderView = *document.renderView();
+
</ins><span class="cx">     if (change == Force) {
</span><span class="cx">         auto documentStyle = resolveForDocument(document);
</span><span class="cx"> 
</span><span class="lines">@@ -924,9 +927,9 @@
</span><span class="cx">                 documentStyle.get().fontCascade().update(&amp;document.fontSelector());
</span><span class="cx">         }
</span><span class="cx"> 
</span><del>-        Style::Change documentChange = determineChange(documentStyle.get(), document.renderView()-&gt;style());
</del><ins>+        Style::Change documentChange = determineChange(documentStyle.get(), renderView.style());
</ins><span class="cx">         if (documentChange != NoChange)
</span><del>-            document.renderView()-&gt;setStyle(WTF::move(documentStyle));
</del><ins>+            renderView.setStyle(WTF::move(documentStyle));
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     Element* documentElement = document.documentElement();
</span><span class="lines">@@ -934,8 +937,18 @@
</span><span class="cx">         return;
</span><span class="cx">     if (change &lt; Inherit &amp;&amp; !documentElement-&gt;childNeedsStyleRecalc() &amp;&amp; !documentElement-&gt;needsStyleRecalc())
</span><span class="cx">         return;
</span><del>-    RenderTreePosition renderTreePosition(*document.renderView());
</del><ins>+
+    auto&amp; styleResolved = document.ensureStyleResolver();
+
+    // Pseudo element removal and similar may only work with these flags still set. Reset them after the style recalc.
+    renderView.setUsesFirstLineRules(renderView.usesFirstLineRules() || styleResolved.usesFirstLineRules());
+    renderView.setUsesFirstLetterRules(renderView.usesFirstLetterRules() || styleResolved.usesFirstLetterRules());
+
+    RenderTreePosition renderTreePosition(renderView);
</ins><span class="cx">     resolveTree(*documentElement, *document.renderStyle(), renderTreePosition, change);
</span><ins>+
+    renderView.setUsesFirstLineRules(styleResolved.usesFirstLineRules());
+    renderView.setUsesFirstLetterRules(styleResolved.usesFirstLetterRules());
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void detachRenderTree(Element&amp; element)
</span></span></pre></div>
<a id="trunkSourceWebCoretestingInternalscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/testing/Internals.cpp (190168 => 190169)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/testing/Internals.cpp        2015-09-23 14:32:36 UTC (rev 190168)
+++ trunk/Source/WebCore/testing/Internals.cpp        2015-09-23 15:04:16 UTC (rev 190169)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #include &quot;Element.h&quot;
</span><span class="cx"> #include &quot;EventHandler.h&quot;
</span><span class="cx"> #include &quot;ExceptionCode.h&quot;
</span><ins>+#include &quot;ExtensionStyleSheets.h&quot;
</ins><span class="cx"> #include &quot;File.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> #include &quot;FormController.h&quot;
</span><span class="lines">@@ -1940,7 +1941,7 @@
</span><span class="cx">     auto parsedSheet = StyleSheetContents::create(*document);
</span><span class="cx">     parsedSheet.get().setIsUserStyleSheet(false);
</span><span class="cx">     parsedSheet.get().parseString(css);
</span><del>-    document-&gt;styleSheetCollection().addAuthorSheet(WTF::move(parsedSheet));
</del><ins>+    document-&gt;extensionStyleSheets().addAuthorStyleSheetForTesting(WTF::move(parsedSheet));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Internals::insertUserCSS(const String&amp; css, ExceptionCode&amp; ec) const
</span><span class="lines">@@ -1954,7 +1955,7 @@
</span><span class="cx">     auto parsedSheet = StyleSheetContents::create(*document);
</span><span class="cx">     parsedSheet.get().setIsUserStyleSheet(true);
</span><span class="cx">     parsedSheet.get().parseString(css);
</span><del>-    document-&gt;styleSheetCollection().addUserSheet(WTF::move(parsedSheet));
</del><ins>+    document-&gt;extensionStyleSheets().addUserStyleSheet(WTF::move(parsedSheet));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> String Internals::counterValue(Element* element)
</span></span></pre>
</div>
</div>

</body>
</html>