<!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>[206312] trunk/Source</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/206312">206312</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-09-23 10:15:03 -0700 (Fri, 23 Sep 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Unreviewed, rolling out <a href="http://trac.webkit.org/projects/webkit/changeset/206311">r206311</a>.
https://bugs.webkit.org/show_bug.cgi?id=162495
Broke internal iOS build (Requested by anttik on #webkit).
Reverted changeset:
"Move stylesheet change logic from Document to
AuthorStyleSheets"
https://bugs.webkit.org/show_bug.cgi?id=162488
http://trac.webkit.org/changeset/206311</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSStyleSheetcpp">trunk/Source/WebCore/css/CSSStyleSheet.cpp</a></li>
<li><a href="#trunkSourceWebCoredomAuthorStyleSheetscpp">trunk/Source/WebCore/dom/AuthorStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomAuthorStyleSheetsh">trunk/Source/WebCore/dom/AuthorStyleSheets.h</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCoredomExtensionStyleSheetscpp">trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp</a></li>
<li><a href="#trunkSourceWebCoredomInlineStyleSheetOwnercpp">trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp</a></li>
<li><a href="#trunkSourceWebCoredomProcessingInstructioncpp">trunk/Source/WebCore/dom/ProcessingInstruction.cpp</a></li>
<li><a href="#trunkSourceWebCoredomShadowRootcpp">trunk/Source/WebCore/dom/ShadowRoot.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLLinkElementcpp">trunk/Source/WebCore/html/HTMLLinkElement.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLStyleElementcpp">trunk/Source/WebCore/html/HTMLStyleElement.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorCSSAgentcpp">trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp</a></li>
<li><a href="#trunkSourceWebCoreinspectorInspectorPageAgentcpp">trunk/Source/WebCore/inspector/InspectorPageAgent.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFramecpp">trunk/Source/WebCore/page/Frame.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCoresvgSVGFontFaceElementcpp">trunk/Source/WebCore/svg/SVGFontFaceElement.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlXMLTreeViewercpp">trunk/Source/WebCore/xml/XMLTreeViewer.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParsercpp">trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp</a></li>
<li><a href="#trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp">trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebHTMLViewmm">trunk/Source/WebKit/mac/WebView/WebHTMLView.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/ChangeLog        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-09-23 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r206311.
+ https://bugs.webkit.org/show_bug.cgi?id=162495
+
+ Broke internal iOS build (Requested by anttik on #webkit).
+
+ Reverted changeset:
+
+ "Move stylesheet change logic from Document to
+ AuthorStyleSheets"
+ https://bugs.webkit.org/show_bug.cgi?id=162488
+ http://trac.webkit.org/changeset/206311
+
</ins><span class="cx"> 2016-09-23 Antti Koivisto <antti@apple.com>
</span><span class="cx">
</span><span class="cx"> Move stylesheet change logic from Document to AuthorStyleSheets
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -6197,7 +6197,7 @@
</span><span class="cx">                 E461802D1C8DD2900026C02C /* StyleRelations.h in Headers */ = {isa = PBXBuildFile; fileRef = E461802C1C8DD2900026C02C /* StyleRelations.h */; };
</span><span class="cx">                 E461802F1C8DD4D20026C02C /* StyleRelations.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461802E1C8DD4D20026C02C /* StyleRelations.cpp */; };
</span><span class="cx">                 E461D65D1BB0C7F000CB5645 /* AuthorStyleSheets.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E461D65C1BB0C7F000CB5645 /* AuthorStyleSheets.cpp */; };
</span><del>-                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; settings = {ATTRIBUTES = (Private, ); }; };
</del><ins>+                E461D65F1BB0C80D00CB5645 /* AuthorStyleSheets.h in Headers */ = {isa = PBXBuildFile; fileRef = E461D65E1BB0C80D00CB5645 /* AuthorStyleSheets.h */; };
</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></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -179,11 +179,11 @@
</span><span class="cx"> resolver->addKeyframeStyle(*insertedKeyframesRule);
</span><span class="cx"> return;
</span><span class="cx"> }
</span><del>- owner->authorStyleSheets().scheduleOptimizedUpdate();
</del><ins>+ owner->scheduleOptimizedStyleSheetUpdate();
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- owner->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ owner->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx">
</span><span class="cx"> m_mutatedRules = true;
</span><span class="cx"> }
</span><span class="lines">@@ -193,7 +193,7 @@
</span><span class="cx"> Document* owner = ownerDocument();
</span><span class="cx"> if (!owner)
</span><span class="cx"> return;
</span><del>- owner->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ owner->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CSSStyleSheet::clearOwnerNode()
</span><span class="lines">@@ -202,7 +202,7 @@
</span><span class="cx"> m_ownerNode = 0;
</span><span class="cx"> if (!owner)
</span><span class="cx"> return;
</span><del>- owner->authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+ owner->styleResolverChanged(DeferRecalcStyleIfNeeded);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CSSStyleSheet::reattachChildRuleCSSOMWrappers()
</span></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/AuthorStyleSheets.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -57,7 +57,6 @@
</span><span class="cx">
</span><span class="cx"> AuthorStyleSheets::AuthorStyleSheets(Document& document)
</span><span class="cx"> : m_document(document)
</span><del>- , m_optimizedUpdateTimer(*this, &AuthorStyleSheets::optimizedUpdateTimerFired)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -64,7 +63,6 @@
</span><span class="cx"> AuthorStyleSheets::AuthorStyleSheets(ShadowRoot& shadowRoot)
</span><span class="cx"> : m_document(shadowRoot.documentScope())
</span><span class="cx"> , m_shadowRoot(&shadowRoot)
</span><del>- , m_optimizedUpdateTimer(*this, &AuthorStyleSheets::optimizedUpdateTimerFired)
</del><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -386,64 +384,4 @@
</span><span class="cx"> return m_weakCopyOfActiveStyleSheetListForFastLookup->contains(sheet);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void AuthorStyleSheets::flushPendingUpdates()
-{
- if (m_pendingUpdateType == NoUpdate)
- return;
- updateActiveStyleSheets(m_pendingUpdateType);
</del><span class="cx"> }
</span><del>-
-void AuthorStyleSheets::scheduleOptimizedUpdate()
-{
- if (m_optimizedUpdateTimer.isActive())
- return;
- if (m_pendingUpdateType == NoUpdate)
- m_pendingUpdateType = OptimizedUpdate;
- m_optimizedUpdateTimer.startOneShot(0);
-}
-
-void AuthorStyleSheets::didChange(StyleResolverUpdateFlag updateFlag)
-{
- m_optimizedUpdateTimer.stop();
-
- // Don't bother updating, since we haven't loaded all our style info yet
- // and haven't calculated the style resolver for the first time.
- if (!m_document.hasLivingRenderTree() || (!m_shadowRoot && !m_didCalculateStyleResolver && m_pendingStyleSheetCount)) {
- m_document.clearStyleResolver();
- return;
- }
- m_didCalculateStyleResolver = true;
-
- auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
- ? AuthorStyleSheets::OptimizedUpdate
- : AuthorStyleSheets::FullUpdate;
- bool stylesheetChangeRequiresStyleRecalc = updateActiveStyleSheets(styleSheetUpdate);
-
- auto scheduleStyleRecalc = [&] {
- if (m_shadowRoot)
- m_shadowRoot->setNeedsStyleRecalc();
- else
- m_document.scheduleForcedStyleRecalc();
- };
-
- if (updateFlag == DeferRecalcStyle) {
- scheduleStyleRecalc();
- return;
- }
-
- if (updateFlag == DeferRecalcStyleIfNeeded) {
- if (stylesheetChangeRequiresStyleRecalc)
- scheduleStyleRecalc();
- return;
- }
-
- if (stylesheetChangeRequiresStyleRecalc)
- m_document.recalcStyle(Style::Force);
-}
-
-void AuthorStyleSheets::optimizedUpdateTimerFired()
-{
- didChange(RecalcStyleIfNeeded);
-}
-
-}
</del></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/AuthorStyleSheets.h (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -48,13 +48,6 @@
</span><span class="cx"> class ShadowRoot;
</span><span class="cx"> class TreeScope;
</span><span class="cx">
</span><del>-enum StyleResolverUpdateFlag {
- RecalcStyleImmediately,
- DeferRecalcStyle,
- RecalcStyleIfNeeded,
- DeferRecalcStyleIfNeeded
-};
-
</del><span class="cx"> class AuthorStyleSheets {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="lines">@@ -69,8 +62,23 @@
</span><span class="cx"> void addStyleSheetCandidateNode(Node&, bool createdByParser);
</span><span class="cx"> void removeStyleSheetCandidateNode(Node&);
</span><span class="cx">
</span><del>- WEBCORE_EXPORT void didChange(StyleResolverUpdateFlag);
</del><ins>+ enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
</ins><span class="cx">
</span><ins>+ UpdateFlag pendingUpdateType() const { return m_pendingUpdateType; }
+ void setPendingUpdateType(UpdateFlag updateType)
+ {
+ if (updateType > m_pendingUpdateType)
+ m_pendingUpdateType = updateType;
+ }
+
+ void flushPendingUpdates()
+ {
+ if (m_pendingUpdateType != NoUpdate)
+ updateActiveStyleSheets(m_pendingUpdateType);
+ }
+
+ bool updateActiveStyleSheets(UpdateFlag);
+
</ins><span class="cx"> String preferredStylesheetSetName() const { return m_preferredStylesheetSetName; }
</span><span class="cx"> String selectedStylesheetSetName() const { return m_selectedStylesheetSetName; }
</span><span class="cx"> void setPreferredStylesheetSetName(const String& name) { m_preferredStylesheetSetName = name; }
</span><span class="lines">@@ -91,16 +99,8 @@
</span><span class="cx">
</span><span class="cx"> bool activeStyleSheetsContains(const CSSStyleSheet*) const;
</span><span class="cx">
</span><del>- void scheduleOptimizedUpdate();
- bool hasPendingUpdate() const { return m_optimizedUpdateTimer.isActive(); }
- void flushPendingUpdates();
-
</del><span class="cx"> private:
</span><del>- enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
- bool updateActiveStyleSheets(UpdateFlag);
-
</del><span class="cx"> void collectActiveStyleSheets(Vector<RefPtr<StyleSheet>>&);
</span><del>-
</del><span class="cx"> enum StyleResolverUpdateType {
</span><span class="cx"> Reconstruct,
</span><span class="cx"> Reset,
</span><span class="lines">@@ -109,8 +109,6 @@
</span><span class="cx"> StyleResolverUpdateType analyzeStyleSheetChange(UpdateFlag, const Vector<RefPtr<CSSStyleSheet>>& newStylesheets, bool& requiresFullStyleRecalc);
</span><span class="cx"> void updateStyleResolver(Vector<RefPtr<CSSStyleSheet>>&, StyleResolverUpdateType);
</span><span class="cx">
</span><del>- void optimizedUpdateTimerFired();
-
</del><span class="cx"> Document& m_document;
</span><span class="cx"> ShadowRoot* m_shadowRoot { nullptr };
</span><span class="cx">
</span><span class="lines">@@ -117,8 +115,6 @@
</span><span class="cx"> Vector<RefPtr<StyleSheet>> m_styleSheetsForStyleSheetList;
</span><span class="cx"> Vector<RefPtr<CSSStyleSheet>> m_activeStyleSheets;
</span><span class="cx">
</span><del>- Timer m_optimizedUpdateTimer;
-
</del><span class="cx"> // This is a mirror of m_activeAuthorStyleSheets that gets populated on demand for activeStyleSheetsContains().
</span><span class="cx"> mutable std::unique_ptr<HashSet<const CSSStyleSheet*>> m_weakCopyOfActiveStyleSheetListForFastLookup;
</span><span class="cx">
</span><span class="lines">@@ -127,7 +123,6 @@
</span><span class="cx"> // We use this count of pending sheets to detect when we can begin attaching
</span><span class="cx"> // elements and when it is safe to execute scripts.
</span><span class="cx"> int m_pendingStyleSheetCount { 0 };
</span><del>- bool m_didCalculateStyleResolver { false };
</del><span class="cx">
</span><span class="cx"> UpdateFlag m_pendingUpdateType { NoUpdate };
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -435,6 +435,7 @@
</span><span class="cx"> , m_touchEventsChangedTimer(*this, &Document::touchEventsChangedTimerFired)
</span><span class="cx"> #endif
</span><span class="cx"> , m_referencingNodeCount(0)
</span><ins>+ , m_didCalculateStyleResolver(false)
</ins><span class="cx"> , m_hasNodesWithPlaceholderStyle(false)
</span><span class="cx"> , m_needsNotifyRemoveAllPendingStylesheet(false)
</span><span class="cx"> , m_ignorePendingStylesheets(false)
</span><span class="lines">@@ -457,6 +458,7 @@
</span><span class="cx"> , m_visuallyOrdered(false)
</span><span class="cx"> , m_readyState(Complete)
</span><span class="cx"> , m_bParsing(false)
</span><ins>+ , m_optimizedStyleSheetUpdateTimer(*this, &Document::optimizedStyleSheetUpdateTimerFired)
</ins><span class="cx"> , m_styleRecalcTimer(*this, &Document::updateStyleIfNeeded)
</span><span class="cx"> , m_pendingStyleRecalcShouldForce(false)
</span><span class="cx"> , m_inStyleRecalc(false)
</span><span class="lines">@@ -1355,7 +1357,7 @@
</span><span class="cx"> m_contentLanguage = language;
</span><span class="cx">
</span><span class="cx"> // Recalculate style so language is used when selecting the initial font.
</span><del>- m_authorStyleSheets->didChange(DeferRecalcStyle);
</del><ins>+ styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::setXMLVersion(const String& version, ExceptionCode& ec)
</span><span class="lines">@@ -1943,14 +1945,6 @@
</span><span class="cx"> frameView.frame().mainFrame().eventHandler().dispatchFakeMouseMoveEventSoon();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool Document::needsStyleRecalc() const
-{
- if (pageCacheState() != NotInPageCache)
- return false;
-
- return m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || authorStyleSheets().hasPendingUpdate();
-}
-
</del><span class="cx"> void Document::updateStyleIfNeeded()
</span><span class="cx"> {
</span><span class="cx"> ASSERT(isMainThread());
</span><span class="lines">@@ -1959,8 +1953,8 @@
</span><span class="cx"> if (!view() || view()->isInRenderTreeLayout())
</span><span class="cx"> return;
</span><span class="cx">
</span><del>- if (authorStyleSheets().hasPendingUpdate())
- authorStyleSheets().didChange(RecalcStyleIfNeeded);
</del><ins>+ if (m_optimizedStyleSheetUpdateTimer.isActive())
+ styleResolverChanged(RecalcStyleIfNeeded);
</ins><span class="cx">
</span><span class="cx"> if (!needsStyleRecalc())
</span><span class="cx"> return;
</span><span class="lines">@@ -2014,7 +2008,7 @@
</span><span class="cx"> HTMLElement* bodyElement = bodyOrFrameset();
</span><span class="cx"> if (bodyElement && !bodyElement->renderer() && m_pendingSheetLayout == NoLayoutWithPendingSheets) {
</span><span class="cx"> m_pendingSheetLayout = DidLayoutWithPendingSheets;
</span><del>- authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> } else if (m_hasNodesWithPlaceholderStyle)
</span><span class="cx"> // If new nodes have been added or style recalc has been done with style sheets still pending, some nodes
</span><span class="cx"> // may not have had their real style calculated yet. Normally this gets cleaned when style sheets arrive
</span><span class="lines">@@ -3151,7 +3145,7 @@
</span><span class="cx"> {
</span><span class="cx"> m_needsNotifyRemoveAllPendingStylesheet = false;
</span><span class="cx">
</span><del>- authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+ styleResolverChanged(DeferRecalcStyleIfNeeded);
</ins><span class="cx">
</span><span class="cx"> if (m_pendingSheetLayout == DidLayoutWithPendingSheets) {
</span><span class="cx"> m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
</span><span class="lines">@@ -3226,7 +3220,7 @@
</span><span class="cx"> // -dwh
</span><span class="cx"> authorStyleSheets().setSelectedStylesheetSetName(content);
</span><span class="cx"> authorStyleSheets().setPreferredStylesheetSetName(content);
</span><del>- authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> break;
</span><span class="cx">
</span><span class="cx"> case HTTPHeaderName::Refresh: {
</span><span class="lines">@@ -3530,7 +3524,7 @@
</span><span class="cx"> void Document::setSelectedStylesheetSet(const String& aString)
</span><span class="cx"> {
</span><span class="cx"> authorStyleSheets().setSelectedStylesheetSetName(aString);
</span><del>- authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void Document::evaluateMediaQueryList()
</span><span class="lines">@@ -3553,6 +3547,19 @@
</span><span class="cx"> picture->sourcesChanged();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Document::optimizedStyleSheetUpdateTimerFired()
+{
+ styleResolverChanged(RecalcStyleIfNeeded);
+}
+
+void Document::scheduleOptimizedStyleSheetUpdate()
+{
+ if (m_optimizedStyleSheetUpdateTimer.isActive())
+ return;
+ authorStyleSheets().setPendingUpdateType(AuthorStyleSheets::OptimizedUpdate);
+ m_optimizedStyleSheetUpdateTimer.startOneShot(0);
+}
+
</ins><span class="cx"> void Document::updateViewportUnitsOnResize()
</span><span class="cx"> {
</span><span class="cx"> if (!hasStyleWithViewportUnits())
</span><span class="lines">@@ -3617,6 +3624,39 @@
</span><span class="cx"> audioProducer->pageMutedStateDidChange();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Document::styleResolverChanged(StyleResolverUpdateFlag updateFlag)
+{
+ if (m_optimizedStyleSheetUpdateTimer.isActive())
+ m_optimizedStyleSheetUpdateTimer.stop();
+
+ // Don't bother updating, since we haven't loaded all our style info yet
+ // and haven't calculated the style selector for the first time.
+ if (!hasLivingRenderTree() || (!m_didCalculateStyleResolver && !haveStylesheetsLoaded())) {
+ m_styleResolver = nullptr;
+ return;
+ }
+ m_didCalculateStyleResolver = true;
+
+ auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
+ ? AuthorStyleSheets::OptimizedUpdate
+ : AuthorStyleSheets::FullUpdate;
+ bool stylesheetChangeRequiresStyleRecalc = authorStyleSheets().updateActiveStyleSheets(styleSheetUpdate);
+
+ if (updateFlag == DeferRecalcStyle) {
+ scheduleForcedStyleRecalc();
+ return;
+ }
+
+ if (updateFlag == DeferRecalcStyleIfNeeded) {
+ if (stylesheetChangeRequiresStyleRecalc)
+ scheduleForcedStyleRecalc();
+ return;
+ }
+
+ if (stylesheetChangeRequiresStyleRecalc)
+ recalcStyle(Style::Force);
+}
+
</ins><span class="cx"> static bool isNodeInSubtree(Node* node, Node* container, bool amongChildrenOnly)
</span><span class="cx"> {
</span><span class="cx"> bool nodeInSubtree = false;
</span><span class="lines">@@ -6605,7 +6645,7 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void Document::updateHoverActiveState(const HitTestRequest& request, Element* innerElement)
</del><ins>+void Document::updateHoverActiveState(const HitTestRequest& request, Element* innerElement, StyleResolverUpdateFlag updateFlag)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(!request.readOnly());
</span><span class="cx">
</span><span class="lines">@@ -6722,7 +6762,9 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- updateStyleIfNeeded();
</del><ins>+ ASSERT(updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded);
+ if (updateFlag == RecalcStyleIfNeeded)
+ updateStyleIfNeeded();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool Document::haveStylesheetsLoaded() const
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/Document.h        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -231,6 +231,8 @@
</span><span class="cx"> PageshowEventPersisted = 1
</span><span class="cx"> };
</span><span class="cx">
</span><ins>+enum StyleResolverUpdateFlag { RecalcStyleImmediately, DeferRecalcStyle, RecalcStyleIfNeeded, DeferRecalcStyleIfNeeded };
+
</ins><span class="cx"> enum NodeListInvalidationType {
</span><span class="cx"> DoNotInvalidateOnAttributeChanges = 0,
</span><span class="cx"> InvalidateOnClassAttrChange,
</span><span class="lines">@@ -515,6 +517,19 @@
</span><span class="cx"> bool gotoAnchorNeededAfterStylesheetsLoad() { return m_gotoAnchorNeededAfterStylesheetsLoad; }
</span><span class="cx"> void setGotoAnchorNeededAfterStylesheetsLoad(bool b) { m_gotoAnchorNeededAfterStylesheetsLoad = b; }
</span><span class="cx">
</span><ins>+ /**
+ * Called when one or more stylesheets in the document may have been added, removed or changed.
+ *
+ * Creates a new style resolver and assign it to this document. This is done by iterating through all nodes in
+ * document (or those before <BODY> in a HTML document), searching for stylesheets. Stylesheets can be contained in
+ * <LINK>, <STYLE> or <BODY> elements, as well as processing instructions (XML documents only). A list is
+ * constructed from these which is used to create the a new style selector which collates all of the stylesheets
+ * found and is used to calculate the derived styles for all rendering objects.
+ */
+ WEBCORE_EXPORT void styleResolverChanged(StyleResolverUpdateFlag);
+
+ void scheduleOptimizedStyleSheetUpdate();
+
</ins><span class="cx"> void evaluateMediaQueryList();
</span><span class="cx">
</span><span class="cx"> FormController& formController();
</span><span class="lines">@@ -542,7 +557,7 @@
</span><span class="cx">
</span><span class="cx"> void recalcStyle(Style::Change = Style::NoChange);
</span><span class="cx"> WEBCORE_EXPORT void updateStyleIfNeeded();
</span><del>- bool needsStyleRecalc() const;
</del><ins>+ bool needsStyleRecalc() const { return pageCacheState() == NotInPageCache && (m_pendingStyleRecalcShouldForce || childNeedsStyleRecalc() || m_optimizedStyleSheetUpdateTimer.isActive()); }
</ins><span class="cx">
</span><span class="cx"> WEBCORE_EXPORT void updateLayout();
</span><span class="cx">
</span><span class="lines">@@ -721,7 +736,7 @@
</span><span class="cx"> void hoveredElementDidDetach(Element*);
</span><span class="cx"> void elementInActiveChainDidDetach(Element*);
</span><span class="cx">
</span><del>- void updateHoverActiveState(const HitTestRequest&, Element*);
</del><ins>+ void updateHoverActiveState(const HitTestRequest&, Element*, StyleResolverUpdateFlag = RecalcStyleIfNeeded);
</ins><span class="cx">
</span><span class="cx"> // Updates for :target (CSS3 selector).
</span><span class="cx"> void setCSSTarget(Element*);
</span><span class="lines">@@ -733,6 +748,7 @@
</span><span class="cx"> void unscheduleStyleRecalc();
</span><span class="cx"> bool hasPendingStyleRecalc() const;
</span><span class="cx"> bool hasPendingForcedStyleRecalc() const;
</span><ins>+ void optimizedStyleSheetUpdateTimerFired();
</ins><span class="cx">
</span><span class="cx"> void registerNodeListForInvalidation(LiveNodeList&);
</span><span class="cx"> void unregisterNodeListForInvalidation(LiveNodeList&);
</span><span class="lines">@@ -1398,6 +1414,7 @@
</span><span class="cx">
</span><span class="cx"> std::unique_ptr<StyleResolver> m_styleResolver;
</span><span class="cx"> std::unique_ptr<StyleResolver> m_userAgentShadowTreeStyleResolver;
</span><ins>+ bool m_didCalculateStyleResolver;
</ins><span class="cx"> bool m_hasNodesWithPlaceholderStyle;
</span><span class="cx"> bool m_needsNotifyRemoveAllPendingStylesheet;
</span><span class="cx"> // But sometimes you need to ignore pending stylesheet count to
</span><span class="lines">@@ -1485,6 +1502,7 @@
</span><span class="cx"> ReadyState m_readyState;
</span><span class="cx"> bool m_bParsing;
</span><span class="cx">
</span><ins>+ Timer m_optimizedStyleSheetUpdateTimer;
</ins><span class="cx"> Timer m_styleRecalcTimer;
</span><span class="cx"> bool m_pendingStyleRecalcShouldForce;
</span><span class="cx"> bool m_inStyleRecalc;
</span></span></pre></div>
<a id="trunkSourceWebCoredomExtensionStyleSheetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "ExtensionStyleSheets.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSStyleSheet.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "HTMLIFrameElement.h"
</span><span class="lines">@@ -83,7 +82,7 @@
</span><span class="cx"> {
</span><span class="cx"> if (m_pageUserSheet) {
</span><span class="cx"> m_pageUserSheet = nullptr;
</span><del>- m_document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ m_document.styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -91,7 +90,7 @@
</span><span class="cx"> {
</span><span class="cx"> clearPageUserSheet();
</span><span class="cx"> if (pageUserSheet())
</span><del>- m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_document.styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> const Vector<RefPtr<CSSStyleSheet>>& ExtensionStyleSheets::injectedUserStyleSheets() const
</span><span class="lines">@@ -155,7 +154,7 @@
</span><span class="cx"> m_injectedStyleSheetCacheValid = false;
</span><span class="cx"> if (m_injectedUserStyleSheets.isEmpty() && m_injectedAuthorStyleSheets.isEmpty())
</span><span class="cx"> return;
</span><del>- m_document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ m_document.styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::addUserStyleSheet(Ref<StyleSheetContents>&& userSheet)
</span><span class="lines">@@ -162,7 +161,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(userSheet.get().isUserStyleSheet());
</span><span class="cx"> m_userStyleSheets.append(CSSStyleSheet::create(WTFMove(userSheet), m_document));
</span><del>- m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_document.styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::addAuthorStyleSheetForTesting(Ref<StyleSheetContents>&& authorSheet)
</span><span class="lines">@@ -169,7 +168,7 @@
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!authorSheet.get().isUserStyleSheet());
</span><span class="cx"> m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTFMove(authorSheet), m_document));
</span><del>- m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_document.styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="lines">@@ -201,7 +200,7 @@
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::styleResolverChangedTimerFired()
</span><span class="cx"> {
</span><del>- m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_document.styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ExtensionStyleSheets::detachFromDocument()
</span></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -73,7 +73,7 @@
</span><span class="cx">
</span><span class="cx"> // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
</span><span class="cx"> if (document.hasLivingRenderTree())
</span><del>- document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document.styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InlineStyleSheetOwner::clearDocumentData(Document&, Element& element)
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -268,17 +268,11 @@
</span><span class="cx"> ASSERT(m_sheet->ownerNode() == this);
</span><span class="cx"> m_sheet->clearOwnerNode();
</span><span class="cx"> m_sheet = nullptr;
</span><del>-
</del><span class="cx"> }
</span><span class="cx">
</span><del>- if (m_loading) {
- m_loading = false;
- document().authorStyleSheets().removePendingSheet();
- }
-
</del><span class="cx"> // If we're in document teardown, then we don't need to do any notification of our sheet's removal.
</span><span class="cx"> if (document().hasLivingRenderTree())
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void ProcessingInstruction::finishParsingChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -108,10 +108,15 @@
</span><span class="cx">
</span><span class="cx"> void ShadowRoot::updateStyle()
</span><span class="cx"> {
</span><del>- if (!m_authorStyleSheets)
- return;
- // FIXME: Make optimized updated work.
- m_authorStyleSheets->didChange(DeferRecalcStyle);
</del><ins>+ bool shouldRecalcStyle = false;
+
+ if (m_authorStyleSheets) {
+ // FIXME: Make optimized updated work.
+ shouldRecalcStyle = m_authorStyleSheets->updateActiveStyleSheets(AuthorStyleSheets::FullUpdate);
+ }
+
+ if (shouldRecalcStyle)
+ setNeedsStyleRecalc();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> String ShadowRoot::innerHTML() const
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLLinkElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLLinkElement.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx"> if (!m_sheet && m_disabledState == EnabledViaScript)
</span><span class="cx"> process();
</span><span class="cx"> else
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle); // Update the style selector.
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx"> m_media = value.string().convertToASCIILowercase();
</span><span class="cx"> process();
</span><span class="cx"> if (m_sheet && !isDisabled())
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx"> if (name == disabledAttr) {
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx"> } else if (m_sheet) {
</span><span class="cx"> // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
</span><span class="cx"> clearSheet();
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -330,7 +330,7 @@
</span><span class="cx"> removePendingSheet(RemovePendingSheetNotifyLater);
</span><span class="cx">
</span><span class="cx"> if (document().hasLivingRenderTree())
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyleIfNeeded);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void HTMLLinkElement::finishParsingChildren()
</span><span class="lines">@@ -555,7 +555,7 @@
</span><span class="cx">
</span><span class="cx"> if (type == InactiveSheet) {
</span><span class="cx"> // Document just needs to know about the sheet for exposure through document.styleSheets
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+ document().authorStyleSheets().updateActiveStyleSheets(AuthorStyleSheets::OptimizedUpdate);
</ins><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLStyleElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLStyleElement.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "HTMLStyleElement.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Event.h"
</span><span class="cx"> #include "EventNames.h"
</span><span class="lines">@@ -78,7 +77,7 @@
</span><span class="cx"> if (sheet()) {
</span><span class="cx"> sheet()->setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
</span><span class="cx"> if (inDocument() && document().hasLivingRenderTree())
</span><del>- document().authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document().styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx"> } else if (name == typeAttr)
</span><span class="cx"> m_styleSheetOwner.setContentType(value);
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorCSSAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -889,7 +889,7 @@
</span><span class="cx"> m_nodeIdToForcedPseudoState.set(nodeId, forcedPseudoState);
</span><span class="cx"> else
</span><span class="cx"> m_nodeIdToForcedPseudoState.remove(nodeId);
</span><del>- element->document().authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ element->document().styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void InspectorCSSAgent::getNamedFlowCollection(ErrorString& errorString, int documentNodeId, RefPtr<Inspector::Protocol::Array<Inspector::Protocol::CSS::NamedFlow>>& result)
</span><span class="lines">@@ -1189,7 +1189,7 @@
</span><span class="cx">
</span><span class="cx"> m_nodeIdToForcedPseudoState.clear();
</span><span class="cx"> for (auto& document : documentsToChange)
</span><del>- document->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "InspectorPageAgent.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CachedCSSStyleSheet.h"
</span><span class="cx"> #include "CachedFont.h"
</span><span class="cx"> #include "CachedImage.h"
</span><span class="lines">@@ -1002,7 +1001,7 @@
</span><span class="cx"> m_emulatedMedia = media;
</span><span class="cx"> Document* document = m_page.mainFrame().document();
</span><span class="cx"> if (document) {
</span><del>- document->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> document->updateLayout();
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Frame.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/page/Frame.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "ApplyStyleCommand.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "CSSComputedStyleDeclaration.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -644,7 +643,7 @@
</span><span class="cx"> m_doc->setPrinting(printing);
</span><span class="cx"> view()->adjustMediaTypeForPrinting(printing);
</span><span class="cx">
</span><del>- m_doc->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_doc->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> if (shouldUsePrintingLayout()) {
</span><span class="cx"> view()->forceLayoutForPagination(pageSize, originalPageSize, maximumShrinkRatio, shouldAdjustViewSize);
</span><span class="cx"> } else {
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -29,7 +29,6 @@
</span><span class="cx">
</span><span class="cx"> #include "AXObjectCache.h"
</span><span class="cx"> #include "AnimationController.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "CachedImage.h"
</span><span class="cx"> #include "CachedResourceLoader.h"
</span><span class="lines">@@ -1301,7 +1300,7 @@
</span><span class="cx"> StyleResolver* styleResolver = document.styleResolverIfExists();
</span><span class="cx"> if (!styleResolver || styleResolver->hasMediaQueriesAffectedByViewportChange()) {
</span><span class="cx"> LOG(Layout, " hasMediaQueriesAffectedByViewportChange, enqueueing style recalc");
</span><del>- document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document.styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds.
</span><span class="cx"> InspectorInstrumentation::mediaQueryResultChanged(document);
</span><span class="cx"> } else
</span><span class="lines">@@ -3496,7 +3495,7 @@
</span><span class="cx">
</span><span class="cx"> m_pagination = pagination;
</span><span class="cx">
</span><del>- frame().document()->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ frame().document()->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> IntRect FrameView::windowClipRect() const
</span><span class="lines">@@ -4965,7 +4964,7 @@
</span><span class="cx"> if (Document* document = frame().document()) {
</span><span class="cx"> // FIXME: this should probably be updateViewportUnitsOnResize(), but synchronously
</span><span class="cx"> // dirtying style here causes assertions on iOS (rdar://problem/19998166).
</span><del>- document->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/page/Page.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -23,7 +23,6 @@
</span><span class="cx"> #include "AlternativeTextClient.h"
</span><span class="cx"> #include "AnimationController.h"
</span><span class="cx"> #include "ApplicationCacheStorage.h"
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "BackForwardClient.h"
</span><span class="cx"> #include "BackForwardController.h"
</span><span class="cx"> #include "Chrome.h"
</span><span class="lines">@@ -423,7 +422,7 @@
</span><span class="cx"> m_mainFrame->view()->forceLayout();
</span><span class="cx">
</span><span class="cx"> if (m_mainFrame->document())
</span><del>- m_mainFrame->document()->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_mainFrame->document()->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx">
</span><span class="lines">@@ -501,7 +500,7 @@
</span><span class="cx"> {
</span><span class="cx"> for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext()) {
</span><span class="cx"> if (Document* document = frame->document())
</span><del>- document->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1162,7 +1161,7 @@
</span><span class="cx"> if (!document)
</span><span class="cx"> continue;
</span><span class="cx"> document->extensionStyleSheets().invalidateInjectedStyleSheetCache();
</span><del>- document->authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document->styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGFontFaceElementcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGFontFaceElement.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> #include "SVGFontFaceElement.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><span class="cx"> #include "CSSParser.h"
</span><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="lines">@@ -267,7 +266,7 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNode& rootParent)
</span><span class="lines">@@ -292,7 +291,7 @@
</span><span class="cx"> document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
</span><span class="cx"> m_fontFaceRule->mutableProperties().clear();
</span><span class="cx">
</span><del>- document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+ document().styleResolverChanged(DeferRecalcStyle);
</ins><span class="cx"> } else
</span><span class="cx"> ASSERT(!m_fontElement);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLTreeViewercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLTreeViewer.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -32,7 +32,6 @@
</span><span class="cx">
</span><span class="cx"> #if ENABLE(XSLT)
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Element.h"
</span><span class="cx"> #include "ExceptionCodePlaceholder.h"
</span><span class="lines">@@ -64,7 +63,7 @@
</span><span class="cx"> String cssString = StringImpl::createWithoutCopying(XMLViewer_css, sizeof(XMLViewer_css));
</span><span class="cx"> auto text = m_document.createTextNode(cssString);
</span><span class="cx"> m_document.getElementById(String(ASCIILiteral("xml-viewer-style")))->appendChild(text, IGNORE_EXCEPTION);
</span><del>- m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ m_document.styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -26,7 +26,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "XMLDocumentParser.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CDATASection.h"
</span><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "Comment.h"
</span><span class="lines">@@ -200,7 +199,7 @@
</span><span class="cx"> insertErrorMessageBlock();
</span><span class="cx"> else {
</span><span class="cx"> updateLeafTextNode();
</span><del>- document()->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document()->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (isParsing())
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -28,7 +28,6 @@
</span><span class="cx"> #include "config.h"
</span><span class="cx"> #include "XMLDocumentParser.h"
</span><span class="cx">
</span><del>-#include "AuthorStyleSheets.h"
</del><span class="cx"> #include "CDATASection.h"
</span><span class="cx"> #include "CachedScript.h"
</span><span class="cx"> #include "Comment.h"
</span><span class="lines">@@ -1387,7 +1386,7 @@
</span><span class="cx"> document()->setTransformSource(std::make_unique<TransformSource>(doc));
</span><span class="cx">
</span><span class="cx"> document()->setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
</span><del>- document()->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document()->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx">
</span><span class="cx"> // styleResolverChanged() call can detach the parser and null out its document.
</span><span class="cx"> // In that case, we just bail out.
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-09-23 Commit Queue <commit-queue@webkit.org>
+
+ Unreviewed, rolling out r206311.
+ https://bugs.webkit.org/show_bug.cgi?id=162495
+
+ Broke internal iOS build (Requested by anttik on #webkit).
+
+ Reverted changeset:
+
+ "Move stylesheet change logic from Document to
+ AuthorStyleSheets"
+ https://bugs.webkit.org/show_bug.cgi?id=162488
+ http://trac.webkit.org/changeset/206311
+
</ins><span class="cx"> 2016-09-23 Antoine Quint <graouts@apple.com>
</span><span class="cx">
</span><span class="cx"> Add a new runtime flag for work on modern media controls (off by default)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (206311 => 206312)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-23 16:35:04 UTC (rev 206311)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-23 17:15:03 UTC (rev 206312)
</span><span class="lines">@@ -72,7 +72,6 @@
</span><span class="cx"> #import "WebTypesInternal.h"
</span><span class="cx"> #import "WebUIDelegatePrivate.h"
</span><span class="cx"> #import "WebViewInternal.h"
</span><del>-#import <WebCore/AuthorStyleSheets.h>
</del><span class="cx"> #import <WebCore/CSSStyleDeclaration.h>
</span><span class="cx"> #import <WebCore/CachedImage.h>
</span><span class="cx"> #import <WebCore/CachedResourceClient.h>
</span><span class="lines">@@ -3612,7 +3611,7 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> if (Frame* coreFrame = core([self _frame]))
</span><del>- coreFrame->document()->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ coreFrame->document()->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx">
</span><span class="cx"> #ifdef LOG_TIMES
</span><span class="cx"> double thisTime = CFAbsoluteTimeGetCurrent() - start;
</span><span class="lines">@@ -5005,7 +5004,7 @@
</span><span class="cx">
</span><span class="cx"> document->setPaginatedForScreen(_private->paginateScreenContent);
</span><span class="cx"> document->setPrinting(_private->printing);
</span><del>- document->authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+ document->styleResolverChanged(RecalcStyleImmediately);
</ins><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre>
</div>
</div>
</body>
</html>