<!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>[206361] 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/206361">206361</a></dd>
<dt>Author</dt> <dd>antti@apple.com</dd>
<dt>Date</dt> <dd>2016-09-25 06:32:24 -0700 (Sun, 25 Sep 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>AuthorStyleSheets shouldn't trigger synchronous style resolutions
https://bugs.webkit.org/show_bug.cgi?id=162532

Reviewed by Darin Adler.

Source/WebCore:

AuthorStyleSheets::didChange() took four different enum values, two of which triggered
a synchronous style resolution. This is almost always unnecessary as any subsequent
call that requires up-to-date style or layout will perform it. In the few cases where
it is actually needed the client can just do it manually.

The patch also replaces the remaining two enum values with functions:

    void didChangeCandidatesForActiveSet();
    void didChangeContentsOrInterpretation();

The first indicates that the set of active stylesheets might have changed and needs to be recomputed.
The seconds one indicates that either the content of some stylesheet has changed or that the environment
where we interpret the sheets has somehow changed.

The existing &quot;AsNeeded&quot; values map to didChangeCandidatesForActiveSet() and the rest map to
didChangeContentsOrInterpretation(). This also makes it obvious that some call sites use the wrong value.
The patch doesn't address these cases.

* css/CSSStyleSheet.cpp:
(WebCore::CSSStyleSheet::didMutateRules):
(WebCore::CSSStyleSheet::didMutate):
(WebCore::CSSStyleSheet::clearOwnerNode):
* dom/AuthorStyleSheets.cpp:
(WebCore::AuthorStyleSheets::AuthorStyleSheets):
(WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
(WebCore::AuthorStyleSheets::updateActiveStyleSheets):
(WebCore::AuthorStyleSheets::flushPendingChanges):
(WebCore::AuthorStyleSheets::scheduleActiveSetChange):
(WebCore::AuthorStyleSheets::didChange):
(WebCore::AuthorStyleSheets::pendingChangeTimerFired):
(WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
(WebCore::AuthorStyleSheets::scheduleOptimizedUpdate): Deleted.
(WebCore::AuthorStyleSheets::optimizedUpdateTimerFired): Deleted.
* dom/AuthorStyleSheets.h:
(WebCore::AuthorStyleSheets::hasPendingUpdate):
* dom/Document.cpp:
(WebCore::Document::setContentLanguage):
(WebCore::Document::recalcStyle):
(WebCore::Document::updateStyleIfNeeded):
(WebCore::Document::updateLayoutIgnorePendingStylesheets):
(WebCore::Document::didRemoveAllPendingStylesheet):
(WebCore::Document::usesStyleBasedEditability):
(WebCore::Document::processHttpEquiv):
(WebCore::Document::setSelectedStylesheetSet):
* dom/ExtensionStyleSheets.cpp:
(WebCore::ExtensionStyleSheets::clearPageUserSheet):
(WebCore::ExtensionStyleSheets::updatePageUserSheet):
(WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
(WebCore::ExtensionStyleSheets::addUserStyleSheet):
(WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
(WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
* dom/InlineStyleSheetOwner.cpp:
(WebCore::InlineStyleSheetOwner::removedFromDocument):
* dom/ProcessingInstruction.cpp:
(WebCore::ProcessingInstruction::removedFrom):
* dom/ShadowRoot.cpp:
(WebCore::ShadowRoot::updateStyle):
* html/HTMLLinkElement.cpp:
(WebCore::HTMLLinkElement::setDisabledState):
(WebCore::HTMLLinkElement::parseAttribute):
(WebCore::HTMLLinkElement::process):
(WebCore::HTMLLinkElement::removedFrom):
(WebCore::HTMLLinkElement::removePendingSheet):
* html/HTMLStyleElement.cpp:
(WebCore::HTMLStyleElement::parseAttribute):
* inspector/InspectorCSSAgent.cpp:
(WebCore::InspectorCSSAgent::forcePseudoState):
(WebCore::InspectorCSSAgent::resetPseudoStates):
* inspector/InspectorPageAgent.cpp:
(WebCore::InspectorPageAgent::setEmulatedMedia):
* page/Frame.cpp:
(WebCore::Frame::setPrinting):
* page/FrameView.cpp:
(WebCore::FrameView::layout):
(WebCore::FrameView::setPagination):
(WebCore::FrameView::setViewportSizeForCSSViewportUnits):
* page/Page.cpp:
(WebCore::Page::setViewMode):
(WebCore::Page::setNeedsRecalcStyleInAllFrames):
(WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
* svg/SVGFontFaceElement.cpp:
(WebCore::SVGFontFaceElement::rebuildFontFace):
(WebCore::SVGFontFaceElement::removedFrom):
* xml/XMLTreeViewer.cpp:
(WebCore::XMLTreeViewer::transformDocumentToTreeView):
* xml/parser/XMLDocumentParser.cpp:
(WebCore::XMLDocumentParser::end):
* xml/parser/XMLDocumentParserLibxml2.cpp:
(WebCore::XMLDocumentParser::doEnd):

Source/WebKit/mac:

* WebView/WebHTMLView.mm:
(-[WebHTMLView reapplyStyles]):
(-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</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="#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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/ChangeLog        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1,3 +1,100 @@
</span><ins>+2016-09-25  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        AuthorStyleSheets shouldn't trigger synchronous style resolutions
+        https://bugs.webkit.org/show_bug.cgi?id=162532
+
+        Reviewed by Darin Adler.
+
+        AuthorStyleSheets::didChange() took four different enum values, two of which triggered
+        a synchronous style resolution. This is almost always unnecessary as any subsequent
+        call that requires up-to-date style or layout will perform it. In the few cases where
+        it is actually needed the client can just do it manually.
+
+        The patch also replaces the remaining two enum values with functions:
+
+            void didChangeCandidatesForActiveSet();
+            void didChangeContentsOrInterpretation();
+
+        The first indicates that the set of active stylesheets might have changed and needs to be recomputed.
+        The seconds one indicates that either the content of some stylesheet has changed or that the environment
+        where we interpret the sheets has somehow changed.
+
+        The existing &quot;AsNeeded&quot; values map to didChangeCandidatesForActiveSet() and the rest map to
+        didChangeContentsOrInterpretation(). This also makes it obvious that some call sites use the wrong value.
+        The patch doesn't address these cases.
+
+        * css/CSSStyleSheet.cpp:
+        (WebCore::CSSStyleSheet::didMutateRules):
+        (WebCore::CSSStyleSheet::didMutate):
+        (WebCore::CSSStyleSheet::clearOwnerNode):
+        * dom/AuthorStyleSheets.cpp:
+        (WebCore::AuthorStyleSheets::AuthorStyleSheets):
+        (WebCore::AuthorStyleSheets::analyzeStyleSheetChange):
+        (WebCore::AuthorStyleSheets::updateActiveStyleSheets):
+        (WebCore::AuthorStyleSheets::flushPendingChanges):
+        (WebCore::AuthorStyleSheets::scheduleActiveSetChange):
+        (WebCore::AuthorStyleSheets::didChange):
+        (WebCore::AuthorStyleSheets::pendingChangeTimerFired):
+        (WebCore::AuthorStyleSheets::flushPendingUpdates): Deleted.
+        (WebCore::AuthorStyleSheets::scheduleOptimizedUpdate): Deleted.
+        (WebCore::AuthorStyleSheets::optimizedUpdateTimerFired): Deleted.
+        * dom/AuthorStyleSheets.h:
+        (WebCore::AuthorStyleSheets::hasPendingUpdate):
+        * dom/Document.cpp:
+        (WebCore::Document::setContentLanguage):
+        (WebCore::Document::recalcStyle):
+        (WebCore::Document::updateStyleIfNeeded):
+        (WebCore::Document::updateLayoutIgnorePendingStylesheets):
+        (WebCore::Document::didRemoveAllPendingStylesheet):
+        (WebCore::Document::usesStyleBasedEditability):
+        (WebCore::Document::processHttpEquiv):
+        (WebCore::Document::setSelectedStylesheetSet):
+        * dom/ExtensionStyleSheets.cpp:
+        (WebCore::ExtensionStyleSheets::clearPageUserSheet):
+        (WebCore::ExtensionStyleSheets::updatePageUserSheet):
+        (WebCore::ExtensionStyleSheets::invalidateInjectedStyleSheetCache):
+        (WebCore::ExtensionStyleSheets::addUserStyleSheet):
+        (WebCore::ExtensionStyleSheets::addAuthorStyleSheetForTesting):
+        (WebCore::ExtensionStyleSheets::styleResolverChangedTimerFired):
+        * dom/InlineStyleSheetOwner.cpp:
+        (WebCore::InlineStyleSheetOwner::removedFromDocument):
+        * dom/ProcessingInstruction.cpp:
+        (WebCore::ProcessingInstruction::removedFrom):
+        * dom/ShadowRoot.cpp:
+        (WebCore::ShadowRoot::updateStyle):
+        * html/HTMLLinkElement.cpp:
+        (WebCore::HTMLLinkElement::setDisabledState):
+        (WebCore::HTMLLinkElement::parseAttribute):
+        (WebCore::HTMLLinkElement::process):
+        (WebCore::HTMLLinkElement::removedFrom):
+        (WebCore::HTMLLinkElement::removePendingSheet):
+        * html/HTMLStyleElement.cpp:
+        (WebCore::HTMLStyleElement::parseAttribute):
+        * inspector/InspectorCSSAgent.cpp:
+        (WebCore::InspectorCSSAgent::forcePseudoState):
+        (WebCore::InspectorCSSAgent::resetPseudoStates):
+        * inspector/InspectorPageAgent.cpp:
+        (WebCore::InspectorPageAgent::setEmulatedMedia):
+        * page/Frame.cpp:
+        (WebCore::Frame::setPrinting):
+        * page/FrameView.cpp:
+        (WebCore::FrameView::layout):
+        (WebCore::FrameView::setPagination):
+        (WebCore::FrameView::setViewportSizeForCSSViewportUnits):
+        * page/Page.cpp:
+        (WebCore::Page::setViewMode):
+        (WebCore::Page::setNeedsRecalcStyleInAllFrames):
+        (WebCore::Page::invalidateInjectedStyleSheetCacheInAllFrames):
+        * svg/SVGFontFaceElement.cpp:
+        (WebCore::SVGFontFaceElement::rebuildFontFace):
+        (WebCore::SVGFontFaceElement::removedFrom):
+        * xml/XMLTreeViewer.cpp:
+        (WebCore::XMLTreeViewer::transformDocumentToTreeView):
+        * xml/parser/XMLDocumentParser.cpp:
+        (WebCore::XMLDocumentParser::end):
+        * xml/parser/XMLDocumentParserLibxml2.cpp:
+        (WebCore::XMLDocumentParser::doEnd):
+
</ins><span class="cx"> 2016-09-24  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, update results of DOM binding tests after r206354.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSStyleSheetcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSStyleSheet.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/css/CSSStyleSheet.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -179,11 +179,11 @@
</span><span class="cx">                 resolver-&gt;addKeyframeStyle(*insertedKeyframesRule);
</span><span class="cx">             return;
</span><span class="cx">         }
</span><del>-        owner-&gt;authorStyleSheets().scheduleOptimizedUpdate();
</del><ins>+        owner-&gt;authorStyleSheets().scheduleActiveSetUpdate();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    owner-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    owner-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</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-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    owner-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</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-&gt;authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+    owner-&gt;authorStyleSheets().didChangeCandidatesForActiveSet();
</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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx"> 
</span><span class="cx"> AuthorStyleSheets::AuthorStyleSheets(Document&amp; document)
</span><span class="cx">     : m_document(document)
</span><del>-    , m_optimizedUpdateTimer(*this, &amp;AuthorStyleSheets::optimizedUpdateTimerFired)
</del><ins>+    , m_pendingUpdateTimer(*this, &amp;AuthorStyleSheets::pendingUpdateTimerFired)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx"> AuthorStyleSheets::AuthorStyleSheets(ShadowRoot&amp; shadowRoot)
</span><span class="cx">     : m_document(shadowRoot.documentScope())
</span><span class="cx">     , m_shadowRoot(&amp;shadowRoot)
</span><del>-    , m_optimizedUpdateTimer(*this, &amp;AuthorStyleSheets::optimizedUpdateTimerFired)
</del><ins>+    , m_pendingUpdateTimer(*this, &amp;AuthorStyleSheets::pendingUpdateTimerFired)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -213,14 +213,12 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-AuthorStyleSheets::StyleResolverUpdateType AuthorStyleSheets::analyzeStyleSheetChange(UpdateFlag updateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, bool&amp; requiresFullStyleRecalc)
</del><ins>+AuthorStyleSheets::StyleResolverUpdateType AuthorStyleSheets::analyzeStyleSheetChange(const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, bool&amp; requiresFullStyleRecalc)
</ins><span class="cx"> {
</span><span class="cx">     requiresFullStyleRecalc = true;
</span><span class="cx">     
</span><span class="cx">     unsigned newStylesheetCount = newStylesheets.size();
</span><span class="cx"> 
</span><del>-    if (updateFlag != OptimizedUpdate)
-        return Reconstruct;
</del><span class="cx">     if (!m_document.styleResolverIfExists())
</span><span class="cx">         return Reconstruct;
</span><span class="cx"> 
</span><span class="lines">@@ -282,20 +280,33 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool AuthorStyleSheets::updateActiveStyleSheets(UpdateFlag updateFlag)
</del><ins>+void AuthorStyleSheets::updateActiveStyleSheets(UpdateType updateType)
</ins><span class="cx"> {
</span><ins>+    ASSERT(!m_pendingUpdateType);
+
</ins><span class="cx">     if (m_document.inStyleRecalc() || m_document.inRenderTreeUpdate()) {
</span><span class="cx">         // Protect against deleting style resolver in the middle of a style resolution.
</span><del>-        // Crash stacks indicate we can get here when z resource load fails synchronously (for example due to content blocking).
</del><ins>+        // Crash stacks indicate we can get here when a resource load fails synchronously (for example due to content blocking).
</ins><span class="cx">         // FIXME: These kind of cases should be eliminated and this path replaced by an assert.
</span><del>-        m_pendingUpdateType = FullUpdate;
</del><ins>+        m_pendingUpdateType = UpdateType::ContentsOrInterpretation;
</ins><span class="cx">         m_document.scheduleForcedStyleRecalc();
</span><del>-        return false;
</del><ins>+        return;
+    }
</ins><span class="cx"> 
</span><ins>+    if (!m_document.hasLivingRenderTree()) {
+        m_document.clearStyleResolver();
+        return;
</ins><span class="cx">     }
</span><del>-    if (!m_document.hasLivingRenderTree())
-        return false;
</del><span class="cx"> 
</span><ins>+    // Don't bother updating, since we haven't loaded all our style info yet
+    // and haven't calculated the style resolver for the first time.
+    if (!m_shadowRoot &amp;&amp; !m_didUpdateActiveStyleSheets &amp;&amp; m_pendingStyleSheetCount) {
+        m_document.clearStyleResolver();
+        return;
+    }
+
+    m_didUpdateActiveStyleSheets = true;
+
</ins><span class="cx">     Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; activeStyleSheets;
</span><span class="cx">     collectActiveStyleSheets(activeStyleSheets);
</span><span class="cx"> 
</span><span class="lines">@@ -304,8 +315,10 @@
</span><span class="cx">     activeCSSStyleSheets.appendVector(m_document.extensionStyleSheets().authorStyleSheetsForTesting());
</span><span class="cx">     filterEnabledNonemptyCSSStyleSheets(activeCSSStyleSheets, activeStyleSheets);
</span><span class="cx"> 
</span><del>-    bool requiresFullStyleRecalc;
-    auto styleResolverUpdateType = analyzeStyleSheetChange(updateFlag, activeCSSStyleSheets, requiresFullStyleRecalc);
</del><ins>+    bool requiresFullStyleRecalc = true;
+    StyleResolverUpdateType styleResolverUpdateType = Reconstruct;
+    if (updateType == UpdateType::ActiveSet)
+        styleResolverUpdateType = analyzeStyleSheetChange(activeCSSStyleSheets, requiresFullStyleRecalc);
</ins><span class="cx"> 
</span><span class="cx">     updateStyleResolver(activeCSSStyleSheets, styleResolverUpdateType);
</span><span class="cx"> 
</span><span class="lines">@@ -321,9 +334,13 @@
</span><span class="cx">         if (sheet-&gt;contents().usesStyleBasedEditability())
</span><span class="cx">             m_usesStyleBasedEditability = true;
</span><span class="cx">     }
</span><del>-    m_pendingUpdateType = NoUpdate;
</del><span class="cx"> 
</span><del>-    return requiresFullStyleRecalc;
</del><ins>+    if (requiresFullStyleRecalc) {
+        if (m_shadowRoot)
+            m_shadowRoot-&gt;setNeedsStyleRecalc();
+        else
+            m_document.scheduleForcedStyleRecalc();
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void AuthorStyleSheets::updateStyleResolver(Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; activeStyleSheets, StyleResolverUpdateType updateType)
</span><span class="lines">@@ -386,64 +403,48 @@
</span><span class="cx">     return m_weakCopyOfActiveStyleSheetListForFastLookup-&gt;contains(sheet);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AuthorStyleSheets::flushPendingUpdates()
</del><ins>+void AuthorStyleSheets::flushPendingUpdate()
</ins><span class="cx"> {
</span><del>-    if (m_pendingUpdateType == NoUpdate)
</del><ins>+    if (!m_pendingUpdateType)
</ins><span class="cx">         return;
</span><del>-    updateActiveStyleSheets(m_pendingUpdateType);
</del><ins>+    auto updateType = *m_pendingUpdateType;
+
+    clearPendingUpdate();
+
+    updateActiveStyleSheets(updateType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AuthorStyleSheets::scheduleOptimizedUpdate()
</del><ins>+void AuthorStyleSheets::clearPendingUpdate()
</ins><span class="cx"> {
</span><del>-    if (m_optimizedUpdateTimer.isActive())
-        return;
-    if (m_pendingUpdateType == NoUpdate)
-        m_pendingUpdateType = OptimizedUpdate;
-    m_optimizedUpdateTimer.startOneShot(0);
</del><ins>+    m_pendingUpdateTimer.stop();
+    m_pendingUpdateType = { };
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AuthorStyleSheets::didChange(StyleResolverUpdateFlag updateFlag)
</del><ins>+void AuthorStyleSheets::scheduleActiveSetUpdate()
</ins><span class="cx"> {
</span><del>-    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 &amp;&amp; !m_didCalculateStyleResolver &amp;&amp; m_pendingStyleSheetCount)) {
-        m_document.clearStyleResolver();
</del><ins>+    if (m_pendingUpdateTimer.isActive())
</ins><span class="cx">         return;
</span><del>-    }
-    m_didCalculateStyleResolver = true;
</del><ins>+    if (!m_pendingUpdateType)
+        m_pendingUpdateType = UpdateType::ActiveSet;
+    m_pendingUpdateTimer.startOneShot(0);
+}
</ins><span class="cx"> 
</span><del>-    auto styleSheetUpdate = (updateFlag == RecalcStyleIfNeeded || updateFlag == DeferRecalcStyleIfNeeded)
-        ? AuthorStyleSheets::OptimizedUpdate
-        : AuthorStyleSheets::FullUpdate;
-    bool stylesheetChangeRequiresStyleRecalc = updateActiveStyleSheets(styleSheetUpdate);
</del><ins>+void AuthorStyleSheets::didChangeCandidatesForActiveSet()
+{
+    auto updateType = m_pendingUpdateType.valueOr(UpdateType::ActiveSet);
+    clearPendingUpdate();
+    updateActiveStyleSheets(updateType);
+}
</ins><span class="cx"> 
</span><del>-    auto scheduleStyleRecalc = [&amp;] {
-        if (m_shadowRoot)
-            m_shadowRoot-&gt;setNeedsStyleRecalc();
-        else
-            m_document.scheduleForcedStyleRecalc();
-    };
-
-    if (updateFlag == DeferRecalcStyle) {
-        scheduleStyleRecalc();
-        return;
-    }
-
-    if (updateFlag == DeferRecalcStyleIfNeeded) {
-        if (stylesheetChangeRequiresStyleRecalc)
-            scheduleStyleRecalc();
-        return;
-    }
-
-    if (stylesheetChangeRequiresStyleRecalc)
-        m_document.recalcStyle(Style::Force);
</del><ins>+void AuthorStyleSheets::didChangeContentsOrInterpretation()
+{
+    clearPendingUpdate();
+    updateActiveStyleSheets(UpdateType::ContentsOrInterpretation);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void AuthorStyleSheets::optimizedUpdateTimerFired()
</del><ins>+void AuthorStyleSheets::pendingUpdateTimerFired()
</ins><span class="cx"> {
</span><del>-    didChange(RecalcStyleIfNeeded);
</del><ins>+    flushPendingUpdate();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoredomAuthorStyleSheetsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/AuthorStyleSheets.h (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/AuthorStyleSheets.h        2016-09-25 13:32:24 UTC (rev 206361)
</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,6 @@
</span><span class="cx">     void addStyleSheetCandidateNode(Node&amp;, bool createdByParser);
</span><span class="cx">     void removeStyleSheetCandidateNode(Node&amp;);
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void didChange(StyleResolverUpdateFlag);
-
</del><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&amp; name) { m_preferredStylesheetSetName = name; }
</span><span class="lines">@@ -91,13 +82,16 @@
</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><ins>+    void didChangeCandidatesForActiveSet();
+    void scheduleActiveSetUpdate();
+    WEBCORE_EXPORT void didChangeContentsOrInterpretation();
</ins><span class="cx"> 
</span><ins>+    bool hasPendingUpdate() const { return !!m_pendingUpdateType; }
+    void flushPendingUpdate();
+
</ins><span class="cx"> private:
</span><del>-    enum UpdateFlag { NoUpdate = 0, OptimizedUpdate, FullUpdate };
-    bool updateActiveStyleSheets(UpdateFlag);
</del><ins>+    enum class UpdateType { ActiveSet, ContentsOrInterpretation };
+    void updateActiveStyleSheets(UpdateType);
</ins><span class="cx"> 
</span><span class="cx">     void collectActiveStyleSheets(Vector&lt;RefPtr&lt;StyleSheet&gt;&gt;&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -106,10 +100,11 @@
</span><span class="cx">         Reset,
</span><span class="cx">         Additive
</span><span class="cx">     };
</span><del>-    StyleResolverUpdateType analyzeStyleSheetChange(UpdateFlag, const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, bool&amp; requiresFullStyleRecalc);
</del><ins>+    StyleResolverUpdateType analyzeStyleSheetChange(const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; newStylesheets, bool&amp; requiresFullStyleRecalc);
</ins><span class="cx">     void updateStyleResolver(Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp;, StyleResolverUpdateType);
</span><span class="cx"> 
</span><del>-    void optimizedUpdateTimerFired();
</del><ins>+    void pendingUpdateTimerFired();
+    void clearPendingUpdate();
</ins><span class="cx"> 
</span><span class="cx">     Document&amp; m_document;
</span><span class="cx">     ShadowRoot* m_shadowRoot { nullptr };
</span><span class="lines">@@ -117,7 +112,7 @@
</span><span class="cx">     Vector&lt;RefPtr&lt;StyleSheet&gt;&gt; m_styleSheetsForStyleSheetList;
</span><span class="cx">     Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt; m_activeStyleSheets;
</span><span class="cx"> 
</span><del>-    Timer m_optimizedUpdateTimer;
</del><ins>+    Timer m_pendingUpdateTimer;
</ins><span class="cx"> 
</span><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&lt;HashSet&lt;const CSSStyleSheet*&gt;&gt; m_weakCopyOfActiveStyleSheetListForFastLookup;
</span><span class="lines">@@ -127,9 +122,9 @@
</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><ins>+    bool m_didUpdateActiveStyleSheets { false };
</ins><span class="cx"> 
</span><del>-    UpdateFlag m_pendingUpdateType { NoUpdate };
</del><ins>+    Optional&lt;UpdateType&gt; m_pendingUpdateType;
</ins><span class="cx"> 
</span><span class="cx">     ListHashSet&lt;Node*&gt; m_styleSheetCandidateNodes;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/Document.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1355,7 +1355,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-&gt;didChange(DeferRecalcStyle);
</del><ins>+    m_authorStyleSheets-&gt;didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::setXMLVersion(const String&amp; version, ExceptionCode&amp; ec)
</span><span class="lines">@@ -1859,7 +1859,7 @@
</span><span class="cx">     // re-attaching our containing iframe, which when asked HTMLFrameElementBase::isURLAllowed
</span><span class="cx">     // hits a null-dereference due to security code always assuming the document has a SecurityOrigin.
</span><span class="cx"> 
</span><del>-    authorStyleSheets().flushPendingUpdates();
</del><ins>+    authorStyleSheets().flushPendingUpdate();
</ins><span class="cx"> 
</span><span class="cx">     frameView.willRecalcStyle();
</span><span class="cx"> 
</span><span class="lines">@@ -1959,13 +1959,12 @@
</span><span class="cx">     if (!view() || view()-&gt;isInRenderTreeLayout())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    if (authorStyleSheets().hasPendingUpdate())
-        authorStyleSheets().didChange(RecalcStyleIfNeeded);
</del><ins>+    authorStyleSheets().flushPendingUpdate();
</ins><span class="cx"> 
</span><span class="cx">     if (!needsStyleRecalc())
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    recalcStyle(Style::NoChange);
</del><ins>+    recalcStyle();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::updateLayout()
</span><span class="lines">@@ -2014,7 +2013,8 @@
</span><span class="cx">         HTMLElement* bodyElement = bodyOrFrameset();
</span><span class="cx">         if (bodyElement &amp;&amp; !bodyElement-&gt;renderer() &amp;&amp; m_pendingSheetLayout == NoLayoutWithPendingSheets) {
</span><span class="cx">             m_pendingSheetLayout = DidLayoutWithPendingSheets;
</span><del>-            authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+            authorStyleSheets().didChangeContentsOrInterpretation();
+            recalcStyle(Style::Force);
</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 +3151,7 @@
</span><span class="cx"> {
</span><span class="cx">     m_needsNotifyRemoveAllPendingStylesheet = false;
</span><span class="cx"> 
</span><del>-    authorStyleSheets().didChange(DeferRecalcStyleIfNeeded);
</del><ins>+    authorStyleSheets().didChangeCandidatesForActiveSet();
</ins><span class="cx"> 
</span><span class="cx">     if (m_pendingSheetLayout == DidLayoutWithPendingSheets) {
</span><span class="cx">         m_pendingSheetLayout = IgnoreLayoutWithPendingSheets;
</span><span class="lines">@@ -3182,7 +3182,7 @@
</span><span class="cx">     ASSERT(!m_inStyleRecalc);
</span><span class="cx"> 
</span><span class="cx">     auto&amp; authorSheets = const_cast&lt;AuthorStyleSheets&amp;&gt;(authorStyleSheets());
</span><del>-    authorSheets.flushPendingUpdates();
</del><ins>+    authorSheets.flushPendingUpdate();
</ins><span class="cx">     return authorSheets.usesStyleBasedEditability();
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -3226,7 +3226,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>+        authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">         break;
</span><span class="cx"> 
</span><span class="cx">     case HTTPHeaderName::Refresh: {
</span><span class="lines">@@ -3530,7 +3530,7 @@
</span><span class="cx"> void Document::setSelectedStylesheetSet(const String&amp; aString)
</span><span class="cx"> {
</span><span class="cx">     authorStyleSheets().setSelectedStylesheetSetName(aString);
</span><del>-    authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void Document::evaluateMediaQueryList()
</span></span></pre></div>
<a id="trunkSourceWebCoredomExtensionStyleSheetscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/ExtensionStyleSheets.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -83,7 +83,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (m_pageUserSheet) {
</span><span class="cx">         m_pageUserSheet = nullptr;
</span><del>-        m_document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+        m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -91,7 +91,7 @@
</span><span class="cx"> {
</span><span class="cx">     clearPageUserSheet();
</span><span class="cx">     if (pageUserSheet())
</span><del>-        m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> const Vector&lt;RefPtr&lt;CSSStyleSheet&gt;&gt;&amp; ExtensionStyleSheets::injectedUserStyleSheets() const
</span><span class="lines">@@ -155,7 +155,7 @@
</span><span class="cx">     m_injectedStyleSheetCacheValid = false;
</span><span class="cx">     if (m_injectedUserStyleSheets.isEmpty() &amp;&amp; m_injectedAuthorStyleSheets.isEmpty())
</span><span class="cx">         return;
</span><del>-    m_document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ExtensionStyleSheets::addUserStyleSheet(Ref&lt;StyleSheetContents&gt;&amp;&amp; userSheet)
</span><span class="lines">@@ -162,7 +162,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(userSheet.get().isUserStyleSheet());
</span><span class="cx">     m_userStyleSheets.append(CSSStyleSheet::create(WTFMove(userSheet), m_document));
</span><del>-    m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ExtensionStyleSheets::addAuthorStyleSheetForTesting(Ref&lt;StyleSheetContents&gt;&amp;&amp; authorSheet)
</span><span class="lines">@@ -169,7 +169,7 @@
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!authorSheet.get().isUserStyleSheet());
</span><span class="cx">     m_authorStyleSheetsForTesting.append(CSSStyleSheet::create(WTFMove(authorSheet), m_document));
</span><del>-    m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTENT_EXTENSIONS)
</span><span class="lines">@@ -201,7 +201,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ExtensionStyleSheets::styleResolverChangedTimerFired()
</span><span class="cx"> {
</span><del>-    m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ExtensionStyleSheets::detachFromDocument()
</span></span></pre></div>
<a id="trunkSourceWebCoredomInlineStyleSheetOwnercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/InlineStyleSheetOwner.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</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.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InlineStyleSheetOwner::clearDocumentData(Document&amp;, Element&amp; element)
</span></span></pre></div>
<a id="trunkSourceWebCoredomProcessingInstructioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ProcessingInstruction.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/ProcessingInstruction.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -277,7 +277,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().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void ProcessingInstruction::finishParsingChildren()
</span></span></pre></div>
<a id="trunkSourceWebCoredomShadowRootcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ShadowRoot.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/dom/ShadowRoot.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -111,7 +111,7 @@
</span><span class="cx">     if (!m_authorStyleSheets)
</span><span class="cx">         return;
</span><span class="cx">     // FIXME: Make optimized updated work.
</span><del>-    m_authorStyleSheets-&gt;didChange(DeferRecalcStyle);
</del><ins>+    m_authorStyleSheets-&gt;didChangeContentsOrInterpretation();
</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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/html/HTMLLinkElement.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -140,7 +140,7 @@
</span><span class="cx">         if (!m_sheet &amp;&amp; m_disabledState == EnabledViaScript)
</span><span class="cx">             process();
</span><span class="cx">         else
</span><del>-            document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+            document().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -176,7 +176,7 @@
</span><span class="cx">         m_media = value.string().convertToASCIILowercase();
</span><span class="cx">         process();
</span><span class="cx">         if (m_sheet &amp;&amp; !isDisabled())
</span><del>-            document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+            document().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     if (name == disabledAttr) {
</span><span class="lines">@@ -283,7 +283,7 @@
</span><span class="cx">     } else if (m_sheet) {
</span><span class="cx">         // we no longer contain a stylesheet, e.g. perhaps rel or type was changed
</span><span class="cx">         clearSheet();
</span><del>-        document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+        document().authorStyleSheets().didChangeContentsOrInterpretation();
</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().authorStyleSheets().didChangeCandidatesForActiveSet();
</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().didChangeCandidatesForActiveSet();
</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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/html/HTMLStyleElement.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -78,7 +78,7 @@
</span><span class="cx">         if (sheet()) {
</span><span class="cx">             sheet()-&gt;setMediaQueries(MediaQuerySet::createAllowingDescriptionSyntax(value));
</span><span class="cx">             if (inDocument() &amp;&amp; document().hasLivingRenderTree())
</span><del>-                document().authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+                document().authorStyleSheets().didChangeContentsOrInterpretation();
</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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/inspector/InspectorCSSAgent.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</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-&gt;document().authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    element-&gt;document().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void InspectorCSSAgent::getNamedFlowCollection(ErrorString&amp; errorString, int documentNodeId, RefPtr&lt;Inspector::Protocol::Array&lt;Inspector::Protocol::CSS::NamedFlow&gt;&gt;&amp; 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&amp; document : documentsToChange)
</span><del>-        document-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreinspectorInspectorPageAgentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/inspector/InspectorPageAgent.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/inspector/InspectorPageAgent.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1002,7 +1002,7 @@
</span><span class="cx">     m_emulatedMedia = media;
</span><span class="cx">     Document* document = m_page.mainFrame().document();
</span><span class="cx">     if (document) {
</span><del>-        document-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">         document-&gt;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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Frame.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/page/Frame.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -644,7 +644,7 @@
</span><span class="cx">     m_doc-&gt;setPrinting(printing);
</span><span class="cx">     view()-&gt;adjustMediaTypeForPrinting(printing);
</span><span class="cx"> 
</span><del>-    m_doc-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    m_doc-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     if (shouldUsePrintingLayout()) {
</span><span class="cx">         view()-&gt;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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/page/FrameView.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1301,7 +1301,7 @@
</span><span class="cx">         StyleResolver* styleResolver = document.styleResolverIfExists();
</span><span class="cx">         if (!styleResolver || styleResolver-&gt;hasMediaQueriesAffectedByViewportChange()) {
</span><span class="cx">             LOG(Layout, &quot;  hasMediaQueriesAffectedByViewportChange, enqueueing style recalc&quot;);
</span><del>-            document.authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+            document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">             // FIXME: This instrumentation event is not strictly accurate since cached media query results do not persist across StyleResolver rebuilds.
</span><span class="cx">             InspectorInstrumentation::mediaQueryResultChanged(document);
</span><span class="cx">         } else
</span><span class="lines">@@ -3496,7 +3496,7 @@
</span><span class="cx"> 
</span><span class="cx">     m_pagination = pagination;
</span><span class="cx"> 
</span><del>-    frame().document()-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    frame().document()-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> IntRect FrameView::windowClipRect() const
</span><span class="lines">@@ -4965,7 +4965,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-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+        document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx">     
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/page/Page.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -424,7 +424,7 @@
</span><span class="cx">         m_mainFrame-&gt;view()-&gt;forceLayout();
</span><span class="cx"> 
</span><span class="cx">     if (m_mainFrame-&gt;document())
</span><del>-        m_mainFrame-&gt;document()-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        m_mainFrame-&gt;document()-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> #endif // ENABLE(VIEW_MODE_CSS_MEDIA)
</span><span class="cx"> 
</span><span class="lines">@@ -502,7 +502,7 @@
</span><span class="cx"> {
</span><span class="cx">     for (Frame* frame = &amp;mainFrame(); frame; frame = frame-&gt;tree().traverseNext()) {
</span><span class="cx">         if (Document* document = frame-&gt;document())
</span><del>-            document-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+            document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1163,7 +1163,7 @@
</span><span class="cx">         if (!document)
</span><span class="cx">             continue;
</span><span class="cx">         document-&gt;extensionStyleSheets().invalidateInjectedStyleSheetCache();
</span><del>-        document-&gt;authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+        document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</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 (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/svg/SVGFontFaceElement.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -267,7 +267,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+    document().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> Node::InsertionNotificationRequest SVGFontFaceElement::insertedInto(ContainerNode&amp; rootParent)
</span><span class="lines">@@ -292,7 +292,7 @@
</span><span class="cx">         document().accessSVGExtensions().unregisterSVGFontFaceElement(this);
</span><span class="cx">         m_fontFaceRule-&gt;mutableProperties().clear();
</span><span class="cx"> 
</span><del>-        document().authorStyleSheets().didChange(DeferRecalcStyle);
</del><ins>+        document().authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     } else
</span><span class="cx">         ASSERT(!m_fontElement);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorexmlXMLTreeViewercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/XMLTreeViewer.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/xml/XMLTreeViewer.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -64,7 +64,7 @@
</span><span class="cx">     String cssString = StringImpl::createWithoutCopying(XMLViewer_css, sizeof(XMLViewer_css));
</span><span class="cx">     auto text = m_document.createTextNode(cssString);
</span><span class="cx">     m_document.getElementById(String(ASCIILiteral(&quot;xml-viewer-style&quot;)))-&gt;appendChild(text, IGNORE_EXCEPTION);
</span><del>-    m_document.authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+    m_document.authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParser.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -200,7 +200,7 @@
</span><span class="cx">         insertErrorMessageBlock();
</span><span class="cx">     else {
</span><span class="cx">         updateLeafTextNode();
</span><del>-        document()-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        document()-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (isParsing())
</span></span></pre></div>
<a id="trunkSourceWebCorexmlparserXMLDocumentParserLibxml2cpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebCore/xml/parser/XMLDocumentParserLibxml2.cpp        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1387,7 +1387,7 @@
</span><span class="cx">         document()-&gt;setTransformSource(std::make_unique&lt;TransformSource&gt;(doc));
</span><span class="cx"> 
</span><span class="cx">         document()-&gt;setParsing(false); // Make the document think it's done, so it will apply XSL stylesheets.
</span><del>-        document()-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+        document()-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx"> 
</span><span class="cx">         // styleResolverChanged() call can detach the parser and null out its document.
</span><span class="cx">         // In that case, we just bail out.
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebKit/mac/ChangeLog        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-09-25  Antti Koivisto  &lt;antti@apple.com&gt;
+
+        AuthorStyleSheets shouldn't trigger synchronous style resolutions
+        https://bugs.webkit.org/show_bug.cgi?id=162532
+
+        Reviewed by Darin Adler.
+
+        * WebView/WebHTMLView.mm:
+        (-[WebHTMLView reapplyStyles]):
+        (-[WebHTMLView _setPrinting:minimumPageLogicalWidth:logicalHeight:originalPageWidth:originalPageHeight:maximumShrinkRatio:adjustViewSize:paginateScreenContent:]):
+
</ins><span class="cx"> 2016-09-24  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Move stylesheet change logic from Document to AuthorStyleSheets
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebHTMLViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebHTMLView.mm (206360 => 206361)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-25 07:01:35 UTC (rev 206360)
+++ trunk/Source/WebKit/mac/WebView/WebHTMLView.mm        2016-09-25 13:32:24 UTC (rev 206361)
</span><span class="lines">@@ -3611,10 +3611,12 @@
</span><span class="cx">     double start = CFAbsoluteTimeGetCurrent();
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    if (Frame* coreFrame = core([self _frame]))
-        coreFrame-&gt;document()-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
-    
-#ifdef LOG_TIMES        
</del><ins>+    if (Frame* coreFrame = core([self _frame])) {
+        coreFrame-&gt;document()-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
+        coreFrame-&gt;document()-&gt;updateStyleIfNeeded();
+    }
+
+#ifdef LOG_TIMES
</ins><span class="cx">     double thisTime = CFAbsoluteTimeGetCurrent() - start;
</span><span class="cx">     LOG(Timing, &quot;%s apply style seconds = %f&quot;, [self URL], thisTime);
</span><span class="cx"> #endif
</span><span class="lines">@@ -5005,7 +5007,7 @@
</span><span class="cx"> 
</span><span class="cx">             document-&gt;setPaginatedForScreen(_private-&gt;paginateScreenContent);
</span><span class="cx">             document-&gt;setPrinting(_private-&gt;printing);
</span><del>-            document-&gt;authorStyleSheets().didChange(RecalcStyleImmediately);
</del><ins>+            document-&gt;authorStyleSheets().didChangeContentsOrInterpretation();
</ins><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>