From c244b7010e35c0f6442809589fc1023fc6d2fad5 Mon Sep 17 00:00:00 2001 From: "timothy_horton@apple.com" Date: Fri, 29 Aug 2014 00:01:39 +0000 Subject: [PATCH] _setDidMoveSwipeSnapshotCallback's block should only be called if the snapshot is going to move https://bugs.webkit.org/show_bug.cgi?id=136354 Reviewed by Simon Fraser. * UIProcess/API/Cocoa/WKViewPrivate.h: Update the comment to note the new behavior. * UIProcess/mac/ViewGestureControllerMac.mm: (WebKit::ViewGestureController::beginSwipeGesture): Don't call the block until the snapshot is actually moving (if the snapshot never moves because it's behind the live view, don't call the block at all). git-svn-id: https://svn.webkit.org/repository/webkit/trunk@173093 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- Source/WebKit2/ChangeLog | 16 ++++++++++++++++ .../WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h | 2 +- .../UIProcess/mac/ViewGestureControllerMac.mm | 2 -- 3 files changed, 17 insertions(+), 3 deletions(-) diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index eab77c85bcd9..b3124192958e 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,19 @@ +2014-08-28 Tim Horton + + _setDidMoveSwipeSnapshotCallback's block should only be called if the snapshot is going to move + https://bugs.webkit.org/show_bug.cgi?id=136354 + + + Reviewed by Simon Fraser. + + * UIProcess/API/Cocoa/WKViewPrivate.h: + Update the comment to note the new behavior. + + * UIProcess/mac/ViewGestureControllerMac.mm: + (WebKit::ViewGestureController::beginSwipeGesture): + Don't call the block until the snapshot is actually moving (if the snapshot + never moves because it's behind the live view, don't call the block at all). + 2014-08-28 Tim Horton Occasional thread-safety-related crashes on the ServicesController queue diff --git a/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h b/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h index 3b52a1f51f10..ea2d95b1508e 100644 --- a/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h +++ b/Source/WebKit2/UIProcess/API/Cocoa/WKViewPrivate.h @@ -113,7 +113,7 @@ // The top content inset is applied in the window's coordinate space, to the union of the custom swipe view's frames. - (void)_setCustomSwipeViewsTopContentInset:(float)topContentInset; - (BOOL)_tryToSwipeWithEvent:(NSEvent *)event ignoringPinnedState:(BOOL)ignoringPinnedState; -// The rect returned is always that of the snapshot, not necessarily the swiping layer. This only works for layer-backed windows. +// The rect returned is always that of the snapshot, and only if it is the view being manipulated by the swipe. This only works for layer-backed windows. - (void)_setDidMoveSwipeSnapshotCallback:(void(^)(CGRect swipeSnapshotRectInWindowCoordinates))callback; #endif diff --git a/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm b/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm index 9b71b9bcdf48..5d64d96c04a2 100644 --- a/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm +++ b/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm @@ -608,8 +608,6 @@ void ViewGestureController::beginSwipeGesture(WebBackForwardListItem* targetItem [snapshotLayerParent insertSublayer:m_swipeLayer.get() below:layerAdjacentToSnapshot]; else [snapshotLayerParent insertSublayer:m_swipeLayer.get() above:layerAdjacentToSnapshot]; - - didMoveSwipeSnapshotLayer(); } void ViewGestureController::handleSwipeGesture(WebBackForwardListItem* targetItem, double progress, SwipeDirection direction) -- 2.36.0