- Revision
- 246251
- Author
- [email protected]
- Date
- 2019-06-09 23:25:30 -0700 (Sun, 09 Jun 2019)
Log Message
Cherry-pick r246213. rdar://problem/50114230
Restrict fast clicks everywhere to desktop content mode
https://bugs.webkit.org/show_bug.cgi?id=198610
<rdar://problem/50114230>
Reviewed by Dean Jackson.
Source/WebKit:
We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
This patch had been reverted once because it yielded some regressions in existing tests, notably under
fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
rathern than the recognition of two single taps.
* UIProcess/WebPageProxy.h:
(WebKit::WebPageProxy::allowsFastClicksEverywhere const):
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
(_didStartProvisionalLoadForMainFrame):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
LayoutTests:
Add a new test that enables fast clicks but also sets a mobile content mode.
We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.
Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
a promise with a one-second delay since the issue of double-taps being recognized instead of
two consecutive single taps across two tests has been resolved.
* 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.
* platform/ios-simulator-wk2/TestExpectations:
* pointerevents/utils.js:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Added Paths
Diff
Modified: branches/safari-608.1.27-branch/LayoutTests/ChangeLog (246250 => 246251)
--- branches/safari-608.1.27-branch/LayoutTests/ChangeLog 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/LayoutTests/ChangeLog 2019-06-10 06:25:30 UTC (rev 246251)
@@ -1,5 +1,74 @@
2019-06-09 Babak Shafiei <[email protected]>
+ Cherry-pick r246213. rdar://problem/50114230
+
+ Restrict fast clicks everywhere to desktop content mode
+ https://bugs.webkit.org/show_bug.cgi?id=198610
+ <rdar://problem/50114230>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebKit:
+
+ We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
+ when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
+
+ This patch had been reverted once because it yielded some regressions in existing tests, notably under
+ fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
+ used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
+ to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
+ rathern than the recognition of two single taps.
+
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
+ (_didStartProvisionalLoadForMainFrame):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+
+ LayoutTests:
+
+ Add a new test that enables fast clicks but also sets a mobile content mode.
+
+ We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
+ since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.
+
+ Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
+ a promise with a one-second delay since the issue of double-taps being recognized instead of
+ two consecutive single taps across two tests has been resolved.
+
+ * 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.
+ * platform/ios-simulator-wk2/TestExpectations:
+ * pointerevents/utils.js:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-06-07 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.
+
+ We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
+ since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.
+
+ Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
+ a promise with a one-second delay since the issue of double-taps being recognized instead of
+ two consecutive single taps across two tests has been resolved.
+
+ * 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.
+ * platform/ios-simulator-wk2/TestExpectations:
+ * pointerevents/utils.js:
+
+2019-06-09 Babak Shafiei <[email protected]>
+
Cherry-pick r246118. rdar://problem/50114230
Upstream content mode support into open source from WebKitAdditions
Added: branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt (0 => 246251)
--- branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode-expected.txt 2019-06-10 06:25:30 UTC (rev 246251)
@@ -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: branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html (0 => 246251)
--- branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/events/ios/ipad/fast-click-always-mobile-content-mode.html 2019-06-10 06:25:30 UTC (rev 246251)
@@ -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: branches/safari-608.1.27-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations (246250 => 246251)
--- branches/safari-608.1.27-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/LayoutTests/platform/ios-simulator-wk2/TestExpectations 2019-06-10 06:25:30 UTC (rev 246251)
@@ -52,8 +52,6 @@
webkit.org/b/196233 fast/viewport/ios/initial-scale-after-changing-view-scale.html [ Pass Timeout ]
-webkit.org/b/196236 [ Debug ] fast/visual-viewport/ios/min-scale-greater-than-one.html [ Pass Failure ]
-
webkit.org/b/196269 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-fragment-from-prevalent-resource.html [ Pass Timeout ]
webkit.org/b/196269 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-and-fragment-from-prevalent-resource.html [ Pass Timeout ]
webkit.org/b/196269 http/tests/resourceLoadStatistics/capped-lifetime-for-cookie-set-in-js-with-link-query-from-prevalent-resource.html [ Pass Timeout ]
@@ -63,8 +61,6 @@
webkit.org/b/191709 editing/deleting/delete-emoji-9.html [ Pass Failure ]
webkit.org/b/191709 editing/deleting/delete-emoji.html [ Pass Failure ]
-webkit.org/b/196300 fast/visual-viewport/ios/min-scale-greater-than-one.html [ Pass Failure ]
-
webkit.org/b/196298 fast/viewport/ios/use-minimum-device-width-for-page-without-viewport-meta.html [ Pass Failure ]
webkit.org/b/162975 http/tests/cache/disk-cache/memory-cache-revalidation-updates-disk-cache.html [ Pass Failure ]
Modified: branches/safari-608.1.27-branch/LayoutTests/pointerevents/utils.js (246250 => 246251)
--- branches/safari-608.1.27-branch/LayoutTests/pointerevents/utils.js 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/LayoutTests/pointerevents/utils.js 2019-06-10 06:25:30 UTC (rev 246251)
@@ -118,11 +118,7 @@
tap(options)
{
- // Add a delay to ensure sequence of tap() calls don't yield double taps.
- const delay = 1000;
- return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`).then(() => {
- return new Promise(resolve => setTimeout(resolve, delay));
- });
+ return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`);
}
pinchOut(options)
Modified: branches/safari-608.1.27-branch/Source/WebKit/ChangeLog (246250 => 246251)
--- branches/safari-608.1.27-branch/Source/WebKit/ChangeLog 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/Source/WebKit/ChangeLog 2019-06-10 06:25:30 UTC (rev 246251)
@@ -1,5 +1,77 @@
2019-06-09 Babak Shafiei <[email protected]>
+ Cherry-pick r246213. rdar://problem/50114230
+
+ Restrict fast clicks everywhere to desktop content mode
+ https://bugs.webkit.org/show_bug.cgi?id=198610
+ <rdar://problem/50114230>
+
+ Reviewed by Dean Jackson.
+
+ Source/WebKit:
+
+ We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
+ when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
+
+ This patch had been reverted once because it yielded some regressions in existing tests, notably under
+ fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
+ used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
+ to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
+ rathern than the recognition of two single taps.
+
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
+ (_didStartProvisionalLoadForMainFrame):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+
+ LayoutTests:
+
+ Add a new test that enables fast clicks but also sets a mobile content mode.
+
+ We also mark fast/visual-viewport/ios/min-scale-greater-than-one.html as non-flaky
+ since the flakiness was due to the fast clicks everywhere behavior being enabled on iPhone.
+
+ Finally, we can now remove the hack where ui.tap() in the Pointer Events utility returned
+ a promise with a one-second delay since the issue of double-taps being recognized instead of
+ two consecutive single taps across two tests has been resolved.
+
+ * 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.
+ * platform/ios-simulator-wk2/TestExpectations:
+ * pointerevents/utils.js:
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246213 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-06-07 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.
+
+ We now set a new allowsFastClicksEverywhere property on the WebPageProxy when the content mode changes, set to true
+ when we're in desktop browsing mode. We now check on this property to opt into the fast clicks everywhere behavior.
+
+ This patch had been reverted once because it yielded some regressions in existing tests, notably under
+ fast/events/touch/ios/content-observation. This updated patch addresses this by ensuring the gesture recognizers
+ used for double-tap-to-zoom are disabled in -[WKContentViewInteraction _didStartProvisionalLoadForMainFrame]
+ to ensure that two tests dispatching a tap at the same location don't yield the recognition of a double-tap
+ rathern than the recognition of two single taps.
+
+ * UIProcess/WebPageProxy.h:
+ (WebKit::WebPageProxy::allowsFastClicksEverywhere const):
+ * UIProcess/ios/WKContentViewInteraction.mm:
+ (-[WKContentView _handleSmartMagnificationInformationForPotentialTap:renderRect:fitEntireRect:viewportMinimumScale:viewportMaximumScale:]):
+ (_didStartProvisionalLoadForMainFrame):
+ * UIProcess/ios/WebPageProxyIOS.mm:
+ (WebKit::WebPageProxy::effectiveContentModeAfterAdjustingPolicies):
+
+2019-06-09 Babak Shafiei <[email protected]>
+
Cherry-pick r246118. rdar://problem/50114230
Upstream content mode support into open source from WebKitAdditions
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/WebPageProxy.h (246250 => 246251)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/WebPageProxy.h 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/WebPageProxy.h 2019-06-10 06:25:30 UTC (rev 246251)
@@ -517,6 +517,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: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (246250 => 246251)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm 2019-06-10 06:25:30 UTC (rev 246251)
@@ -1586,7 +1586,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;
@@ -3792,6 +3792,10 @@
// Reset the double tap gesture recognizer to prevent any double click that is in the process of being recognized.
[_doubleTapGestureRecognizerForDoubleClick setEnabled:NO];
[_doubleTapGestureRecognizerForDoubleClick setEnabled:YES];
+ // We also need to disable the double-tap gesture recognizers that are enabled for double-tap-to-zoom and which
+ // are enabled when a single tap is first recognized. This avoids tests running in sequence and simulating taps
+ // in the same location to trigger double-tap recognition.
+ [self _setDoubleTapGesturesEnabled:NO];
}
#if !USE(UIKIT_KEYBOARD_ADDITIONS)
Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm (246250 => 246251)
--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2019-06-10 06:25:23 UTC (rev 246250)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm 2019-06-10 06:25:30 UTC (rev 246251)
@@ -1399,6 +1399,8 @@
break;
}
+ m_allowsFastClicksEverywhere = false;
+
if (!useDesktopBrowsingMode)
return WebContentMode::Mobile;
@@ -1420,6 +1422,7 @@
policies.setMediaSourcePolicy(WebsiteMediaSourcePolicy::Enable);
policies.setSimulatedMouseEventsDispatchPolicy(WebsiteSimulatedMouseEventsDispatchPolicy::Allow);
policies.setLegacyOverflowScrollingTouchPolicy(WebsiteLegacyOverflowScrollingTouchPolicy::Disable);
+ m_allowsFastClicksEverywhere = true;
}
return WebContentMode::Desktop;