Title: [243381] trunk/Source/WebKit
Revision
243381
Author
[email protected]
Date
2019-03-22 09:38:57 -0700 (Fri, 22 Mar 2019)

Log Message

REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
https://bugs.webkit.org/show_bug.cgi?id=196126
rdar://problem/49095791

Reviewed by Antti Koivisto.

The scrolling tree doesn't have an accurate picture of the main view's scroll position
during pinch-zooming, so don't have it apply layer positions if a transient zoom is
in progress.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (243380 => 243381)


--- trunk/Source/WebKit/ChangeLog	2019-03-22 16:28:55 UTC (rev 243380)
+++ trunk/Source/WebKit/ChangeLog	2019-03-22 16:38:57 UTC (rev 243381)
@@ -1,3 +1,20 @@
+2019-03-22  Simon Fraser  <[email protected]>
+
+        REGRESSION (r242687): Flicker when pinch-zooming pages in macOS Safari
+        https://bugs.webkit.org/show_bug.cgi?id=196126
+        rdar://problem/49095791
+
+        Reviewed by Antti Koivisto.
+
+        The scrolling tree doesn't have an accurate picture of the main view's scroll position
+        during pinch-zooming, so don't have it apply layer positions if a transient zoom is
+        in progress.
+
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h:
+        * WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm:
+        (WebKit::TiledCoreAnimationDrawingArea::flushLayers):
+        (WebKit::TiledCoreAnimationDrawingArea::applyTransientZoomToPage):
+
 2019-03-22  Antti Koivisto  <[email protected]>
 
         Handle UI side hit testing for ScrollPositioningBehavior::Stationary positioned nodes

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h (243380 => 243381)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-03-22 16:28:55 UTC (rev 243380)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.h	2019-03-22 16:38:57 UTC (rev 243381)
@@ -88,7 +88,8 @@
 
     bool dispatchDidReachLayoutMilestone(OptionSet<WebCore::LayoutMilestone>) override;
 
-    void flushLayers();
+    enum class FlushType { Normal, TransientZoom };
+    void flushLayers(FlushType = FlushType::Normal);
 
     // Message handlers.
     void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort) override;

Modified: trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm (243380 => 243381)


--- trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-03-22 16:28:55 UTC (rev 243380)
+++ trunk/Source/WebKit/WebProcess/WebPage/mac/TiledCoreAnimationDrawingArea.mm	2019-03-22 16:38:57 UTC (rev 243381)
@@ -451,7 +451,7 @@
     scheduleCompositingLayerFlush();
 }
 
-void TiledCoreAnimationDrawingArea::flushLayers()
+void TiledCoreAnimationDrawingArea::flushLayers(FlushType flushType)
 {
     if (layerTreeStateIsFrozen())
         return;
@@ -493,7 +493,8 @@
 #if ENABLE(ASYNC_SCROLLING)
         if (auto* scrollingCoordinator = m_webPage.corePage()->scrollingCoordinator()) {
             scrollingCoordinator->commitTreeStateIfNeeded();
-            scrollingCoordinator->applyScrollingTreeLayerPositions();
+            if (flushType == FlushType::TransientZoom)
+                scrollingCoordinator->applyScrollingTreeLayerPositions();
         }
 #endif
 
@@ -923,7 +924,7 @@
     unscrolledOrigin.moveBy(-unobscuredContentRect.location());
     m_webPage.scalePage(scale / m_webPage.viewScaleFactor(), roundedIntPoint(-unscrolledOrigin));
     m_transientZoomScale = 1;
-    flushLayers();
+    flushLayers(FlushType::TransientZoom);
 }
 
 void TiledCoreAnimationDrawingArea::addFence(const MachSendRight& fencePort)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to