<!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>[150388] 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/150388">150388</a></dd>
<dt>Author</dt> <dd>timothy_horton@apple.com</dd>
<dt>Date</dt> <dd>2013-05-20 16:43:33 -0700 (Mon, 20 May 2013)</dd>
</dl>

<h3>Log Message</h3>
<pre>Clients should have a way to extend rendering suppression
https://bugs.webkit.org/show_bug.cgi?id=116463
&lt;rdar://problem/13738496&gt;

Reviewed by Andy Estes.

* WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
(WKBundlePageExtendIncrementalRenderingSuppression): Added.
(WKBundlePageStopExtendingIncrementalRenderingSuppression): Added.
* WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
These only have any effect if SuppressesIncrementalRendering is also enabled.

* WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
(WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
Inform the FrameView if there are any outstanding rendering suppression tokens.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::extendIncrementalRenderingSuppression):
Return the next available rendering suppression token.
Add it to the list of active tokens.
Inform the FrameView that we want to suppress rendering.

(WebKit::WebPage::stopExtendingIncrementalRenderingSuppression):
Remove the given token from the list of active tokens.
Un-suppress rendering if appropriate.

* WebProcess/WebPage/WebPage.h:
(WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
Return if there are any active rendering suppression tokens.

* WebCore.exp.in:
Export FrameView::setVisualUpdatesAllowedByClient.

* dom/Document.cpp:
(WebCore::Document::setVisualUpdatesAllowed):
Move rendering-suppression watchdog into setVisualUpdatesAllowed(bool).
setVisualUpdatesAllowed(ReadyState) should not re-enable visual updates
if the client is itself disabling visual updates.

(WebCore::Document::visualUpdatesSuppressionTimerFired):
If the watchdog fires and the client is still disabling visual
updates, we should not re-enable visual updates, but instead
wait for the client.

(WebCore::Document::setVisualUpdatesAllowedByClient):
Actually re-enable visual updates if we deferred the re-enabling above
(when the page finishes loading, but the client had them disabled).

* dom/Document.h:
(Document): Add setVisualUpdatesAllowedByClient.
* page/FrameView.cpp:
(WebCore::FrameView::FrameView): Visual updates are allowed by default.
(WebCore::FrameView::setVisualUpdatesAllowedByClient):
Forward through to the document, but we also need to persist the state
here in FrameView so that it survives through navigation.

* page/FrameView.h:
(WebCore::FrameView::setVisualUpdatesAllowedByClient): Added.
(WebCore::FrameView::visualUpdatesAllowedByClient): Added.
Added storage for m_visualUpdatesAllowedByClient.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCoreexpin">trunk/Source/WebCore/WebCore.exp.in</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="#trunkSourceWebCorepageFrameViewcpp">trunk/Source/WebCore/page/FrameView.cpp</a></li>
<li><a href="#trunkSourceWebCorepageFrameViewh">trunk/Source/WebCore/page/FrameView.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh">trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp">trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPageh">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/ChangeLog        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2013-05-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Clients should have a way to extend rendering suppression
+        https://bugs.webkit.org/show_bug.cgi?id=116463
+        &lt;rdar://problem/13738496&gt;
+
+        Reviewed by Andy Estes.
+
+        * WebCore.exp.in:
+        Export FrameView::setVisualUpdatesAllowedByClient.
+
+        * dom/Document.cpp:
+        (WebCore::Document::setVisualUpdatesAllowed):
+        Move rendering-suppression watchdog into setVisualUpdatesAllowed(bool).
+        setVisualUpdatesAllowed(ReadyState) should not re-enable visual updates
+        if the client is itself disabling visual updates.
+
+        (WebCore::Document::visualUpdatesSuppressionTimerFired):
+        If the watchdog fires and the client is still disabling visual
+        updates, we should not re-enable visual updates, but instead
+        wait for the client.
+
+        (WebCore::Document::setVisualUpdatesAllowedByClient):
+        Actually re-enable visual updates if we deferred the re-enabling above
+        (when the page finishes loading, but the client had them disabled).
+
+        * dom/Document.h:
+        (Document): Add setVisualUpdatesAllowedByClient.
+        * page/FrameView.cpp:
+        (WebCore::FrameView::FrameView): Visual updates are allowed by default.
+        (WebCore::FrameView::setVisualUpdatesAllowedByClient):
+        Forward through to the document, but we also need to persist the state
+        here in FrameView so that it survives through navigation.
+
+        * page/FrameView.h:
+        (WebCore::FrameView::setVisualUpdatesAllowedByClient): Added.
+        (WebCore::FrameView::visualUpdatesAllowedByClient): Added.
+        Added storage for m_visualUpdatesAllowedByClient.
+
</ins><span class="cx"> 2013-05-20  Hans Muller  &lt;hmuller@adobe.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Exclusions] Add CSS parsing support for image URI shape-inside and shape-outside values
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.exp.in (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.exp.in        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/WebCore.exp.in        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1161,6 +1161,7 @@
</span><span class="cx"> __ZN7WebCore9FrameView26adjustPageHeightDeprecatedEPffff
</span><span class="cx"> __ZN7WebCore9FrameView26adjustTiledBackingCoverageEv
</span><span class="cx"> __ZN7WebCore9FrameView29setShouldUpdateWhileOffscreenEb
</span><ins>+__ZN7WebCore9FrameView31setVisualUpdatesAllowedByClientEb
</ins><span class="cx"> __ZN7WebCore9FrameView37setScrollingPerformanceLoggingEnabledEb
</span><span class="cx"> __ZN7WebCore9FrameView37updateLayoutAndStyleIfNeededRecursiveEv
</span><span class="cx"> __ZN7WebCore9FrameView38scrollPositionChangedViaPlatformWidgetEv
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/dom/Document.cpp        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1257,7 +1257,6 @@
</span><span class="cx">     case Loading:
</span><span class="cx">         ASSERT(!m_visualUpdatesSuppressionTimer.isActive());
</span><span class="cx">         ASSERT(m_visualUpdatesAllowed);
</span><del>-        m_visualUpdatesSuppressionTimer.startOneShot(settings()-&gt;incrementalRenderingSuppressionTimeoutInSeconds());
</del><span class="cx">         setVisualUpdatesAllowed(false);
</span><span class="cx">         break;
</span><span class="cx">     case Interactive:
</span><span class="lines">@@ -1266,7 +1265,10 @@
</span><span class="cx">     case Complete:
</span><span class="cx">         if (m_visualUpdatesSuppressionTimer.isActive()) {
</span><span class="cx">             ASSERT(!m_visualUpdatesAllowed);
</span><del>-            m_visualUpdatesSuppressionTimer.stop();
</del><ins>+
+            if (!view()-&gt;visualUpdatesAllowedByClient())
+                return;
+
</ins><span class="cx">             setVisualUpdatesAllowed(true);
</span><span class="cx">         } else
</span><span class="cx">             ASSERT(m_visualUpdatesAllowed);
</span><span class="lines">@@ -1281,6 +1283,11 @@
</span><span class="cx"> 
</span><span class="cx">     m_visualUpdatesAllowed = visualUpdatesAllowed;
</span><span class="cx"> 
</span><ins>+    if (visualUpdatesAllowed)
+        m_visualUpdatesSuppressionTimer.stop();
+    else
+        m_visualUpdatesSuppressionTimer.startOneShot(settings()-&gt;incrementalRenderingSuppressionTimeoutInSeconds());
+
</ins><span class="cx">     if (!visualUpdatesAllowed)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="lines">@@ -1308,9 +1315,21 @@
</span><span class="cx"> void Document::visualUpdatesSuppressionTimerFired(Timer&lt;Document&gt;*)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(!m_visualUpdatesAllowed);
</span><ins>+
+    // If the client is extending the visual update suppression period explicitly, the
+    // watchdog should not re-enable visual updates itself, but should wait for the client.
+    if (!view()-&gt;visualUpdatesAllowedByClient())
+        return;
+
</ins><span class="cx">     setVisualUpdatesAllowed(true);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void Document::setVisualUpdatesAllowedByClient(bool visualUpdatesAllowedByClient)
+{
+    if (visualUpdatesAllowedByClient &amp;&amp; m_readyState == Complete &amp;&amp; !visualUpdatesAllowed())
+        setVisualUpdatesAllowed(true);
+}
+
</ins><span class="cx"> String Document::encoding() const
</span><span class="cx"> {
</span><span class="cx">     if (TextResourceDecoder* d = decoder())
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/dom/Document.h        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1210,6 +1210,8 @@
</span><span class="cx"> 
</span><span class="cx">     void ensurePlugInsInjectedScript(DOMWrapperWorld*);
</span><span class="cx"> 
</span><ins>+    void setVisualUpdatesAllowedByClient(bool);
+
</ins><span class="cx"> protected:
</span><span class="cx">     Document(Frame*, const KURL&amp;, unsigned = DefaultDocumentClass);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.cpp (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.cpp        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/page/FrameView.cpp        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -202,6 +202,7 @@
</span><span class="cx"> #if ENABLE(CSS_FILTERS)
</span><span class="cx">     , m_hasSoftwareFilters(false)
</span><span class="cx"> #endif
</span><ins>+    , m_visualUpdatesAllowedByClient(true)
</ins><span class="cx"> {
</span><span class="cx">     init();
</span><span class="cx"> 
</span><span class="lines">@@ -4166,4 +4167,14 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void FrameView::setVisualUpdatesAllowedByClient(bool visualUpdatesAllowed)
+{
+    if (m_visualUpdatesAllowedByClient == visualUpdatesAllowed)
+        return;
+
+    m_visualUpdatesAllowedByClient = visualUpdatesAllowed;
+
+    m_frame-&gt;document()-&gt;setVisualUpdatesAllowedByClient(visualUpdatesAllowed);
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorepageFrameViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/FrameView.h (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/FrameView.h        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebCore/page/FrameView.h        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -423,6 +423,9 @@
</span><span class="cx">     void firePaintRelatedMilestones();
</span><span class="cx">     LayoutMilestones milestonesPendingPaint() const { return m_milestonesPendingPaint; }
</span><span class="cx"> 
</span><ins>+    bool visualUpdatesAllowedByClient() const { return m_visualUpdatesAllowedByClient; }
+    void setVisualUpdatesAllowedByClient(bool);
+
</ins><span class="cx"> protected:
</span><span class="cx">     virtual bool scrollContentsFastPath(const IntSize&amp; scrollDelta, const IntRect&amp; rectToScroll, const IntRect&amp; clipRect);
</span><span class="cx">     virtual void scrollContentsSlowPath(const IntRect&amp; updateRect);
</span><span class="lines">@@ -638,6 +641,8 @@
</span><span class="cx">     // the viewport given by the window or viewing area of the UA.
</span><span class="cx">     IntSize m_initialViewportSize;
</span><span class="cx"> #endif
</span><ins>+
+    bool m_visualUpdatesAllowedByClient;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline void FrameView::incrementVisuallyNonEmptyCharacterCount(unsigned count)
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/ChangeLog        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1,3 +1,36 @@
</span><ins>+2013-05-20  Tim Horton  &lt;timothy_horton@apple.com&gt;
+
+        Clients should have a way to extend rendering suppression
+        https://bugs.webkit.org/show_bug.cgi?id=116463
+        &lt;rdar://problem/13738496&gt;
+
+        Reviewed by Andy Estes.
+
+        * WebProcess/InjectedBundle/API/c/WKBundlePage.cpp:
+        (WKBundlePageExtendIncrementalRenderingSuppression): Added.
+        (WKBundlePageStopExtendingIncrementalRenderingSuppression): Added.
+        * WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h:
+        These only have any effect if SuppressesIncrementalRendering is also enabled.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::transitionToCommittedForNewPage):
+        Inform the FrameView if there are any outstanding rendering suppression tokens.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::extendIncrementalRenderingSuppression):
+        Return the next available rendering suppression token.
+        Add it to the list of active tokens.
+        Inform the FrameView that we want to suppress rendering.
+
+        (WebKit::WebPage::stopExtendingIncrementalRenderingSuppression):
+        Remove the given token from the list of active tokens.
+        Un-suppress rendering if appropriate.
+
+        * WebProcess/WebPage/WebPage.h:
+        (WebKit::WebPage::shouldExtendIncrementalRenderingSuppression):
+        Return if there are any active rendering suppression tokens.
+
</ins><span class="cx"> 2013-05-20  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         PPT: Closing tab that is hung or chewing 100% CPU leaves abandoned WebProcess.
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.cpp        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -506,3 +506,13 @@
</span><span class="cx"> {
</span><span class="cx">     return toImpl(pageRef)-&gt;canShowMIMEType(toWTFString(mimeTypeRef));
</span><span class="cx"> }
</span><ins>+
+WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef pageRef)
+{
+    return toImpl(pageRef)-&gt;extendIncrementalRenderingSuppression();
+}
+
+void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef pageRef, WKRenderingSuppressionToken token)
+{
+    toImpl(pageRef)-&gt;stopExtendingIncrementalRenderingSuppression(token);
+}
</ins></span></pre></div>
<a id="trunkSourceWebKit2WebProcessInjectedBundleAPIcWKBundlePagePrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePagePrivate.h        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -81,6 +81,11 @@
</span><span class="cx"> WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuItemTitles(WKBundlePageRef);
</span><span class="cx"> WK_EXPORT WKArrayRef WKBundlePageCopyContextMenuAtPointInWindow(WKBundlePageRef, WKPoint);
</span><span class="cx"> 
</span><ins>+// This only works if the SuppressesIncrementalRendering preference is set as well.
+typedef unsigned WKRenderingSuppressionToken;
+WK_EXPORT WKRenderingSuppressionToken WKBundlePageExtendIncrementalRenderingSuppression(WKBundlePageRef) WARN_UNUSED_RETURN;
+WK_EXPORT void WKBundlePageStopExtendingIncrementalRenderingSuppression(WKBundlePageRef, WKRenderingSuppressionToken);
+
</ins><span class="cx"> #ifdef __cplusplus
</span><span class="cx"> }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebCoreSupportWebFrameLoaderClientcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -1230,6 +1230,7 @@
</span><span class="cx">         m_frame-&gt;coreFrame()-&gt;view()-&gt;enableAutoSizeMode(true, IntSize(minimumLayoutWidth, 1), IntSize(maximumSize, maximumSize));
</span><span class="cx"> 
</span><span class="cx">     m_frame-&gt;coreFrame()-&gt;view()-&gt;setProhibitsScrolling(shouldDisableScrolling);
</span><ins>+    m_frame-&gt;coreFrame()-&gt;view()-&gt;setVisualUpdatesAllowedByClient(!webPage-&gt;shouldExtendIncrementalRenderingSuppression());
</ins><span class="cx"> 
</span><span class="cx"> #if USE(TILED_BACKING_STORE)
</span><span class="cx">     if (shouldUseFixedLayout) {
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -287,6 +287,7 @@
</span><span class="cx"> #endif
</span><span class="cx">     , m_inspectorClient(0)
</span><span class="cx">     , m_backgroundColor(Color::white)
</span><ins>+    , m_maximumRenderingSuppressionToken(0)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(m_pageID);
</span><span class="cx">     // FIXME: This is a non-ideal location for this Setting and
</span><span class="lines">@@ -4183,4 +4184,23 @@
</span><span class="cx">     m_loaderClient.featuresUsedInPage(this, namedFeatures);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+unsigned WebPage::extendIncrementalRenderingSuppression()
+{
+    unsigned token = m_maximumRenderingSuppressionToken++;
+
+    m_activeRenderingSuppressionTokens.add(token);
+    m_page-&gt;mainFrame()-&gt;view()-&gt;setVisualUpdatesAllowedByClient(false);
+
+    return token;
+}
+
+void WebPage::stopExtendingIncrementalRenderingSuppression(unsigned token)
+{
+    if (!m_activeRenderingSuppressionTokens.contains(token))
+        return;
+
+    m_activeRenderingSuppressionTokens.remove(token);
+    m_page-&gt;mainFrame()-&gt;view()-&gt;setVisualUpdatesAllowedByClient(!shouldExtendIncrementalRenderingSuppression());
+}
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (150387 => 150388)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2013-05-20 23:30:09 UTC (rev 150387)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h        2013-05-20 23:43:33 UTC (rev 150388)
</span><span class="lines">@@ -656,6 +656,10 @@
</span><span class="cx">     bool matchesPrimaryPlugIn(const String&amp; pageOrigin, const String&amp; pluginOrigin, const String&amp; mimeType) const;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+    unsigned extendIncrementalRenderingSuppression();
+    void stopExtendingIncrementalRenderingSuppression(unsigned token);
+    bool shouldExtendIncrementalRenderingSuppression() { return !m_activeRenderingSuppressionTokens.isEmpty(); }
+
</ins><span class="cx"> private:
</span><span class="cx">     WebPage(uint64_t pageID, const WebPageCreationParameters&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -1015,6 +1019,9 @@
</span><span class="cx"> 
</span><span class="cx">     HashSet&lt;String, CaseFoldingHash&gt; m_mimeTypesWithCustomRepresentations;
</span><span class="cx">     WebCore::Color m_backgroundColor;
</span><ins>+
+    HashSet&lt;unsigned&gt; m_activeRenderingSuppressionTokens;
+    unsigned m_maximumRenderingSuppressionToken;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre>
</div>
</div>

</body>
</html>