Title: [246165] trunk
Revision
246165
Author
[email protected]
Date
2019-06-06 12:32:51 -0700 (Thu, 06 Jun 2019)

Log Message

Restrict fast clicks everywhere to desktop content mode
https://bugs.webkit.org/show_bug.cgi?id=198610
<rdar://problem/50114230>

Patch by Antoine Quint <[email protected]> on 2019-06-06
Reviewed by Dean Jackson.

Source/WebKit:

* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::allowsFastClicksEverywhere const):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):

LayoutTests:

Add a new test that enables fast clicks but also sets a mobile content mode.

* fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt: Added.
* fast/events/ios/ipad/fast-click-always-mobile-content-mode.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (246164 => 246165)


--- trunk/LayoutTests/ChangeLog	2019-06-06 19:27:12 UTC (rev 246164)
+++ trunk/LayoutTests/ChangeLog	2019-06-06 19:32:51 UTC (rev 246165)
@@ -1,3 +1,16 @@
+2019-06-06  Antoine Quint  <[email protected]>
+
+        Restrict fast clicks everywhere to desktop content mode
+        https://bugs.webkit.org/show_bug.cgi?id=198610
+        <rdar://problem/50114230>
+
+        Reviewed by Dean Jackson.
+
+        Add a new test that enables fast clicks but also sets a mobile content mode.
+
+        * fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt: Added.
+        * fast/events/ios/ipad/fast-click-always-mobile-content-mode.html: Added.
+
 2019-06-06  Alexey Shvayka  <[email protected]>
 
         JSON.parse throws incorrect exception when called w/o arguments

Added: trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt (0 => 246165)


--- trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt	2019-06-06 19:32:51 UTC (rev 246165)
@@ -0,0 +1,2 @@
+PASS: Double tap caused zoom.
+This document doesn't have fast clicks because it sets a viewport width. It has a significant zoom since the viewport width is significantly bigger than the body width. However, although fast click everywhere is set to false, the content mode is also set to mobile which disables fast click everywhere, so double tapping on the rectangle above should zoom.

Added: trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html (0 => 246165)


--- trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html	                        (rev 0)
+++ trunk/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html	2019-06-06 19:32:51 UTC (rev 246165)
@@ -0,0 +1,59 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true contentMode=mobile internal:FastClicksEverywhere=true ] -->
+
+<html>
+<meta name="viewport" content="width=800">
+<head>
+    <style>
+        body {
+            font-family: system-ui;
+            line-height: 1.4;
+            padding: 10px 10px;
+            width: 500px;
+            margin: 0;
+        }
+    </style>
+    <script src=""
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        async function runTest()
+        {
+            document.getElementById("target").addEventListener("click", handleClick, false);
+
+            if (!window.testRunner)
+                return;
+
+            await UIHelper.humanSpeedZoomByDoubleTappingAt(30, 30);
+            document.getElementById("target").textContent = "PASS: Double tap caused zoom.";
+            testRunner.notifyDone();
+        }
+
+        function handleClick(event)
+        {
+            document.getElementById("target").textContent = "FAIL: Click fired on element with handler.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+<div id="description">This document doesn't have fast clicks because
+    it sets a viewport width. It has a significant zoom since the viewport
+    width is significantly bigger than the body width. However, although fast click
+    everywhere is set to false, the content mode is also set to mobile which disables
+    fast click everywhere, so double tapping on the rectangle above should zoom.</div>
+</body>
+</html>

Modified: trunk/Source/WebKit/ChangeLog (246164 => 246165)


--- trunk/Source/WebKit/ChangeLog	2019-06-06 19:27:12 UTC (rev 246164)
+++ trunk/Source/WebKit/ChangeLog	2019-06-06 19:32:51 UTC (rev 246165)
@@ -1,3 +1,18 @@
+2019-06-06  Antoine Quint  <[email protected]>
+
+        Restrict fast clicks everywhere to desktop content mode
+        https://bugs.webkit.org/show_bug.cgi?id=198610
+        <rdar://problem/50114230>
+
+        Reviewed by Dean Jackson.
+
+        * UIProcess/WebPageProxy.h:
+        (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
+        * UIProcess/ios/WebPageProxyIOS.mm:
+        (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+
 2019-06-06  Sihui Liu  <[email protected]>
 
         NetworkHTTPSUpgradeChecker should construct and destruct database on the background thread

Modified: trunk/Source/WebKit/UIProcess/WebPageProxy.h (246164 => 246165)


--- trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-06-06 19:27:12 UTC (rev 246164)
+++ trunk/Source/WebKit/UIProcess/WebPageProxy.h	2019-06-06 19:32:51 UTC (rev 246165)
@@ -518,6 +518,8 @@
 
     bool hasCommittedAnyProvisionalLoads() const { return m_hasCommittedAnyProvisionalLoads; }
 
+    bool allowsFastClicksEverywhere() const { return m_allowsFastClicksEverywhere; }
+
     void setIsUsingHighPerformanceWebGL(bool value) { m_isUsingHighPerformanceWebGL = value; }
     bool isUsingHighPerformanceWebGL() const { return m_isUsingHighPerformanceWebGL; }
 
@@ -2478,6 +2480,7 @@
     bool m_isUsingHighPerformanceWebGL { false };
     bool m_openedByDOM { false };
     bool m_hasCommittedAnyProvisionalLoads { false };
+    bool m_allowsFastClicksEverywhere { false };
 
     HashMap<String, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByScheme;
     HashMap<uint64_t, Ref<WebURLSchemeHandler>> m_urlSchemeHandlersByIdentifier;

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (246164 => 246165)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-06-06 19:27:12 UTC (rev 246164)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-06-06 19:32:51 UTC (rev 246165)
@@ -1587,7 +1587,7 @@
     if (!_potentialTapInProgress)
         return;
 
-    if (_page->preferences().fastClicksEverywhere()) {
+    if (_page->preferences().fastClicksEverywhere() && _page->allowsFastClicksEverywhere()) {
         RELEASE_LOG(ViewGestures, "Potential tap found an element and fast taps are forced on. Trigger click. (%p)", self);
         [self _setDoubleTapGesturesEnabled:NO];
         return;

Modified: trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (246164 => 246165)


--- trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-06-06 19:27:12 UTC (rev 246164)
+++ trunk/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm	2019-06-06 19:32:51 UTC (rev 246165)
@@ -1376,6 +1376,8 @@
         break;
     }
 
+    m_allowsFastClicksEverywhere = false;
+
     if (!useDesktopBrowsingMode)
         return WebContentMode::Mobile;
 
@@ -1397,6 +1399,7 @@
         policies.setMediaSourcePolicy(WebsiteMediaSourcePolicy::Enable);
         policies.setSimulatedMouseEventsDispatchPolicy(WebsiteSimulatedMouseEventsDispatchPolicy::Allow);
         policies.setLegacyOverflowScrollingTouchPolicy(WebsiteLegacyOverflowScrollingTouchPolicy::Disable);
+        m_allowsFastClicksEverywhere = true;
     }
 
     return WebContentMode::Desktop;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to