Title: [173602] branches/safari-600.1-branch/Source

Diff

Modified: branches/safari-600.1-branch/Source/WTF/ChangeLog (173601 => 173602)


--- branches/safari-600.1-branch/Source/WTF/ChangeLog	2014-09-13 16:26:04 UTC (rev 173601)
+++ branches/safari-600.1-branch/Source/WTF/ChangeLog	2014-09-13 16:46:02 UTC (rev 173602)
@@ -1,3 +1,19 @@
+2014-09-13  Babak Shafiei  <bshaf...@apple.com>
+
+        Merge r173595
+
+    2014-09-12  Tim Horton  <timothy_hor...@apple.com>
+
+            Swiping back from a Twitter image to Twitter flashes to the wrong position
+            https://bugs.webkit.org/show_bug.cgi?id=136798
+            <rdar://problem/18324338>
+
+            Reviewed by Darin Adler and Sam Weinig.
+
+            * wtf/RunLoop.h:
+            (WTF::RunLoop::TimerBase::startRepeating):
+            Add a std::chrono veresion of RunLoop::TimerBase::startRepeating.
+
 2014-08-28  Roger Fong  <roger_f...@apple.com>
 
         Unreviewed build fix. Specify which version of cygwin python to use.

Modified: branches/safari-600.1-branch/Source/WTF/wtf/RunLoop.h (173601 => 173602)


--- branches/safari-600.1-branch/Source/WTF/wtf/RunLoop.h	2014-09-13 16:26:04 UTC (rev 173601)
+++ branches/safari-600.1-branch/Source/WTF/wtf/RunLoop.h	2014-09-13 16:46:02 UTC (rev 173602)
@@ -76,6 +76,7 @@
         WTF_EXPORT_PRIVATE virtual ~TimerBase();
 
         void startRepeating(double repeatInterval) { start(repeatInterval, true); }
+        void startRepeating(std::chrono::milliseconds repeatInterval) { startRepeating(repeatInterval.count() * 0.001); }
         void startOneShot(double interval) { start(interval, false); }
 
         WTF_EXPORT_PRIVATE void stop();

Modified: branches/safari-600.1-branch/Source/WebKit2/ChangeLog (173601 => 173602)


--- branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-09-13 16:26:04 UTC (rev 173601)
+++ branches/safari-600.1-branch/Source/WebKit2/ChangeLog	2014-09-13 16:46:02 UTC (rev 173602)
@@ -1,3 +1,36 @@
+2014-09-13  Babak Shafiei  <bshaf...@apple.com>
+
+        Merge r173595
+
+    2014-09-12  Tim Horton  <timothy_hor...@apple.com>
+
+            Swiping back from a Twitter image to Twitter flashes to the wrong position
+            https://bugs.webkit.org/show_bug.cgi?id=136798
+            <rdar://problem/18324338>
+
+            Reviewed by Darin Adler and Sam Weinig.
+
+            * UIProcess/mac/ViewGestureController.h:
+            * UIProcess/mac/ViewGestureControllerMac.mm:
+            (WebKit::ViewGestureController::ViewGestureController):
+            (WebKit::ViewGestureController::didFinishLoadForMainFrame):
+            (WebKit::ViewGestureController::didSameDocumentNavigationForMainFrame):
+            Add a 250ms repeating timer that we start in didFinishLoadForMainFrame
+            if we are for some reason still loading, and in didSameDocumentNavigationForMainFrame
+            unconditionally, to match behavior of the old swipe implementation.
+
+            Also, do the active gesture check in both of those places so that we don't
+            start the timer if we're in the middle of a live swipe or have already torn
+            down the snapshot (removeSwipeSnapshotAfterRepaint does this as well, so
+            this isn't really a behavior change).
+
+            (WebKit::ViewGestureController::activeLoadMonitoringTimerFired):
+            Every time the timer fires, check if we're still loading; if not,
+            tear down the swipe snapshot (after repainting).
+
+            (WebKit::ViewGestureController::removeSwipeSnapshotAfterRepaint):
+            Stop the active load monitoring timer.
+
 2014-09-12  Lucas Forschler  <lforsch...@apple.com>
 
         Merge r173573

Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureController.h (173601 => 173602)


--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureController.h	2014-09-13 16:26:04 UTC (rev 173601)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureController.h	2014-09-13 16:46:02 UTC (rev 173602)
@@ -134,6 +134,7 @@
     void didCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool isReplacedElement, double viewportMinimumScale, double viewportMaximumScale);
     void didHitRenderTreeSizeThreshold();
     void removeSwipeSnapshotAfterRepaint();
+    void activeLoadMonitoringTimerFired();
 
     void endMagnificationGesture();
     WebCore::FloatPoint scaledMagnificationOrigin(WebCore::FloatPoint origin, double scale);
@@ -163,6 +164,7 @@
 
 #if PLATFORM(MAC)
     RunLoop::Timer<ViewGestureController> m_swipeWatchdogAfterFirstVisuallyNonEmptyLayoutTimer;
+    RunLoop::Timer<ViewGestureController> m_swipeActiveLoadMonitoringTimer;
 
     double m_magnification;
     WebCore::FloatPoint m_magnificationOrigin;

Modified: branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm (173601 => 173602)


--- branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm	2014-09-13 16:26:04 UTC (rev 173601)
+++ branches/safari-600.1-branch/Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm	2014-09-13 16:46:02 UTC (rev 173602)
@@ -28,6 +28,7 @@
 
 #if PLATFORM(MAC)
 
+#import "FrameLoadState.h"
 #import "NativeWebWheelEvent.h"
 #import "WebPageGroup.h"
 #import "ViewGestureControllerMessages.h"
@@ -79,6 +80,7 @@
 static const float swipeSnapshotRemovalRenderTreeSizeTargetFraction = 0.5;
 static const std::chrono::seconds swipeSnapshotRemovalWatchdogDuration = 5_s;
 static const std::chrono::seconds swipeSnapshotRemovalWatchdogAfterFirstVisuallyNonEmptyLayoutDuration = 3_s;
+static const std::chrono::milliseconds swipeSnapshotRemovalActiveLoadMonitoringInterval = 250_ms;
 
 @interface WKSwipeCancellationTracker : NSObject {
 @private
@@ -100,6 +102,7 @@
     , m_activeGestureType(ViewGestureType::None)
     , m_swipeWatchdogTimer(RunLoop::main(), this, &ViewGestureController::swipeSnapshotWatchdogTimerFired)
     , m_swipeWatchdogAfterFirstVisuallyNonEmptyLayoutTimer(RunLoop::main(), this, &ViewGestureController::swipeSnapshotWatchdogTimerFired)
+    , m_swipeActiveLoadMonitoringTimer(RunLoop::main(), this, &ViewGestureController::activeLoadMonitoringTimerFired)
     , m_lastMagnificationGestureWasSmartMagnification(false)
     , m_visibleContentRectIsValid(false)
     , m_frameHandlesMagnificationGesture(false)
@@ -715,14 +718,33 @@
 
 void ViewGestureController::didFinishLoadForMainFrame()
 {
+    if (m_activeGestureType != ViewGestureType::Swipe || m_swipeInProgress)
+        return;
+
+    if (m_webPageProxy.pageLoadState().isLoading()) {
+        m_swipeActiveLoadMonitoringTimer.startRepeating(swipeSnapshotRemovalActiveLoadMonitoringInterval);
+        return;
+    }
+
     removeSwipeSnapshotAfterRepaint();
 }
 
 void ViewGestureController::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType type)
 {
+    if (m_activeGestureType != ViewGestureType::Swipe || m_swipeInProgress)
+        return;
+
     if (type != SameDocumentNavigationSessionStateReplace && type != SameDocumentNavigationSessionStatePop)
         return;
 
+    m_swipeActiveLoadMonitoringTimer.startRepeating(swipeSnapshotRemovalActiveLoadMonitoringInterval);
+}
+
+void ViewGestureController::activeLoadMonitoringTimerFired()
+{
+    if (m_webPageProxy.pageLoadState().isLoading())
+        return;
+
     removeSwipeSnapshotAfterRepaint();
 }
 
@@ -733,6 +755,8 @@
 
 void ViewGestureController::removeSwipeSnapshotAfterRepaint()
 {
+    m_swipeActiveLoadMonitoringTimer.stop();
+
     if (m_activeGestureType != ViewGestureType::Swipe || m_swipeInProgress)
         return;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to