Title: [160675] trunk/Source/WebKit2
Revision
160675
Author
[email protected]
Date
2013-12-16 16:35:23 -0800 (Mon, 16 Dec 2013)

Log Message

WKView.magnification should include magnification due to the active gesture
https://bugs.webkit.org/show_bug.cgi?id=125813

Reviewed by Simon Fraser.

Make WKView.magnification respect active pinch-zoom gestures.

* UIProcess/API/mac/WKView.mm:
(-[WKView magnification]):
If we have a ViewGestureController, defer to it for the current magnification.

* UIProcess/mac/ViewGestureController.cpp:
(WebKit::ViewGestureController::magnification):
Return either the current pinch-zoom magnification, if we're in the middle of a gesture,
or the pageScaleFactor, if we're not.

* UIProcess/mac/ViewGestureController.h:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (160674 => 160675)


--- trunk/Source/WebKit2/ChangeLog	2013-12-17 00:29:40 UTC (rev 160674)
+++ trunk/Source/WebKit2/ChangeLog	2013-12-17 00:35:23 UTC (rev 160675)
@@ -1,3 +1,23 @@
+2013-12-16  Tim Horton  <[email protected]>
+
+        WKView.magnification should include magnification due to the active gesture
+        https://bugs.webkit.org/show_bug.cgi?id=125813
+
+        Reviewed by Simon Fraser.
+
+        Make WKView.magnification respect active pinch-zoom gestures.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView magnification]):
+        If we have a ViewGestureController, defer to it for the current magnification.
+
+        * UIProcess/mac/ViewGestureController.cpp:
+        (WebKit::ViewGestureController::magnification):
+        Return either the current pinch-zoom magnification, if we're in the middle of a gesture,
+        or the pageScaleFactor, if we're not.
+
+        * UIProcess/mac/ViewGestureController.h:
+
 2013-12-16  Benjamin Poulain  <[email protected]>
 
         [WK2] Remove the constraint that highlight rects must be smaller than the scrollview bounds

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (160674 => 160675)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-12-17 00:29:40 UTC (rev 160674)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2013-12-17 00:35:23 UTC (rev 160675)
@@ -3307,6 +3307,9 @@
 
 - (double)magnification
 {
+    if (_data->_gestureController)
+        return _data->_gestureController->magnification();
+
     return _data->_page->pageScaleFactor();
 }
 

Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp (160674 => 160675)


--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp	2013-12-17 00:29:40 UTC (rev 160674)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.cpp	2013-12-17 00:35:23 UTC (rev 160675)
@@ -144,4 +144,12 @@
     m_activeGestureType = ViewGestureType::None;
 }
 
+double ViewGestureController::magnification() const
+{
+    if (m_activeGestureType == ViewGestureType::Magnification)
+        return m_magnification;
+
+    return m_webPageProxy.pageScaleFactor();
+}
+
 } // namespace WebKit

Modified: trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h (160674 => 160675)


--- trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h	2013-12-17 00:29:40 UTC (rev 160674)
+++ trunk/Source/WebKit2/UIProcess/mac/ViewGestureController.h	2013-12-17 00:35:23 UTC (rev 160675)
@@ -40,6 +40,7 @@
     ~ViewGestureController();
 
     void handleMagnificationGesture(double scale, WebCore::FloatPoint origin);
+    double magnification() const;
 
     void endActiveGesture();
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to