| Index: Source/web/WebViewImpl.cpp
|
| diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
|
| index dd1a2a03a9dc7e9550e348bfdf5f574da71b05f4..b8ed71c2ffbf1b6a0f134acfbb9a14ffe50fc356 100644
|
| --- a/Source/web/WebViewImpl.cpp
|
| +++ b/Source/web/WebViewImpl.cpp
|
| @@ -3916,28 +3916,43 @@
|
|
|
| void WebViewImpl::willInsertBody(WebLocalFrameImpl* webframe)
|
| {
|
| - resumeTreeViewCommitsIfNeeded(webframe);
|
| + if (webframe != mainFrameImpl())
|
| + return;
|
| +
|
| + if (!m_page->mainFrame()->isLocalFrame())
|
| + return;
|
| +
|
| + // If we get to the <body> tag and we have no pending stylesheet and import load, we
|
| + // can be fairly confident we'll have something sensible to paint soon and
|
| + // can turn off deferred commits.
|
| + if (m_page->deprecatedLocalMainFrame()->document()->isRenderingReady())
|
| + resumeTreeViewCommits();
|
| }
|
|
|
| void WebViewImpl::didFinishDocumentLoad(WebLocalFrameImpl* webframe)
|
| {
|
| - resumeTreeViewCommitsIfNeeded(webframe);
|
| + if (webframe != mainFrameImpl())
|
| + return;
|
| + // If we finished parsing and there's no sheets to load start painting.
|
| + if (webframe->frame()->document()->isRenderingReady())
|
| + resumeTreeViewCommits();
|
| }
|
|
|
| void WebViewImpl::didRemoveAllPendingStylesheet(WebLocalFrameImpl* webframe)
|
| {
|
| - resumeTreeViewCommitsIfNeeded(webframe);
|
| -}
|
| -
|
| -void WebViewImpl::resumeTreeViewCommitsIfNeeded(WebLocalFrameImpl* webframe)
|
| -{
|
| if (webframe != mainFrameImpl())
|
| return;
|
| - if (!webframe->frame()->document()->shouldProcessFrameLifecycle())
|
| - return;
|
| - if (!m_layerTreeView)
|
| - return;
|
| - m_layerTreeView->setDeferCommits(false);
|
| +
|
| + // If we have no more stylesheets to load and we're past the body tag,
|
| + // we should have something to paint and should start as soon as possible.
|
| + if (m_page->deprecatedLocalMainFrame()->document()->body())
|
| + resumeTreeViewCommits();
|
| +}
|
| +
|
| +void WebViewImpl::resumeTreeViewCommits()
|
| +{
|
| + if (m_layerTreeView)
|
| + m_layerTreeView->setDeferCommits(false);
|
| }
|
|
|
| void WebViewImpl::postLayoutResize(WebLocalFrameImpl* webframe)
|
|
|