ASSERTION FAILED: !m_renderView.document().inPageCache() in compositing/iframes/resou...
authorakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 17:54:31 +0000 (17:54 +0000)
committerakling@apple.com <akling@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Aug 2014 17:54:31 +0000 (17:54 +0000)
<https://webkit.org/b/136329>

Cancel any pending compositing layer updates when moving a document
into the page cache.

Reviewed by Zalan Bujtas.

* dom/Document.cpp:
(WebCore::Document::documentWillSuspendForPageCache):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::cancelCompositingLayerUpdate):
* rendering/RenderLayerCompositor.h:

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

Source/WebCore/ChangeLog
Source/WebCore/dom/Document.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h

index b2392f3..1edfb57 100644 (file)
@@ -1,3 +1,19 @@
+2014-08-28  Andreas Kling  <akling@apple.com>
+
+        ASSERTION FAILED: !m_renderView.document().inPageCache() in compositing/iframes/resources/page-cache-helper.html
+        <https://webkit.org/b/136329>
+
+        Cancel any pending compositing layer updates when moving a document
+        into the page cache.
+
+        Reviewed by Zalan Bujtas.
+
+        * dom/Document.cpp:
+        (WebCore::Document::documentWillSuspendForPageCache):
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::cancelCompositingLayerUpdate):
+        * rendering/RenderLayerCompositor.h:
+
 2014-08-28  Mihnea Ovidenie  <mihnea@adobe.com>
 
         [CSSRegions] Incorrect selection clearing on a document without regions
index 3a17e8f..314043d 100644 (file)
@@ -4139,6 +4139,11 @@ void Document::documentWillSuspendForPageCache()
     // is dispatched, after the document is restored from the page cache.
     m_didDispatchViewportPropertiesChanged = false;
 #endif
+
+    if (RenderView* view = renderView()) {
+        if (view->usesCompositing())
+            view->compositor().cancelCompositingLayerUpdate();
+    }
 }
 
 void Document::documentDidResumeFromPageCache() 
index 9353b9a..37efd82 100644 (file)
@@ -646,6 +646,11 @@ bool RenderLayerCompositor::hasAnyAdditionalCompositedLayers(const RenderLayer&
     return m_compositedLayerCount > (rootLayer.isComposited() ? 1 : 0);
 }
 
+void RenderLayerCompositor::cancelCompositingLayerUpdate()
+{
+    m_updateCompositingLayersTimer.stop();
+}
+
 void RenderLayerCompositor::updateCompositingLayers(CompositingUpdateType updateType, RenderLayer* updateRoot)
 {
     m_updateCompositingLayersTimer.stop();
index a867579..7bd240a 100644 (file)
@@ -140,6 +140,8 @@ public:
     // This is only used when state changes and we do not exepect a style update or layout to happen soon (e.g. when
     // we discover that an iframe is overlapped during painting).
     void scheduleCompositingLayerUpdate();
+    // This is used to cancel any pending update timers when the document goes into page cache.
+    void cancelCompositingLayerUpdate();
 
     // Update the compositing state of the given layer. Returns true if that state changed.
     enum CompositingChangeRepaint { CompositingChangeRepaintNow, CompositingChangeWillRepaintLater };