Always commit the scrolling tree when we flush layers
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 21:00:53 +0000 (21:00 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 20 Jun 2014 21:00:53 +0000 (21:00 +0000)
https://bugs.webkit.org/show_bug.cgi?id=134115

Reviewed by Beth Dakin.

The scrolling state tree contains bare pointers to GraphicsLayers, which get
converted to CALayers at commit time. To avoid a window of time where those
GraphicsLayer pointers go stale, commit the scrolling tree whenever we flush the
compositing layer tree.

* WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
(WebKit::TiledCoreAnimationDrawingArea::flushLayers):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm

index 823d35bc3718807d0c6ea67542a95af48489e141..113d7521cedf5e385480ff35e755005c03885b6b 100644 (file)
@@ -1,3 +1,18 @@
+2014-06-20  Simon Fraser  <simon.fraser@apple.com>
+
+        Always commit the scrolling tree when we flush layers
+        https://bugs.webkit.org/show_bug.cgi?id=134115
+
+        Reviewed by Beth Dakin.
+        
+        The scrolling state tree contains bare pointers to GraphicsLayers, which get
+        converted to CALayers at commit time. To avoid a window of time where those
+        GraphicsLayer pointers go stale, commit the scrolling tree whenever we flush the
+        compositing layer tree.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+
 2014-06-19  Simon Fraser  <simon.fraser@apple.com>
 
         [iOS WebKit2] Make -webkit-overflow-scrolling:touch work in iframes (breaks MSWord previews)
index 55a608d56ec22ed0ef889900497753fe185fe88a..99b130faa5943fcec83430b4db64f8eea8d83336 100644 (file)
@@ -280,6 +280,7 @@ bool TiledCoreAnimationDrawingArea::flushLayers()
     m_webPage->pageOverlayController().flushPageOverlayLayers(visibleRect);
 
     bool returnValue = m_webPage->corePage()->mainFrame().view()->flushCompositingStateIncludingSubframes();
+    m_webPage->corePage()->scrollingCoordinator()->commitTreeStateIfNeeded();
 
     // If we have an active transient zoom, we want the zoom to win over any changes
     // that WebCore makes to the relevant layers, so re-apply our changes after flushing.