Title: [219314] trunk/Source/WebKit2
Revision
219314
Author
cdu...@apple.com
Date
2017-07-10 16:28:27 -0700 (Mon, 10 Jul 2017)

Log Message

[iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
https://bugs.webkit.org/show_bug.cgi?id=174326
<rdar://problem/33150490>

Reviewed by Simon Fraser.

Only call [scrollView setZoomScale] if the new zoom scale is actually different to
avoid doing unnecessary work in UIKit.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (219313 => 219314)


--- trunk/Source/WebKit2/ChangeLog	2017-07-10 23:25:19 UTC (rev 219313)
+++ trunk/Source/WebKit2/ChangeLog	2017-07-10 23:28:27 UTC (rev 219314)
@@ -1,5 +1,19 @@
 2017-07-10  Chris Dumez  <cdu...@apple.com>
 
+        [iOS] _didCommitLayerTree should avoid calling [scrollView setZoomScale] unnecessarily
+        https://bugs.webkit.org/show_bug.cgi?id=174326
+        <rdar://problem/33150490>
+
+        Reviewed by Simon Fraser.
+
+        Only call [scrollView setZoomScale] if the new zoom scale is actually different to
+        avoid doing unnecessary work in UIKit.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didCommitLayerTree:]):
+
+2017-07-10  Chris Dumez  <cdu...@apple.com>
+
         Merge ResourceLoadStatisticsStore into WebResourceLoadStatisticsStore
         https://bugs.webkit.org/show_bug.cgi?id=174203
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (219313 => 219314)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-10 23:25:19 UTC (rev 219313)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-07-10 23:28:27 UTC (rev 219314)
@@ -1509,7 +1509,7 @@
     [_scrollView setMinimumZoomScale:layerTreeTransaction.minimumScaleFactor()];
     [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
     [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
-    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom])
+    if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor())
         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
 
     _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth();
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to