WebKit Bugzilla
Attachment 362376 Details for
Bug 194812
: [iOS] "touch-action: none" should not prevent text selection or tapping on a link
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194812-20190219103916.patch (text/plain), 8.40 KB, created by
Antoine Quint
on 2019-02-19 01:39:17 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-02-19 01:39:17 PST
Size:
8.40 KB
patch
obsolete
>Subversion Revision: 241723 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 6d2c5708d150944f495f6c2e67f995feba4dfbfe..9809b7509d679c6cb657ac117c2ce06898162c69 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,17 @@ >+2019-02-19 Antoine Quint <graouts@apple.com> >+ >+ [iOS] "touch-action: none" should not prevent text selection or tapping on a link >+ https://bugs.webkit.org/show_bug.cgi?id=194812 >+ <rdar://problem/47901131> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ We shouldn't prevent all gestures to be disabled when "touch-action: none" is set and instead follow the same code path we would use should >+ "pan-x", "pan-y" or "pinch-zoom" be used. >+ >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _handleTouchActionsForTouchEvent:]): >+ > 2019-02-18 Chris Fleizach <cfleizach@apple.com> > > AX: PSON: Going back from apple.com to search results, cannot interact with HTML content. Disabling Swap Processes on Cross-Site Navigation resolves the issue. >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index e7587403c96aae3d9a5490240326e864f504b688..9c4751a2c6d952b15d04cdc0b8c89e0d3f335efb 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -1223,19 +1223,15 @@ - (void)_handleTouchActionsForTouchEvent:(const WebKit::NativeWebTouchEvent&)tou > auto phase = touchPoint.phase(); > if (phase == WebKit::WebPlatformTouchPoint::TouchPressed) { > auto touchActionData = scrollingCoordinator->touchActionDataAtPoint(touchPoint.location()); >- if (!touchActionData) >+ if (!touchActionData || touchActionData->touchActions.contains(WebCore::TouchAction::Manipulation)) > continue; >- if (touchActionData->touchActions == WebCore::TouchAction::None) >- [_touchEventGestureRecognizer setDefaultPrevented:YES]; >- else if (!touchActionData->touchActions.contains(WebCore::TouchAction::Manipulation)) { >- if (auto scrollingNodeID = touchActionData->scrollingNodeID) >- scrollingCoordinator->setTouchDataForTouchIdentifier(*touchActionData, touchPoint.identifier()); >- else { >- if (!touchActionData->touchActions.contains(WebCore::TouchAction::PinchZoom)) >- _webView.scrollView.pinchGestureRecognizer.enabled = NO; >- _preventsPanningInXAxis = !touchActionData->touchActions.contains(WebCore::TouchAction::PanX); >- _preventsPanningInYAxis = !touchActionData->touchActions.contains(WebCore::TouchAction::PanY); >- } >+ if (auto scrollingNodeID = touchActionData->scrollingNodeID) >+ scrollingCoordinator->setTouchDataForTouchIdentifier(*touchActionData, touchPoint.identifier()); >+ else { >+ if (!touchActionData->touchActions.contains(WebCore::TouchAction::PinchZoom)) >+ _webView.scrollView.pinchGestureRecognizer.enabled = NO; >+ _preventsPanningInXAxis = !touchActionData->touchActions.contains(WebCore::TouchAction::PanX); >+ _preventsPanningInYAxis = !touchActionData->touchActions.contains(WebCore::TouchAction::PanY); > } > } else if (phase == WebKit::WebPlatformTouchPoint::TouchReleased || phase == WebKit::WebPlatformTouchPoint::TouchCancelled) > scrollingCoordinator->clearTouchDataForTouchIdentifier(touchPoint.identifier()); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index b6f883ebd1469d08ec4f363509cb2ef340df0f44..9d40496b1502a4bad52f2f863488d463f8b3979c 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-19 Antoine Quint <graouts@apple.com> >+ >+ [iOS] "touch-action: none" should not prevent text selection or tapping on a link >+ https://bugs.webkit.org/show_bug.cgi?id=194812 >+ <rdar://problem/47901131> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new test which checks that tapping on a link with "touch-action: none" does not prevent navigation. >+ >+ * pointerevents/ios/over-enter-out-leave.html: >+ * pointerevents/ios/touch-action-none-link-traversal-expected.txt: Added. >+ * pointerevents/ios/touch-action-none-link-traversal.html: Added. >+ * pointerevents/utils.js: Since we now have two tests performing a tap, we add a ui.tap() method which is a wrapper for uiController.singleTapAtPoint(). >+ (const.ui.new.UIController.prototype.tap): >+ > 2019-02-18 Antoine Quint <graouts@apple.com> > > [iOS] Dispatch additional events along with pointerdown and pointerup >diff --git a/LayoutTests/pointerevents/ios/over-enter-out-leave.html b/LayoutTests/pointerevents/ios/over-enter-out-leave.html >index a1ca1c275a42fc34b47fdb9bbb98236175b14b2f..3643aae7a527d7dd660afefa62ab113eb746999b 100644 >--- a/LayoutTests/pointerevents/ios/over-enter-out-leave.html >+++ b/LayoutTests/pointerevents/ios/over-enter-out-leave.html >@@ -18,11 +18,7 @@ target_test({ width: "200px", height: "200px" }, (target, test) => { > > const eventTracker = new EventTracker(target, ["pointerover", "pointerenter", "pointerdown", "pointerup", "pointerout", "pointerleave"]); > >- const touch = ui.finger(); >- ui.sequence([ >- touch.begin({ x: 100, y: 100 }), >- touch.end() >- ]).then(() => { >+ ui.tap({ x: 100, y: 100 }).then(() => { > eventTracker.assertMatchesEvents([ > { type: "pointerover", x: 100, y: 100, isPrimary: true }, > { type: "pointerenter", x: 100, y: 100, isPrimary: true }, >diff --git a/LayoutTests/pointerevents/ios/touch-action-none-link-traversal-expected.txt b/LayoutTests/pointerevents/ios/touch-action-none-link-traversal-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..9822e7b71f85ef8f1416d1502f49a4160f7b5311 >--- /dev/null >+++ b/LayoutTests/pointerevents/ios/touch-action-none-link-traversal-expected.txt >@@ -0,0 +1,4 @@ >+ >+ >+PASS Testing that setting touch-action: none allows link traversal. >+ >diff --git a/LayoutTests/pointerevents/ios/touch-action-none-link-traversal.html b/LayoutTests/pointerevents/ios/touch-action-none-link-traversal.html >new file mode 100644 >index 0000000000000000000000000000000000000000..5e4baa7cff0ad275f318135b8e4ad9ee7c4ee760 >--- /dev/null >+++ b/LayoutTests/pointerevents/ios/touch-action-none-link-traversal.html >@@ -0,0 +1,52 @@ >+<!DOCTYPE html> >+<html> >+<head> >+<meta charset=utf-8> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<style> >+ >+iframe { >+ position: absolute; >+ left: 0; >+ top: 0; >+ width: 400px; >+ height: 400px; >+ touch-action: none; >+} >+ >+</style> >+</head> >+<body> >+<iframe></iframe> >+<script src="../../resources/testharness.js"></script> >+<script src="../../resources/testharnessreport.js"></script> >+<script src="../utils.js"></script> >+<script> >+ >+'use strict'; >+ >+async_test(test => { >+ const iframe = document.body.firstElementChild; >+ const link = iframe.contentDocument.body.appendChild(document.createElement("a")); >+ link.href = "../disabled.html"; >+ link.setAttribute("style", ` >+ position: absolute; >+ left: 0; >+ top: 0; >+ width: 100%; >+ height: 100%; >+ `); >+ >+ assert_equals(iframe.contentWindow.location.href, "about:blank", "The iframe initially has no URL."); >+ >+ iframe.addEventListener("load", () => { >+ assert_true(iframe.contentWindow.location.href.includes("disabled.html"), "Upon navigation the URL has a location."); >+ test.done(); >+ }); >+ >+ ui.tap({ x: 100, y: 100 }); >+}, "Testing that setting touch-action: none allows link traversal."); >+ >+</script> >+</body> >+</html> >\ No newline at end of file >diff --git a/LayoutTests/pointerevents/utils.js b/LayoutTests/pointerevents/utils.js >index 52e9a1ec1c61808cf8fcc5f4a99ed7ca232444b3..ba7589017587ba66915826ead063ff67cc9f544b 100644 >--- a/LayoutTests/pointerevents/utils.js >+++ b/LayoutTests/pointerevents/utils.js >@@ -112,6 +112,11 @@ const ui = new (class UIController { > return this._run(`uiController.dragFromPointToPoint(${from.x}, ${from.y}, ${to.x}, ${to.y}, ${durationInSeconds})`); > } > >+ tap(options) >+ { >+ return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`); >+ } >+ > pinchOut(options) > { > options.x = options.x || 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
Flags:
dino
:
review+
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194812
:
362375
| 362376