Clients should have a way to extend rendering suppression
https://bugs.webkit.org/show_bug.cgi?id=116463
<rdar://problem/13738496>

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.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@150388 268f45cc-cd09-0410-ab3c-d52691b4dbfc