WebKit Bugzilla
Attachment 371871 Details for
Bug 198764
: LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-198764-20190611131631.patch (text/plain), 31.35 KB, created by
zalan
on 2019-06-11 13:16:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
zalan
Created:
2019-06-11 13:16:32 PDT
Size:
31.35 KB
patch
obsolete
>Subversion Revision: 246233 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 02848ee4d6d17d2c4a0f117ef61e5d9917291052..a94858d499f32eea3e78ceebdb679c03d6a4c5c6 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,49 @@ >+2019-06-11 Zalan Bujtas <zalan@apple.com> >+ >+ LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing >+ https://bugs.webkit.org/show_bug.cgi?id=198764 >+ <rdar://problem/51035459> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ This patch replaces the existing, _doubleTapGestureRecognizerForDoubleClick based double click handling with a WebProcess based implementation using >+ the potentialTapAtPosition/commitPotentialTap infrastructure. >+ >+ * Shared/WebPageCreationParameters.cpp: >+ (WebKit::WebPageCreationParameters::encode const): >+ (WebKit::WebPageCreationParameters::decode): >+ * Shared/WebPageCreationParameters.h: >+ * UIProcess/PageClient.h: >+ * UIProcess/WebPageProxy.cpp: >+ (WebKit::WebPageProxy::creationParameters): >+ * UIProcess/WebPageProxy.h: >+ * UIProcess/ios/PageClientImplIOS.h: >+ * UIProcess/ios/PageClientImplIOS.mm: >+ (WebKit::PageClientImpl::doubleClickForDoubleTapDelay): >+ (WebKit::PageClientImpl::doubleClickForDoubleTapRadius): >+ * UIProcess/ios/WKContentViewInteraction.h: >+ * UIProcess/ios/WKContentViewInteraction.mm: >+ (-[WKContentView _ensureNonBlockingDoubleTapGestureRecognizer]): >+ (-[WKContentView setupInteraction]): >+ (-[WKContentView cleanupInteraction]): >+ (-[WKContentView _removeDefaultGestureRecognizers]): >+ (-[WKContentView _addDefaultGestureRecognizers]): >+ (-[WKContentView gestureRecognizer:shouldRecognizeSimultaneouslyWithGestureRecognizer:]): >+ (-[WKContentView gestureRecognizerShouldBegin:]): >+ (-[WKContentView _didStartProvisionalLoadForMainFrame]): >+ (-[WKContentView _doubleClickForDoubleTapDelay]): >+ (-[WKContentView _doubleClickForDoubleTapRadius]): >+ (-[WKContentView _doubleTapRecognizedForDoubleClick:]): Deleted. >+ * UIProcess/ios/WebPageProxyIOS.mm: >+ (WebKit::WebPageProxy::handleDoubleTapForDoubleClickAtPoint): Deleted. >+ * WebProcess/WebPage/WebPage.cpp: >+ * WebProcess/WebPage/WebPage.h: >+ * WebProcess/WebPage/WebPage.messages.in: >+ * WebProcess/WebPage/ios/WebPageIOS.mm: >+ (WebKit::WebPage::handlePotentialDoubleTapForDoubleClickAtPoint): >+ (WebKit::WebPage::commitPotentialTap): >+ (WebKit::WebPage::handleDoubleTapForDoubleClickAtPoint): Deleted. >+ > 2019-06-07 Antti Koivisto <antti@apple.com> > > REGRESSION (r245006): Setting scrollview.scrollEnabled clobbers any scrollEnabled set by a client >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.cpp b/Source/WebKit/Shared/WebPageCreationParameters.cpp >index 57a5e106307880949b54dcbc68631f015d9faab6..d14bc33b816b9187750fa7dfde506f5e597477c1 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.cpp >+++ b/Source/WebKit/Shared/WebPageCreationParameters.cpp >@@ -98,6 +98,8 @@ void WebPageCreationParameters::encode(IPC::Encoder& encoder) const > encoder << deviceOrientation; > encoder << keyboardIsAttached; > encoder << canShowWhileLocked; >+ encoder << doubleClickForDoubleTapDelay; >+ encoder << doubleClickForDoubleTapRadius; > encoder << overrideViewportArguments; > #endif > #if PLATFORM(COCOA) >@@ -290,6 +292,10 @@ Optional<WebPageCreationParameters> WebPageCreationParameters::decode(IPC::Decod > return WTF::nullopt; > if (!decoder.decode(parameters.canShowWhileLocked)) > return WTF::nullopt; >+ if (!decoder.decode(parameters.doubleClickForDoubleTapDelay)) >+ return WTF::nullopt; >+ if (!decoder.decode(parameters.doubleClickForDoubleTapRadius)) >+ return WTF::nullopt; > > Optional<Optional<WebCore::ViewportArguments>> overrideViewportArguments; > decoder >> overrideViewportArguments; >diff --git a/Source/WebKit/Shared/WebPageCreationParameters.h b/Source/WebKit/Shared/WebPageCreationParameters.h >index 1c0c1772356b9cb0f703668d2bdec09527b145bd..40d7ccc7da5461d43800c645e86981ed95780c3a 100644 >--- a/Source/WebKit/Shared/WebPageCreationParameters.h >+++ b/Source/WebKit/Shared/WebPageCreationParameters.h >@@ -158,6 +158,8 @@ struct WebPageCreationParameters { > int32_t deviceOrientation { 0 }; > bool keyboardIsAttached { false }; > bool canShowWhileLocked { false }; >+ double doubleClickForDoubleTapDelay { 350 }; >+ float doubleClickForDoubleTapRadius { 10 }; > Optional<WebCore::ViewportArguments> overrideViewportArguments; > #endif > #if PLATFORM(COCOA) >diff --git a/Source/WebKit/UIProcess/PageClient.h b/Source/WebKit/UIProcess/PageClient.h >index 4d1a8e406bc07db098f2a835a2ba3cbad6abfe3d..0547b59269a15651d23161923b4a88181df18fc0 100644 >--- a/Source/WebKit/UIProcess/PageClient.h >+++ b/Source/WebKit/UIProcess/PageClient.h >@@ -413,6 +413,9 @@ public: > virtual void disableInspectorNodeSearch() = 0; > > virtual void handleAutocorrectionContext(const WebAutocorrectionContext&) = 0; >+ >+ virtual double doubleClickForDoubleTapDelay() = 0; >+ virtual float doubleClickForDoubleTapRadius() = 0; > #endif > > // Auxiliary Client Creation >diff --git a/Source/WebKit/UIProcess/WebPageProxy.cpp b/Source/WebKit/UIProcess/WebPageProxy.cpp >index f15d0fd0cc7bdfa6a741a814098c74c62f81767a..004a51f8db2155d86ba50993511274d1288641f6 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.cpp >+++ b/Source/WebKit/UIProcess/WebPageProxy.cpp >@@ -7173,6 +7173,8 @@ WebPageCreationParameters WebPageProxy::creationParameters(WebProcessProxy& proc > parameters.keyboardIsAttached = isInHardwareKeyboardMode(); > parameters.overrideViewportArguments = m_overrideViewportArguments; > parameters.canShowWhileLocked = m_configuration->canShowWhileLocked(); >+ parameters.doubleClickForDoubleTapDelay = pageClient().doubleClickForDoubleTapDelay(); >+ parameters.doubleClickForDoubleTapRadius = pageClient().doubleClickForDoubleTapRadius(); > #endif > > #if PLATFORM(MAC) >diff --git a/Source/WebKit/UIProcess/WebPageProxy.h b/Source/WebKit/UIProcess/WebPageProxy.h >index 9869b013fc63b6854aaafb33728cc3445312c0aa..8ca92de77c5ac2d23e17c25070308a4998202940 100644 >--- a/Source/WebKit/UIProcess/WebPageProxy.h >+++ b/Source/WebKit/UIProcess/WebPageProxy.h >@@ -1225,7 +1225,6 @@ public: > void tapHighlightAtPosition(const WebCore::FloatPoint&, uint64_t& requestID); > void handleTap(const WebCore::FloatPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart); > void didRecognizeLongPress(); >- void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebEvent::Modifier>, uint64_t layerTreeTransactionIdAtLastTouchStart); > > void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&); > void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&); >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >index 413c93b3ac05e6c5f6537d49f5128235ef5c4a0f..b38c4bc30a5378d47c316c3f18923784bcf89966 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.h >@@ -244,6 +244,9 @@ private: > > void handleAutocorrectionContext(const WebAutocorrectionContext&) final; > >+ double doubleClickForDoubleTapDelay() final; >+ float doubleClickForDoubleTapRadius() final; >+ > void didFinishProcessingAllPendingMouseEvents() final { } > > #if HAVE(PENCILKIT) >diff --git a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >index 267bd43bdd101cda946f8488a175333346cdd110..df1fbae03aa89e591d2b30cfcc347f0f98a404a3 100644 >--- a/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >+++ b/Source/WebKit/UIProcess/ios/PageClientImplIOS.mm >@@ -836,6 +836,16 @@ void PageClientImpl::didChangeDragCaretRect(const IntRect& previousCaretRect, co > } > #endif > >+double PageClientImpl::doubleClickForDoubleTapDelay() >+{ >+ return [m_contentView _doubleClickForDoubleTapDelay]; >+} >+ >+float PageClientImpl::doubleClickForDoubleTapRadius() >+{ >+ return [m_contentView _doubleClickForDoubleTapRadius]; >+} >+ > #if USE(QUICK_LOOK) > void PageClientImpl::requestPasswordForQuickLookDocument(const String& fileName, WTF::Function<void(const String&)>&& completionHandler) > { >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >index 6690cd198bdaf458271d4abb98da654a180f050d..e1c0a0eb272452717252ccd044895de809ebead9 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h >@@ -213,7 +213,6 @@ struct WKAutoCorrectionData { > RetainPtr<UILongPressGestureRecognizer> _longPressGestureRecognizer; > RetainPtr<WKSyntheticTapGestureRecognizer> _doubleTapGestureRecognizer; > RetainPtr<UITapGestureRecognizer> _nonBlockingDoubleTapGestureRecognizer; >- RetainPtr<UITapGestureRecognizer> _doubleTapGestureRecognizerForDoubleClick; > RetainPtr<UITapGestureRecognizer> _twoFingerDoubleTapGestureRecognizer; > RetainPtr<UITapGestureRecognizer> _twoFingerSingleTapGestureRecognizer; > RetainPtr<UITapGestureRecognizer> _stylusSingleTapGestureRecognizer; >@@ -457,6 +456,8 @@ FOR_EACH_PRIVATE_WKCONTENTVIEW_ACTION(DECLARE_WKCONTENTVIEW_ACTION_FOR_WEB_VIEW) > - (void)_disableInspectorNodeSearch; > - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler; > - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled; >+- (double)_doubleClickForDoubleTapDelay; >+- (float)_doubleClickForDoubleTapRadius; > #if ENABLE(DATA_DETECTION) > - (NSArray *)_dataDetectionResults; > #endif >diff --git a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >index b3a49eeac7f9f3dc1208efb3d01f794e89d141c8..ab0805589dd30795b9b26cf7985ee6a345dd30fa 100644 >--- a/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >+++ b/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm >@@ -693,6 +693,16 @@ - (void)_createAndConfigureLongPressGestureRecognizer > [self addGestureRecognizer:_longPressGestureRecognizer.get()]; > } > >+- (void)_ensureNonBlockingDoubleTapGestureRecognizer >+{ >+ if (_nonBlockingDoubleTapGestureRecognizer) >+ return; >+ _nonBlockingDoubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_nonBlockingDoubleTapRecognized:)]); >+ [_nonBlockingDoubleTapGestureRecognizer setNumberOfTapsRequired:2]; >+ [_nonBlockingDoubleTapGestureRecognizer setDelegate:self]; >+ [_nonBlockingDoubleTapGestureRecognizer setEnabled:NO]; >+} >+ > - (void)setupInteraction > { > // If the page is not valid yet then delay interaction setup until the process is launched/relaunched. >@@ -739,17 +749,9 @@ - (void)setupInteraction > #endif > [self addGestureRecognizer:_singleTapGestureRecognizer.get()]; > >- _nonBlockingDoubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_nonBlockingDoubleTapRecognized:)]); >- [_nonBlockingDoubleTapGestureRecognizer setNumberOfTapsRequired:2]; >- [_nonBlockingDoubleTapGestureRecognizer setDelegate:self]; >- [_nonBlockingDoubleTapGestureRecognizer setEnabled:NO]; >+ [self _ensureNonBlockingDoubleTapGestureRecognizer]; > [self addGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()]; > >- _doubleTapGestureRecognizerForDoubleClick = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognizedForDoubleClick:)]); >- [_doubleTapGestureRecognizerForDoubleClick setNumberOfTapsRequired:2]; >- [_doubleTapGestureRecognizerForDoubleClick setDelegate:self]; >- [self addGestureRecognizer:_doubleTapGestureRecognizerForDoubleClick.get()]; >- > [self _createAndConfigureDoubleTapGestureRecognizer]; > > _twoFingerDoubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_twoFingerDoubleTapRecognized:)]); >@@ -892,9 +894,6 @@ - (void)cleanupInteraction > [_nonBlockingDoubleTapGestureRecognizer setDelegate:nil]; > [self removeGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()]; > >- [_doubleTapGestureRecognizerForDoubleClick setDelegate:nil]; >- [self removeGestureRecognizer:_doubleTapGestureRecognizerForDoubleClick.get()]; >- > [_twoFingerDoubleTapGestureRecognizer setDelegate:nil]; > [self removeGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()]; > >@@ -967,7 +966,6 @@ - (void)_removeDefaultGestureRecognizers > [self removeGestureRecognizer:_highlightLongPressGestureRecognizer.get()]; > [self removeGestureRecognizer:_doubleTapGestureRecognizer.get()]; > [self removeGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()]; >- [self removeGestureRecognizer:_doubleTapGestureRecognizerForDoubleClick.get()]; > [self removeGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()]; > [self removeGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; > [self removeGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; >@@ -984,7 +982,6 @@ - (void)_addDefaultGestureRecognizers > [self addGestureRecognizer:_highlightLongPressGestureRecognizer.get()]; > [self addGestureRecognizer:_doubleTapGestureRecognizer.get()]; > [self addGestureRecognizer:_nonBlockingDoubleTapGestureRecognizer.get()]; >- [self addGestureRecognizer:_doubleTapGestureRecognizerForDoubleClick.get()]; > [self addGestureRecognizer:_twoFingerDoubleTapGestureRecognizer.get()]; > [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()]; > [self addGestureRecognizer:_stylusSingleTapGestureRecognizer.get()]; >@@ -1824,15 +1821,6 @@ - (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecogni > if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _nonBlockingDoubleTapGestureRecognizer.get())) > return YES; > >- if (isSamePair(gestureRecognizer, otherGestureRecognizer, _singleTapGestureRecognizer.get(), _doubleTapGestureRecognizerForDoubleClick.get())) >- return YES; >- >- if (isSamePair(gestureRecognizer, otherGestureRecognizer, _nonBlockingDoubleTapGestureRecognizer.get(), _doubleTapGestureRecognizerForDoubleClick.get())) >- return YES; >- >- if (isSamePair(gestureRecognizer, otherGestureRecognizer, _doubleTapGestureRecognizer.get(), _doubleTapGestureRecognizerForDoubleClick.get())) >- return YES; >- > if (isSamePair(gestureRecognizer, otherGestureRecognizer, _highlightLongPressGestureRecognizer.get(), _previewSecondaryGestureRecognizer.get())) > return YES; > >@@ -2029,7 +2017,6 @@ - (BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer > if (gestureRecognizer == _highlightLongPressGestureRecognizer > || gestureRecognizer == _doubleTapGestureRecognizer > || gestureRecognizer == _nonBlockingDoubleTapGestureRecognizer >- || gestureRecognizer == _doubleTapGestureRecognizerForDoubleClick > || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer) { > > if (hasFocusedElement(_focusedElementInformation)) { >@@ -2435,11 +2422,6 @@ - (void)_nonBlockingDoubleTapRecognized:(UITapGestureRecognizer *)gestureRecogni > _isDoubleTapPending = YES; > } > >-- (void)_doubleTapRecognizedForDoubleClick:(UITapGestureRecognizer *)gestureRecognizer >-{ >- _page->handleDoubleTapForDoubleClickAtPoint(WebCore::IntPoint(gestureRecognizer.location), WebKit::webEventModifierFlags(gestureRecognizerModifierFlags(gestureRecognizer)), _layerTreeTransactionIdAtLastTouchStart); >-} >- > - (void)_twoFingerDoubleTapRecognized:(UITapGestureRecognizer *)gestureRecognizer > { > [self _resetIsDoubleTapPending]; >@@ -3815,10 +3797,7 @@ - (void)_handleAutocorrectionContext:(const WebKit::WebAutocorrectionContext&)co > > - (void)_didStartProvisionalLoadForMainFrame > { >- // 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 >+ // We 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]; >@@ -3878,6 +3857,28 @@ - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled > [self _resetIsDoubleTapPending]; > } > >+- (double)_doubleClickForDoubleTapDelay >+{ >+ static double doubleClickForDoubleTapDelay = 350; >+ static dispatch_once_t onceToken; >+ dispatch_once(&onceToken, ^{ >+ [self _ensureNonBlockingDoubleTapGestureRecognizer]; >+ doubleClickForDoubleTapDelay = [_nonBlockingDoubleTapGestureRecognizer maximumIntervalBetweenSuccessiveTaps]; >+ }); >+ return doubleClickForDoubleTapDelay; >+} >+ >+- (float)_doubleClickForDoubleTapRadius >+{ >+ static float doubleClickForDoubleTapRadius = 45; >+ static dispatch_once_t onceToken; >+ dispatch_once(&onceToken, ^{ >+ [self _ensureNonBlockingDoubleTapGestureRecognizer]; >+ doubleClickForDoubleTapRadius = [_nonBlockingDoubleTapGestureRecognizer allowableMovement]; >+ }); >+ return doubleClickForDoubleTapRadius; >+} >+ > // MARK: UIWebFormAccessoryDelegate protocol and accessory methods > > - (void)accessoryClear >diff --git a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >index 3b1800f8e32d4e27775e8568c9d5b88fc00de158..b5ee6f3153792203d6837f2f1441943e3da603fc 100644 >--- a/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >+++ b/Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm >@@ -845,11 +845,6 @@ void WebPageProxy::didRecognizeLongPress() > process().send(Messages::WebPage::DidRecognizeLongPress(), m_pageID); > } > >-void WebPageProxy::handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint& point, OptionSet<WebEvent::Modifier> modifiers, uint64_t layerTreeTransactionIdAtLastTouchStart) >-{ >- process().send(Messages::WebPage::HandleDoubleTapForDoubleClickAtPoint(point, modifiers, layerTreeTransactionIdAtLastTouchStart), m_pageID); >-} >- > void WebPageProxy::inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint& position) > { > process().send(Messages::WebPage::InspectorNodeSearchMovedToPosition(position), m_pageID); >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.cpp b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >index 2ed7e931822fcb6c04f2c8e2edc99563f8ae55f8..83248d88242eab7b043bcea799bffe407e4270e5 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.cpp >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.cpp >@@ -416,6 +416,8 @@ WebPage::WebPage(PageIdentifier pageID, WebPageCreationParameters&& parameters) > , m_deviceOrientation(parameters.deviceOrientation) > , m_keyboardIsAttached(parameters.keyboardIsAttached) > , m_canShowWhileLocked(parameters.canShowWhileLocked) >+ , m_doubleClickForDoubleTapDelay(parameters.doubleClickForDoubleTapDelay) >+ , m_doubleClickForDoubleTapRadius(parameters.doubleClickForDoubleTapRadius) > #endif > , m_layerVolatilityTimer(*this, &WebPage::layerVolatilityTimerFired) > , m_activityState(parameters.activityState) >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.h b/Source/WebKit/WebProcess/WebPage/WebPage.h >index 18a35ad27c9664d7a7a4ba5cdfcd85ced32be1f7..26691bcfd801e64362ab5fa6c4e96972ee854913 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.h >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.h >@@ -634,7 +634,7 @@ public: > void cancelPotentialTapInFrame(WebFrame&); > void tapHighlightAtPosition(uint64_t requestID, const WebCore::FloatPoint&); > void didRecognizeLongPress(); >- void handleDoubleTapForDoubleClickAtPoint(const WebCore::IntPoint&, OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId); >+ bool handlePotentialDoubleTapForDoubleClickAtPoint(OptionSet<WebKit::WebEvent::Modifier>, uint64_t lastLayerTreeTransactionId); > > void inspectorNodeSearchMovedToPosition(const WebCore::FloatPoint&); > void inspectorNodeSearchEndedAtPosition(const WebCore::FloatPoint&); >@@ -1857,6 +1857,8 @@ private: > bool m_keyboardIsAttached { false }; > bool m_canShowWhileLocked { false }; > bool m_inDynamicSizeUpdate { false }; >+ double m_doubleClickForDoubleTapDelay { 350 }; >+ float m_doubleClickForDoubleTapRadius { 45 }; > HashMap<std::pair<WebCore::IntSize, double>, WebCore::IntPoint> m_dynamicSizeUpdateHistory; > RefPtr<WebCore::Node> m_pendingSyntheticClickNode; > WebCore::FloatPoint m_pendingSyntheticClickLocation; >@@ -1867,6 +1869,8 @@ private: > Optional<DynamicViewportSizeUpdateID> m_pendingDynamicViewportSizeUpdateID; > double m_lastTransactionPageScaleFactor { 0 }; > uint64_t m_lastTransactionIDWithScaleChange { 0 }; >+ MonotonicTime m_lastCommittedTapTimestamp; >+ WebCore::FloatPoint m_lastCommittedTapLocation; > > CompletionHandler<void(InteractionInformationAtPosition&&)> m_pendingSynchronousPositionInformationReply; > #endif >diff --git a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >index b06ab0f6eec1c7941cc9dc13c81ae1e703d4e8e7..6f9f97243ba4b57bedc3a480f0fd14a28049cc98 100644 >--- a/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >+++ b/Source/WebKit/WebProcess/WebPage/WebPage.messages.in >@@ -57,7 +57,6 @@ messages -> WebPage LegacyReceiver { > CancelPotentialTap() > TapHighlightAtPosition(uint64_t requestID, WebCore::FloatPoint point) > DidRecognizeLongPress() >- HandleDoubleTapForDoubleClickAtPoint(WebCore::IntPoint point, OptionSet<WebKit::WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) > InspectorNodeSearchMovedToPosition(WebCore::FloatPoint point) > InspectorNodeSearchEndedAtPosition(WebCore::FloatPoint point) > BlurFocusedElement() >diff --git a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >index 38bf8fe5f77a8c16d6610b0a1596bb71eaaf7a50..0f4235cbc59ebd7fc2882b4d2e09150e146e4ffd 100644 >--- a/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >+++ b/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm >@@ -800,16 +800,24 @@ void WebPage::handleTap(const IntPoint& point, OptionSet<WebEvent::Modifier> mod > handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers); > } > >-void WebPage::handleDoubleTapForDoubleClickAtPoint(const IntPoint& point, OptionSet<WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) >+bool WebPage::handlePotentialDoubleTapForDoubleClickAtPoint(OptionSet<WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId) > { >+ auto millisecondsSinceLastTap = (MonotonicTime::now() - m_lastCommittedTapTimestamp).milliseconds(); >+ if (millisecondsSinceLastTap > m_doubleClickForDoubleTapDelay * 1000) >+ return false; >+ >+ auto distanceBetweenTaps = sqrtf(pow(m_potentialTapLocation.x() - m_lastCommittedTapLocation.x(), 2) + pow(m_potentialTapLocation.y() - m_lastCommittedTapLocation.y(), 2)); >+ if (distanceBetweenTaps > m_doubleClickForDoubleTapRadius) >+ return false; >+ > FloatPoint adjustedPoint; >- auto* nodeRespondingToDoubleClick = m_page->mainFrame().nodeRespondingToDoubleClickEvent(point, adjustedPoint); >+ auto* nodeRespondingToDoubleClick = m_page->mainFrame().nodeRespondingToDoubleClickEvent(m_potentialTapLocation, adjustedPoint); > if (!nodeRespondingToDoubleClick) >- return; >+ return false; > > auto* frameRespondingToDoubleClick = nodeRespondingToDoubleClick->document().frame(); > if (!frameRespondingToDoubleClick || lastLayerTreeTransactionId < WebFrame::fromCoreFrame(*frameRespondingToDoubleClick)->firstLayerTreeTransactionIDAfterDidCommitLoad()) >- return; >+ return false; > > bool shiftKey = modifiers.contains(WebEvent::Modifier::ShiftKey); > bool ctrlKey = modifiers.contains(WebEvent::Modifier::ControlKey); >@@ -818,8 +826,9 @@ void WebPage::handleDoubleTapForDoubleClickAtPoint(const IntPoint& point, Option > auto roundedAdjustedPoint = roundedIntPoint(adjustedPoint); > nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMousePressEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MousePressed, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap)); > if (m_isClosed) >- return; >+ return false; > nodeRespondingToDoubleClick->document().frame()->eventHandler().handleMouseReleaseEvent(PlatformMouseEvent(roundedAdjustedPoint, roundedAdjustedPoint, LeftButton, PlatformEvent::MouseReleased, 2, shiftKey, ctrlKey, altKey, metaKey, WallTime::now(), 0, WebCore::NoTap)); >+ return true; > } > > void WebPage::requestFocusedElementInformation(WebKit::CallbackID callbackID) >@@ -1040,9 +1049,17 @@ void WebPage::potentialTapAtPosition(uint64_t requestID, const WebCore::FloatPoi > > void WebPage::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64_t lastLayerTreeTransactionId, WebCore::PointerID pointerId) > { >- if (!m_potentialTapNode || (!m_potentialTapNode->renderer() && !is<HTMLAreaElement>(m_potentialTapNode.get()))) { >+ auto updateLastCommittedLocationAndTimestamp = [&] { >+ m_lastCommittedTapTimestamp = MonotonicTime::now(); >+ m_lastCommittedTapLocation = m_potentialTapLocation; >+ }; >+ >+ auto invalidTargetForSingleClick = !m_potentialTapNode || (!m_potentialTapNode->renderer() && !is<HTMLAreaElement>(m_potentialTapNode.get())); >+ if (invalidTargetForSingleClick) { >+ // When the node has no click eventlistener, but it may have a dblclick one. >+ handlePotentialDoubleTapForDoubleClickAtPoint(modifiers, lastLayerTreeTransactionId); > commitPotentialTapFailed(); >- return; >+ return updateLastCommittedLocationAndTimestamp(); > } > > FloatPoint adjustedPoint; >@@ -1051,7 +1068,7 @@ void WebPage::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64 > > if (!frameRespondingToClick || lastLayerTreeTransactionId < WebFrame::fromCoreFrame(*frameRespondingToClick)->firstLayerTreeTransactionIDAfterDidCommitLoad()) { > commitPotentialTapFailed(); >- return; >+ return updateLastCommittedLocationAndTimestamp(); > } > > if (m_potentialTapNode == nodeRespondingToClick) { >@@ -1062,13 +1079,19 @@ void WebPage::commitPotentialTap(OptionSet<WebEvent::Modifier> modifiers, uint64 > commitPotentialTapFailed(); > } else > #endif >- handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers, pointerId); >+ { >+ if (handlePotentialDoubleTapForDoubleClickAtPoint(modifiers, lastLayerTreeTransactionId)) >+ commitPotentialTapFailed(); >+ else >+ handleSyntheticClick(*nodeRespondingToClick, adjustedPoint, modifiers, pointerId); >+ } > } else > commitPotentialTapFailed(); > > m_potentialTapNode = nullptr; > m_potentialTapLocation = FloatPoint(); > m_potentialTapSecurityOrigin = nullptr; >+ return updateLastCommittedLocationAndTimestamp(); > } > > void WebPage::commitPotentialTapFailed() >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 74e8b9e7e994f9d394b7b52853d074c087313e8a..11cd357de6fcaa479531452305d5519edb71c932 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,15 @@ >+2019-06-11 Zalan Bujtas <zalan@apple.com> >+ >+ LayoutTests/fast/events/touch/ios/double-tap-for-double-click* test cases are failing >+ https://bugs.webkit.org/show_bug.cgi?id=198764 >+ <rdar://problem/51035459> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/events/touch/ios/double-tap-for-double-click1.html: >+ * fast/events/touch/ios/double-tap-for-double-click2.html: >+ * fast/events/touch/ios/double-tap-for-double-click3.html: >+ > 2019-06-08 Cathie Chen <cathiechen@igalia.com> > > resize-observer/element-leak.html fails on Windows platform >diff --git a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click1.html b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click1.html >index 5513175833b48090f90492883b94f61a4a5f327f..166518ee60d102af4595426bbe1b4d8fafa3bff2 100644 >--- a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click1.html >+++ b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click1.html >@@ -3,7 +3,7 @@ > <head> > <meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no"> > <title>This tests that we fire dblclick event on double tap</title> >-<script src="../../../../resources/basic-gestures.js"></script> >+<script src="../../../../resources/ui-helper.js"></script> > <style> > #doubleTapthis { > width: 400px; >@@ -19,7 +19,7 @@ async function test() { > testRunner.waitUntilDone(); > testRunner.dumpAsText(); > >- await doubleTapAtPoint(doubleTapthis.offsetLeft, doubleTapthis.offsetTop); >+ await UIHelper.humanSpeedDoubleTapAt(doubleTapthis.offsetLeft, doubleTapthis.offsetTop); > } > </script> > </head> >diff --git a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click2.html b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click2.html >index b1c75922d15b0c2166ef81f76f4c44eebfc7d8b0..cf2014d69e4e9f204f35fca823c9b518ee2b4fe7 100644 >--- a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click2.html >+++ b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click2.html >@@ -3,7 +3,7 @@ > <head> > <meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no"> > <title>This tests that we fire dblclick event on double tap when the content is replaced</title> >-<script src="../../../../resources/basic-gestures.js"></script> >+<script src="../../../../resources/ui-helper.js"></script> > <style> > #doubleTapThis { > width: 400px; >@@ -29,7 +29,7 @@ async function test() { > let x = rect.left + rect.width / 2; > let y = rect.top + rect.height / 2; > >- await doubleTapAtPoint(x, y); >+ await UIHelper.humanSpeedDoubleTapAt(x, y); > } > </script> > </head> >diff --git a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click3.html b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click3.html >index 4beb8a2c6127fbe9191ca6868f746ceed8c11939..19a8a295b8ccb15e244817f6341dc89693409d59 100644 >--- a/LayoutTests/fast/events/touch/ios/double-tap-for-double-click3.html >+++ b/LayoutTests/fast/events/touch/ios/double-tap-for-double-click3.html >@@ -3,7 +3,7 @@ > <head> > <meta name="viewport" content="width=device-width initial-scale=1 user-scalable=no"> > <title>This tests that we do not fire dblclick event on double tap on node with touch-action: none</title> >-<script src="../../../../resources/basic-gestures.js"></script> >+<script src="../../../../resources/ui-helper.js"></script> > <style> > #doubleTapthis { > width: 400px; >@@ -12,8 +12,8 @@ > touch-action: none; > } > #finishTest { >- width: 10px; >- height: 10px; >+ width: 200px; >+ height: 200px; > border: 1px solid green; > } > </style> >@@ -25,9 +25,9 @@ async function test() { > testRunner.waitUntilDone(); > testRunner.dumpAsText(); > >- await doubleTapAtPoint(doubleTapthis.offsetLeft, doubleTapthis.offsetTop); >+ await UIHelper.humanSpeedDoubleTapAt(doubleTapthis.offsetLeft, doubleTapthis.offsetTop); > >- await doubleTapAtPoint(finishTest.offsetLeft, finishTest.offsetTop); >+ await UIHelper.humanSpeedDoubleTapAt(finishTest.offsetLeft + 100, finishTest.offsetTop + 100); > } > </script> > </head>
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 198764
:
371871
|
371881