Title: [171154] trunk/Source/WebKit2
Revision
171154
Author
[email protected]
Date
2014-07-16 15:26:56 -0700 (Wed, 16 Jul 2014)

Log Message

[iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
https://bugs.webkit.org/show_bug.cgi?id=134965
Related to <rdar://problem/17082607>

Patch by Benjamin Poulain <[email protected]> on 2014-07-16
Reviewed by Tim Horton.

Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
to the page at the new size during the transition.

Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
can be applied to the wrong set of tiles.
This is mostly a problem for unresponsive WebProcess or when the synchronization is done
immediately.

There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
completely fails to get the new page, the UIProcess is in a somewhat messy state.
I will look into that separately than the layer tree synchronization.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
(-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
* UIProcess/API/Cocoa/WKWebViewInternal.h:
* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::dynamicViewportSizeUpdate):
(WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
(WebKit::WebPageProxy::didCommitLayerTree):
(WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::WebPage):
(WebKit::WebPage::didCommitLoad):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::synchronizeDynamicViewportUpdate):
(WebKit::WebPage::updateVisibleContentRects):
* WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
(WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
(WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (171153 => 171154)


--- trunk/Source/WebKit2/ChangeLog	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/ChangeLog	2014-07-16 22:26:56 UTC (rev 171154)
@@ -1,3 +1,53 @@
+2014-07-16  Benjamin Poulain  <[email protected]>
+
+        [iOS][WK2] Synchronize the dynamic viewport updates with their layer tree commit
+        https://bugs.webkit.org/show_bug.cgi?id=134965
+        Related to <rdar://problem/17082607>
+
+        Reviewed by Tim Horton.
+
+        Dynamic viewport update relies on the _resizeAnimationTransformAdjustments being applied
+        to the page at the new size during the transition.
+
+        Because of the races between the LayerTree Commit and DynamicViewportSizeUpdate, the transform
+        can be applied to the wrong set of tiles.
+        This is mostly a problem for unresponsive WebProcess or when the synchronization is done
+        immediately.
+
+        There is at least one more case that is not handled: if synchronizeDynamicViewportUpdate()
+        completely fails to get the new page, the UIProcess is in a somewhat messy state.
+        I will look into that separately than the layer tree synchronization.
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didCommitLayerTree:]):
+        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:nextValidLayerTreeTransactionID:]):
+        (-[WKWebView _dynamicViewportUpdateChangedTargetToScale:position:]): Deleted.
+        * UIProcess/API/Cocoa/WKWebViewInternal.h:
+        * UIProcess/PageClient.h:
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::resetState):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/ios/PageClientImplIOS.h:
+        * UIProcess/ios/PageClientImplIOS.mm:
+        (WebKit::PageClientImpl::dynamicViewportUpdateChangedTarget):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::dynamicViewportSizeUpdate):
+        (WebKit::WebPageProxy::synchronizeDynamicViewportUpdate):
+        (WebKit::WebPageProxy::didCommitLayerTree):
+        (WebKit::WebPageProxy::dynamicViewportUpdateChangedTarget):
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::WebPage):
+        (WebKit::WebPage::didCommitLoad):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/ios/WebPageIOS.mm:
+        (WebKit::WebPage::synchronizeDynamicViewportUpdate):
+        (WebKit::WebPage::updateVisibleContentRects):
+        * WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h:
+        (WebKit::RemoteLayerTreeDrawingArea::nextTransactionID):
+        (WebKit::RemoteLayerTreeDrawingArea::currentTransactionID): Deleted.
+
 2014-07-16  Dan Bernstein  <[email protected]>
 
         REGRESSION (r170653): Web Content service’s Info.plist has wrong format

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


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2014-07-16 22:26:56 UTC (rev 171154)
@@ -170,6 +170,7 @@
     uint64_t _firstPaintAfterCommitLoadTransactionID;
     BOOL _isAnimatingResize;
     CATransform3D _resizeAnimationTransformAdjustments;
+    uint64_t _resizeAnimationTransformTransactionID;
     RetainPtr<UIView> _resizeAnimationView;
     CGFloat _lastAdjustmentForScroller;
 
@@ -804,7 +805,8 @@
         return;
 
     if (_isAnimatingResize) {
-        [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments;
+        if (layerTreeTransaction.transactionID() >= _resizeAnimationTransformTransactionID)
+            [_resizeAnimationView layer].sublayerTransform = _resizeAnimationTransformAdjustments;
         return;
     }
 
@@ -865,7 +867,7 @@
     }
 }
 
-- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition
+- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID
 {
     if (_isAnimatingResize) {
         CGFloat animatingScaleTarget = [[_resizeAnimationView layer] transform].m11;
@@ -878,6 +880,7 @@
 
         _resizeAnimationTransformAdjustments.m41 = (currentContentOffset.x - newContentOffset.x) / animatingScaleTarget;
         _resizeAnimationTransformAdjustments.m42 = (currentContentOffset.y - newContentOffset.y) / animatingScaleTarget;
+        _resizeAnimationTransformTransactionID = nextValidLayerTreeTransactionID;
     }
 }
 

Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -74,7 +74,7 @@
 - (void)_didCommitLoadForMainFrame;
 - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTreeTransaction;
 
-- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition;
+- (void)_dynamicViewportUpdateChangedTargetToScale:(double)newScale position:(CGPoint)newScrollPosition nextValidLayerTreeTransactionID:(uint64_t)nextValidLayerTreeTransactionID;
 - (void)_restorePageStateToExposedRect:(WebCore::FloatRect)exposedRect scale:(double)scale;
 - (void)_restorePageStateToUnobscuredCenter:(WebCore::FloatPoint)center scale:(double)scale;
 

Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/PageClient.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -253,7 +253,7 @@
     virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius) = 0;
 
     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) = 0;
-    virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition) = 0;
+    virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) = 0;
     virtual void restorePageState(const WebCore::FloatRect&, double) = 0;
     virtual void restorePageCenterAndScale(const WebCore::FloatPoint&, double) = 0;
 

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2014-07-16 22:26:56 UTC (rev 171154)
@@ -274,7 +274,9 @@
     , m_userAgent(standardUserAgent())
 #if PLATFORM(IOS)
     , m_deviceOrientation(0)
-    , m_dynamicViewportSizeUpdateInProgress(false)
+    , m_dynamicViewportSizeUpdateWaitingForTarget(false)
+    , m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit(false)
+    , m_dynamicViewportSizeUpdateLayerTreeTransactionID(0)
 #endif
     , m_geolocationPermissionRequestManager(*this)
     , m_notificationPermissionRequestManager(*this)
@@ -4344,7 +4346,9 @@
     }
 
     m_lastVisibleContentRectUpdate = VisibleContentRectUpdateInfo();
-    m_dynamicViewportSizeUpdateInProgress = false;
+    m_dynamicViewportSizeUpdateWaitingForTarget = false;
+    m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;
+    m_dynamicViewportSizeUpdateLayerTreeTransactionID = 0;
 #endif
 
     CallbackBase::Error error;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -1322,7 +1322,9 @@
     RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
     int32_t m_deviceOrientation;
-    bool m_dynamicViewportSizeUpdateInProgress;
+    bool m_dynamicViewportSizeUpdateWaitingForTarget;
+    bool m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit;
+    uint64_t m_dynamicViewportSizeUpdateLayerTreeTransactionID;
 #endif
 
 #if ENABLE(VIBRATION)

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -113,7 +113,7 @@
     virtual void didGetTapHighlightGeometries(uint64_t requestID, const WebCore::Color&, const Vector<WebCore::FloatQuad>& highlightedQuads, const WebCore::IntSize& topLeftRadius, const WebCore::IntSize& topRightRadius, const WebCore::IntSize& bottomLeftRadius, const WebCore::IntSize& bottomRightRadius) override;
 
     virtual void didCommitLayerTree(const RemoteLayerTreeTransaction&) override;
-    virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition) override;
+    virtual void dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t transactionID) override;
     virtual void restorePageState(const WebCore::FloatRect&, double) override;
     virtual void restorePageCenterAndScale(const WebCore::FloatPoint&, double) override;
 

Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2014-07-16 22:26:56 UTC (rev 171154)
@@ -496,9 +496,9 @@
     [m_contentView _didCommitLayerTree:layerTreeTransaction];
 }
 
-void PageClientImpl::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition)
+void PageClientImpl::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition, uint64_t nextValidLayerTreeTransactionID)
 {
-    [m_webView _dynamicViewportUpdateChangedTargetToScale:newScale position:newScrollPosition];
+    [m_webView _dynamicViewportUpdateChangedTargetToScale:newScale position:newScrollPosition nextValidLayerTreeTransactionID:nextValidLayerTreeTransactionID];
 }
 
 void PageClientImpl::restorePageState(const WebCore::FloatRect& exposedRect, double scale)

Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (171153 => 171154)


--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2014-07-16 22:26:56 UTC (rev 171154)
@@ -250,13 +250,14 @@
 
 void WebPageProxy::dynamicViewportSizeUpdate(const FloatSize& minimumLayoutSize, const WebCore::FloatSize& minimumLayoutSizeForMinimalUI, const WebCore::FloatSize& maximumUnobscuredSize, const FloatRect& targetExposedContentRect, const FloatRect& targetUnobscuredRect, const FloatRect& targetUnobscuredRectInScrollViewCoordinates,  double targetScale, int32_t deviceOrientation)
 {
-    m_dynamicViewportSizeUpdateInProgress = true;
+    m_dynamicViewportSizeUpdateWaitingForTarget = true;
+    m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = true;
     m_process->send(Messages::WebPage::DynamicViewportSizeUpdate(minimumLayoutSize, minimumLayoutSizeForMinimalUI, maximumUnobscuredSize, targetExposedContentRect, targetUnobscuredRect, targetUnobscuredRectInScrollViewCoordinates, targetScale, deviceOrientation), m_pageID);
 }
 
 void WebPageProxy::synchronizeDynamicViewportUpdate()
 {
-    if (m_dynamicViewportSizeUpdateInProgress) {
+    if (m_dynamicViewportSizeUpdateWaitingForTarget) {
         // We do not want the UIProcess to finish animated resize with the old content size, scale, etc.
         // If that happens, the UIProcess would start pushing new VisibleContentRectUpdateInfo to the WebProcess with
         // invalid informations.
@@ -268,15 +269,24 @@
         //
         // The following is a workaround to have the UIProcess in a consistent state.
         // Instead of handling nested resize, we block the UIProcess until the animated resize finishes.
-        m_dynamicViewportSizeUpdateInProgress = false;
         double newScale;
         FloatPoint newScrollPosition;
-        if (m_process->sendSync(Messages::WebPage::SynchronizeDynamicViewportUpdate(), Messages::WebPage::SynchronizeDynamicViewportUpdate::Reply(newScale, newScrollPosition), m_pageID, std::chrono::seconds(2))) {
-            m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition);
+        uint64_t nextValidLayerTreeTransactionID;
+        if (m_process->sendSync(Messages::WebPage::SynchronizeDynamicViewportUpdate(), Messages::WebPage::SynchronizeDynamicViewportUpdate::Reply(newScale, newScrollPosition, nextValidLayerTreeTransactionID), m_pageID, std::chrono::seconds(2))) {
+            m_dynamicViewportSizeUpdateWaitingForTarget = false;
+            m_dynamicViewportSizeUpdateLayerTreeTransactionID = nextValidLayerTreeTransactionID;
+            m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition, nextValidLayerTreeTransactionID);
+        }
 
-            m_process->connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_pageID, std::chrono::seconds(1));
-        }
     }
+
+    // If m_dynamicViewportSizeUpdateWaitingForTarget is false, we are waiting for the next valid frame with the hope it is the one for the new target.
+    // If m_dynamicViewportSizeUpdateWaitingForTarget is still true, this is a desesperate attempt to get the valid frame before finishing the animation.
+    if (m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit)
+        m_process->connection()->waitForAndDispatchImmediately<Messages::RemoteLayerTreeDrawingAreaProxy::CommitLayerTree>(m_pageID, std::chrono::seconds(1), IPC::InterruptWaitingIfSyncMessageArrives);
+
+    m_dynamicViewportSizeUpdateWaitingForTarget = false;
+    m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;
 }
 
 void WebPageProxy::setViewportConfigurationMinimumLayoutSize(const WebCore::FloatSize& size)
@@ -307,6 +317,11 @@
 {
     m_pageExtendedBackgroundColor = layerTreeTransaction.pageExtendedBackgroundColor();
 
+    if (!m_dynamicViewportSizeUpdateWaitingForTarget && m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit) {
+        if (layerTreeTransaction.transactionID() >= m_dynamicViewportSizeUpdateLayerTreeTransactionID)
+            m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;
+    }
+
     m_pageClient.didCommitLayerTree(layerTreeTransaction);
 }
 
@@ -616,9 +631,10 @@
 
 void WebPageProxy::dynamicViewportUpdateChangedTarget(double newScale, const WebCore::FloatPoint& newScrollPosition)
 {
-    if (m_dynamicViewportSizeUpdateInProgress) {
-        m_dynamicViewportSizeUpdateInProgress = false;
-        m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition);
+    if (m_dynamicViewportSizeUpdateWaitingForTarget) {
+        m_dynamicViewportSizeUpdateLayerTreeTransactionID = toRemoteLayerTreeDrawingAreaProxy(drawingArea())->nextLayerTreeTransactionID();
+        m_dynamicViewportSizeUpdateWaitingForTarget = false;
+        m_pageClient.dynamicViewportUpdateChangedTarget(newScale, newScrollPosition, m_dynamicViewportSizeUpdateLayerTreeTransactionID);
     }
 }
 

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (171153 => 171154)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2014-07-16 22:26:56 UTC (rev 171154)
@@ -296,7 +296,7 @@
     , m_isShowingContextMenu(false)
 #endif
 #if PLATFORM(IOS)
-    , m_lastLayerTreeTransactionIDBeforeDidCommitLoad(0)
+    , m_firstLayerTreeTransactionIDAfterDidCommitLoad(0)
     , m_hasReceivedVisibleContentRectsAfterDidCommitLoad(false)
     , m_scaleWasSetByUIProcess(false)
     , m_userHasChangedPageScaleFactor(false)
@@ -4447,7 +4447,7 @@
 #if PLATFORM(IOS)
     m_hasReceivedVisibleContentRectsAfterDidCommitLoad = false;
     m_scaleWasSetByUIProcess = false;
-    m_lastLayerTreeTransactionIDBeforeDidCommitLoad = toRemoteLayerTreeDrawingArea(*m_drawingArea).currentTransactionID();
+    m_firstLayerTreeTransactionIDAfterDidCommitLoad = toRemoteLayerTreeDrawingArea(*m_drawingArea).nextTransactionID();
     m_userHasChangedPageScaleFactor = false;
 
     WebProcess::shared().eventDispatcher().clearQueuedTouchEventsForPage(*this);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (171153 => 171154)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -747,7 +747,7 @@
     void setMaximumUnobscuredSize(const WebCore::FloatSize&);
     void setDeviceOrientation(int32_t);
     void dynamicViewportSizeUpdate(const WebCore::FloatSize& minimumLayoutSize, const WebCore::FloatSize& minimumLayoutSizeForMinimalUI, const WebCore::FloatSize& maximumUnobscuredSize, const WebCore::FloatRect& targetExposedContentRect, const WebCore::FloatRect& targetUnobscuredRect, const WebCore::FloatRect& targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation);
-    void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition);
+    void synchronizeDynamicViewportUpdate(double& newTargetScale, WebCore::FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID);
     void updateVisibleContentRects(const VisibleContentRectUpdateInfo&);
     bool scaleWasSetByUIProcess() const { return m_scaleWasSetByUIProcess; }
     void willStartUserTriggeredZooming();
@@ -1225,7 +1225,7 @@
     WebCore::FloatPoint m_potentialTapLocation;
 
     WebCore::ViewportConfiguration m_viewportConfiguration;
-    uint64_t m_lastLayerTreeTransactionIDBeforeDidCommitLoad;
+    uint64_t m_firstLayerTreeTransactionIDAfterDidCommitLoad;
     bool m_hasReceivedVisibleContentRectsAfterDidCommitLoad;
     bool m_scaleWasSetByUIProcess;
     bool m_userHasChangedPageScaleFactor;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (171153 => 171154)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in	2014-07-16 22:26:56 UTC (rev 171154)
@@ -48,7 +48,7 @@
     SetMaximumUnobscuredSize(WebCore::FloatSize size)
     SetDeviceOrientation(int32_t deviceOrientation)
     DynamicViewportSizeUpdate(WebCore::FloatSize minimumLayoutSize, WebCore::FloatSize minimumLayoutSizeForMinimalUI,  WebCore::FloatSize maximumUnobscuredSize, WebCore::FloatRect targetExposedContentRect, WebCore::FloatRect targetUnobscuredRect, WebCore::FloatRect targetUnobscuredRectInScrollViewCoordinates, double scale, int32_t deviceOrientation)
-    SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition)
+    SynchronizeDynamicViewportUpdate() -> (double newTargetScale, WebCore::FloatPoint newScrollPosition, uint64_t nextValidLayerTreeTransactionID)
 
     HandleTap(WebCore::IntPoint point)
     PotentialTapAtPosition(uint64_t requestID, WebCore::FloatPoint point)

Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (171153 => 171154)


--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2014-07-16 22:26:56 UTC (rev 171154)
@@ -37,6 +37,7 @@
 #import "InjectedBundleUserMessageCoders.h"
 #import "InteractionInformationAtPosition.h"
 #import "PluginView.h"
+#import "RemoteLayerTreeDrawingArea.h"
 #import "VisibleContentRectUpdateInfo.h"
 #import "WKAccessibilityWebPageObjectIOS.h"
 #import "WebChromeClient.h"
@@ -2324,10 +2325,11 @@
     send(Messages::WebPageProxy::DynamicViewportUpdateChangedTarget(pageScaleFactor(), frameView.scrollPosition()));
 }
 
-void WebPage::synchronizeDynamicViewportUpdate(double& newTargetScale, FloatPoint& newScrollPosition)
+void WebPage::synchronizeDynamicViewportUpdate(double& newTargetScale, FloatPoint& newScrollPosition, uint64_t& nextValidLayerTreeTransactionID)
 {
     newTargetScale = pageScaleFactor();
     newScrollPosition = m_page->mainFrame().view()->scrollPosition();
+    nextValidLayerTreeTransactionID = toRemoteLayerTreeDrawingArea(*m_drawingArea).nextTransactionID();
 }
 
 void WebPage::resetViewportDefaultConfiguration(WebFrame* frame)
@@ -2437,7 +2439,7 @@
 void WebPage::updateVisibleContentRects(const VisibleContentRectUpdateInfo& visibleContentRectUpdateInfo)
 {
     // Skip any VisibleContentRectUpdate that have been queued before DidCommitLoad suppresses the updates in the UIProcess.
-    if (visibleContentRectUpdateInfo.lastLayerTreeTransactionID() <= m_lastLayerTreeTransactionIDBeforeDidCommitLoad)
+    if (visibleContentRectUpdateInfo.lastLayerTreeTransactionID() <= m_firstLayerTreeTransactionIDAfterDidCommitLoad)
         return;
 
     m_hasReceivedVisibleContentRectsAfterDidCommitLoad = true;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h (171153 => 171154)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h	2014-07-16 21:33:05 UTC (rev 171153)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/RemoteLayerTreeDrawingArea.h	2014-07-16 22:26:56 UTC (rev 171154)
@@ -54,7 +54,7 @@
     RemoteLayerTreeDrawingArea(WebPage&, const WebPageCreationParameters&);
     virtual ~RemoteLayerTreeDrawingArea();
 
-    uint64_t currentTransactionID() const { return m_currentTransactionID; }
+    uint64_t nextTransactionID() const { return m_currentTransactionID + 1; }
 
 private:
     // DrawingArea
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to