| Index: third_party/WebKit/Source/core/dom/Document.cpp
|
| diff --git a/third_party/WebKit/Source/core/dom/Document.cpp b/third_party/WebKit/Source/core/dom/Document.cpp
|
| index ea7f805bbf5f360876100e88fef50b44a8d69660..dbda6a31b173151b89a294bd4ea5809212ea5668 100644
|
| --- a/third_party/WebKit/Source/core/dom/Document.cpp
|
| +++ b/third_party/WebKit/Source/core/dom/Document.cpp
|
| @@ -1736,15 +1736,20 @@ void Document::updateLayoutTree(StyleRecalcChange change)
|
| if (view()->shouldThrottleRendering())
|
| return;
|
|
|
| - if (change != Force && !needsLayoutTreeUpdate()) {
|
| - if (lifecycle().state() < DocumentLifecycle::StyleClean) {
|
| - // needsLayoutTreeUpdate may change to false without any actual layout tree update.
|
| - // For example, needsAnimationTimingUpdate may change to false when time elapses.
|
| - // Advance lifecycle to StyleClean because style is actually clean now.
|
| - lifecycle().advanceTo(DocumentLifecycle::InStyleRecalc);
|
| - lifecycle().advanceTo(DocumentLifecycle::StyleClean);
|
| + if (change != Force) {
|
| + if (isInitialEmptyDocument())
|
| + return;
|
| +
|
| + if (!needsLayoutTreeUpdate()) {
|
| + if (lifecycle().state() < DocumentLifecycle::StyleClean) {
|
| + // needsLayoutTreeUpdate may change to false without any actual layout tree update.
|
| + // For example, needsAnimationTimingUpdate may change to false when time elapses.
|
| + // Advance lifecycle to StyleClean because style is actually clean now.
|
| + lifecycle().advanceTo(DocumentLifecycle::InStyleRecalc);
|
| + lifecycle().advanceTo(DocumentLifecycle::StyleClean);
|
| + }
|
| + return;
|
| }
|
| - return;
|
| }
|
|
|
| if (inStyleRecalc())
|
| @@ -2800,7 +2805,7 @@ void Document::dispatchUnloadEvents()
|
| return;
|
|
|
| // Don't remove event listeners from a transitional empty document (see https://bugs.webkit.org/show_bug.cgi?id=28716 for more information).
|
| - bool keepEventListeners = m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument() && m_frame->loader().provisionalDocumentLoader()
|
| + bool keepEventListeners = isInitialEmptyDocument() && m_frame->loader().provisionalDocumentLoader()
|
| && isSecureTransitionTo(m_frame->loader().provisionalDocumentLoader()->url());
|
| if (!keepEventListeners)
|
| removeAllEventListenersRecursively();
|
| @@ -5467,6 +5472,11 @@ bool Document::hasActiveParser()
|
| return m_activeParserCount || (m_parser && m_parser->processingData());
|
| }
|
|
|
| +bool Document::isInitialEmptyDocument() const
|
| +{
|
| + return m_frame && m_frame->loader().stateMachine()->isDisplayingInitialEmptyDocument();
|
| +}
|
| +
|
| void Document::setContextFeatures(ContextFeatures& features)
|
| {
|
| m_contextFeatures = PassRefPtrWillBeRawPtr<ContextFeatures>(features);
|
|
|