WebKit Bugzilla
Attachment 372625 Details for
Bug 198124
: [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198124-20190621122945.patch (text/plain), 7.61 KB, created by
Antoine Quint
on 2019-06-21 03:29:46 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Antoine Quint
Created:
2019-06-21 03:29:46 PDT
Size:
7.61 KB
patch
obsolete
>Subversion Revision: 246674 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 8077ccda3a7e26be381ca0214450fded9e15963f..29c3a269408fe9c6097784cc64322e739e5c37b5 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,20 @@ >+2019-06-21 Antoine Quint <graouts@apple.com> >+ >+ [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown >+ https://bugs.webkit.org/show_bug.cgi?id=198124 >+ <rdar://problem/50410863> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Ensure we wait until completion of a tap before removing the pointer ID and the preventDefault() state along with it. >+ >+ * UIProcess/ios/WKContentViewInteraction.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _singleTapDidReset:]): >+ (-[WKContentView _commitPotentialTapFailed]): >+ (-[WKContentView _didCompleteSyntheticClick]): >+ (-[WKContentView _singleTapRecognized:]): >+ > 2019-06-20 Patrick Griffis <pgriffis@igalia.com> and Carlos Garcia Campos <cgarcia@igalia.com> > > [GTK][WPE] Implement a basic DNS cache >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index e96dedb66a619cde9cfe94758ac43e6356064f43..ea2709e0684ab8350dbde667c960dbce198fcff6 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -59,6 +59,10 @@ > #import <wtf/WeakObjCPtr.h> > #import <wtf/text/WTFString.h> > >+#if ENABLE(POINTER_EVENTS) >+#import <WebCore/PointerID.h> >+#endif >+ > namespace API { > class OpenPanelParameters; > } >@@ -320,6 +324,10 @@ struct WKAutoCorrectionData { > BOOL _isExpectingFastSingleTapCommit; > BOOL _showDebugTapHighlightsForFastClicking; > >+#if ENABLE(POINTER_EVENTS) >+ WebCore::PointerID m_commitPotentialTapPointerId; >+#endif >+ > BOOL _keyboardDidRequestDismissal; > > #if USE(UIKIT_KEYBOARD_ADDITIONS) >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index c05f1c82aa8827085ca18395e211f7b5e4580a90..c0dc6b2885350a0a3da260b412f6e9bb8c6edfc1 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -2341,8 +2341,11 @@ - (void)_singleTapDidReset:(UITapGestureRecognizer *)gestureRecognizer > ASSERT(gestureRecognizer == _singleTapGestureRecognizer); > cancelPotentialTapIfNecessary(self); > #if ENABLE(POINTER_EVENTS) >- if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) >- _page->touchWithIdentifierWasRemoved([singleTapTouchIdentifier unsignedIntValue]); >+ if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) { >+ WebCore::PointerID pointerId = [singleTapTouchIdentifier unsignedIntValue]; >+ if (m_commitPotentialTapPointerId != pointerId) >+ _page->touchWithIdentifierWasRemoved(pointerId); >+ } > #endif > } > >@@ -2354,6 +2357,11 @@ - (void)_doubleTapDidFail:(UITapGestureRecognizer *)gestureRecognizer > > - (void)_commitPotentialTapFailed > { >+#if ENABLE(POINTER_EVENTS) >+ _page->touchWithIdentifierWasRemoved(m_commitPotentialTapPointerId); >+ m_commitPotentialTapPointerId = 0; >+#endif >+ > [self _cancelInteraction]; > > [self _resetInputViewDeferral]; >@@ -2381,6 +2389,11 @@ - (void)_didNotHandleTapAsClick:(const WebCore::IntPoint&)point > > - (void)_didCompleteSyntheticClick > { >+#if ENABLE(POINTER_EVENTS) >+ _page->touchWithIdentifierWasRemoved(m_commitPotentialTapPointerId); >+ m_commitPotentialTapPointerId = 0; >+#endif >+ > RELEASE_LOG(ViewGestures, "Synthetic click completed. (%p)", self); > [self _resetInputViewDeferral]; > } >@@ -2409,8 +2422,10 @@ - (void)_singleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer > > WebCore::PointerID pointerId = WebCore::mousePointerID; > #if ENABLE(POINTER_EVENTS) >- if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) >+ if (auto* singleTapTouchIdentifier = [_singleTapGestureRecognizer lastActiveTouchIdentifier]) { > pointerId = [singleTapTouchIdentifier unsignedIntValue]; >+ m_commitPotentialTapPointerId = pointerId; >+ } > #endif > _page->commitPotentialTap(WebKit::webEventModifierFlags(gestureRecognizerModifierFlags(gestureRecognizer)), _layerTreeTransactionIdAtLastTouchStart, pointerId); > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 63301534f2135af087d4b3822422ae3a987980d9..4c5225a0e264dc6b1964e1bf03e0e8eb30861790 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,16 @@ >+2019-06-21 Antoine Quint <graouts@apple.com> >+ >+ [iOS] Compatibility mouse events aren't prevented by calling preventDefault() on pointerdown >+ https://bugs.webkit.org/show_bug.cgi?id=198124 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Add a new test that checks that calling preventDefault() within a "pointerdown" event handler correctly prevents >+ the dispatch of compatibility mouse events even with a slow tap. >+ >+ * pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown-expected.txt: Added. >+ * pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html: Added. >+ > 2019-06-20 Antoine Quint <graouts@apple.com> > > [Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover >diff --git a/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown-expected.txt b/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..55e0752c0ae4b05f595167f9986214f5df17a337 >--- /dev/null >+++ b/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown-expected.txt >@@ -0,0 +1,3 @@ >+ >+PASS Testing that calling preventDefault() during a "pointerdown" event prevents compatibility events from being dispatched. >+ >diff --git a/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html b/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html >new file mode 100644 >index 0000000000000000000000000000000000000000..e8f647126f2046c18a14fc477b81a31e9e24cb4d >--- /dev/null >+++ b/LayoutTests/pointerevents/ios/pointer-events-no-mousedown-when-prevent-default-called-on-pointerdown.html >@@ -0,0 +1,24 @@ >+<!DOCTYPE html><!-- webkit-test-runner [ useFlexibleViewport=true ] --> >+<html> >+<head> >+<meta charset=utf-8> >+</head> >+<body> >+<script src="../../resources/testharness.js"></script> >+<script src="../../resources/testharnessreport.js"></script> >+<script src="../utils.js"></script> >+<script> >+ >+'use strict'; >+ >+target_test({ width: "100px", height: "100px" }, (target, test) => { >+ target.addEventListener("pointerdown", event => event.preventDefault()); >+ target.addEventListener("mousedown", event => assert_unreached("The mousedown event should not be dispatched after calling preventDefault() during pointerdown.")); >+ target.addEventListener("mousedown", event => assert_unreached("The mouseup event should not be dispatched after calling preventDefault() during pointerdown.")); >+ target.addEventListener("click", event => test.done()); >+ ui.tap({ x: 50, y: 50 }); >+}, `Testing that calling preventDefault() during a "pointerdown" event prevents compatibility events from being dispatched.`); >+ >+</script> >+</body> >+</html> >\ No newline at end of file
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 198124
:
370415
|
370417
| 372625