WebKit Bugzilla
Attachment 347699 Details for
Bug 188746
: [GTK] Touchscreen pinch to zoom should scale the page like other platforms
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-188746-20180821173914.patch (text/plain), 3.70 KB, created by
Justin Michaud
on 2018-08-21 14:39:15 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Justin Michaud
Created:
2018-08-21 14:39:15 PDT
Size:
3.70 KB
patch
obsolete
>Subversion Revision: 234846 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 91b71f7bfc9b73f757f8b74ae88fbfcb4b4f3d2a..38f8af02a3f6096e24a1148a4799d1796c897c18 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,16 @@ >+2018-08-21 Justin Michaud <justin@justinmichaud.com> >+ >+ [GTK] Touchscreen pinch to zoom should scale the page like other platforms >+ https://bugs.webkit.org/show_bug.cgi?id=188746 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * UIProcess/API/gtk/WebKitWebViewBase.cpp: >+ * UIProcess/gtk/GestureController.cpp: >+ (WebKit::GestureController::ZoomGesture::handleZoom): >+ (WebKit::GestureController::ZoomGesture::scaleChanged): >+ * UIProcess/gtk/GestureController.h: >+ > 2018-08-13 Wenson Hsieh <wenson_hsieh@apple.com> > > [WK2] [macOS] Implement a mechanism to test drag and drop >diff --git a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >index 3b4e988a2a7c93fb26b3cd0d80efe818073d1789..0104c431d7f113442a062087ecd9a47663fa5fec 100644 >--- a/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >+++ b/Source/WebKit/UIProcess/API/gtk/WebKitWebViewBase.cpp >@@ -1118,13 +1118,20 @@ private: > { > auto* page = webkitWebViewBaseGetPage(m_webView); > ASSERT(page); >- initialScale = page->pageZoomFactor(); >+ initialScale = page->pageScaleFactor(); > page->getCenterForZoomGesture(center, initialPoint); > } > >- void zoom(double scale) final >+ void zoom(double scale, const IntPoint& initialPoint, const IntPoint& center) final > { >- m_webView->priv->pageClient->zoom(scale); >+ // initialPoint is in page coordinates, center is in view coordinates >+ auto* page = webkitWebViewBaseGetPage(m_webView); >+ ASSERT(page); >+ >+ FloatPoint scaledZoomCenter = FloatPoint(initialPoint); >+ scaledZoomCenter.scale(scale); >+ >+ page->scalePage(scale, WebCore::roundedIntPoint(FloatPoint(scaledZoomCenter - center))); > } > > void longPress(GdkEventTouch* event) final >diff --git a/Source/WebKit/UIProcess/gtk/GestureController.cpp b/Source/WebKit/UIProcess/gtk/GestureController.cpp >index 1dc90df7bcace3ac241f533c7426ebc300e6ecdd..4e61687fe8347255312fa567ed607efe601c61fd 100644 >--- a/Source/WebKit/UIProcess/gtk/GestureController.cpp >+++ b/Source/WebKit/UIProcess/gtk/GestureController.cpp >@@ -203,13 +203,17 @@ void GestureController::ZoomGesture::startZoom() > > void GestureController::ZoomGesture::handleZoom() > { >- m_client.zoom(m_scale); >+ m_client.zoom(m_scale, m_initialPoint, m_viewPoint); > } > > void GestureController::ZoomGesture::scaleChanged(ZoomGesture* zoomGesture, double scale, GtkGesture*) > { > zoomGesture->m_scale = zoomGesture->m_initialScale * scale; >+ if (zoomGesture->m_scale < 1.0) >+ zoomGesture->m_scale = 1.0; >+ > zoomGesture->m_viewPoint = zoomGesture->center(); >+ > if (zoomGesture->m_idle.isActive()) > return; > >diff --git a/Source/WebKit/UIProcess/gtk/GestureController.h b/Source/WebKit/UIProcess/gtk/GestureController.h >index 6250e9a64bde052188d531cf1a7a5092200c32b3..d6368a683538a3931d97d8d8e971ab1183f9ac52 100644 >--- a/Source/WebKit/UIProcess/gtk/GestureController.h >+++ b/Source/WebKit/UIProcess/gtk/GestureController.h >@@ -51,7 +51,7 @@ public: > virtual void swipe(GdkEventTouch*, const WebCore::FloatPoint&) = 0; > > virtual void startZoom(const WebCore::IntPoint& center, double& initialScale, WebCore::IntPoint& initialPoint) = 0; >- virtual void zoom(double) = 0; >+ virtual void zoom(double scale, const WebCore::IntPoint& initialPoint, const WebCore::IntPoint& center) = 0; > > virtual void longPress(GdkEventTouch*) = 0; > };
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 188746
:
347503
|
347520
|
347640
|
347699
|
347737
|
347756
|
347807
|
347921
|
347924
|
348004