Changeset 250315 in webkit
- Timestamp:
- Sep 24, 2019 1:06:48 PM (5 years ago)
- Location:
- trunk
- Files:
-
- 9 added
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r250303 r250315 1 2019-09-24 Zalan Bujtas <zalan@apple.com> 2 3 [iPadOs] The second click event is missing on double tap when dblclick handler is not present 4 https://bugs.webkit.org/show_bug.cgi?id=202006 5 <rdar://problem/51706828> 6 7 Reviewed by Wenson Hsieh. 8 9 * fast/events/touch/ios/double-tap-for-two-clicks1-expected.txt: Added. 10 * fast/events/touch/ios/double-tap-for-two-clicks1.html: Added. 11 * fast/events/touch/ios/double-tap-for-two-clicks2-expected.txt: Added. 12 * fast/events/touch/ios/double-tap-for-two-clicks2.html: Added. 13 * fast/events/touch/ios/double-tap-for-two-clicks3-expected.txt: Added. 14 * fast/events/touch/ios/double-tap-for-two-clicks3.html: Added. 15 * fast/events/touch/ios/double-tap-for-two-clicks4-expected.txt: Added. 16 * fast/events/touch/ios/double-tap-for-two-clicks4.html: Added. 17 * fast/events/touch/ios/doubleclick.html: Added. 18 * fast/events/touch/resources/doubleClickContent.html: Added. 19 1 20 2019-09-24 Antoine Quint <graouts@apple.com> 2 21 -
trunk/Source/WebKit/ChangeLog
r250312 r250315 1 2019-09-24 Zalan Bujtas <zalan@apple.com> 2 3 [iPadOs] The second click event is missing on double tap when dblclick handler is not present 4 https://bugs.webkit.org/show_bug.cgi?id=202006 5 <rdar://problem/51706828> 6 7 Reviewed by Wenson Hsieh. 8 9 While double tapping, 10 1. the first tap triggers a click event through the normal _singleTapIdentified/_singleTapRecognized codepath. 11 2. and the second tap should trigger either 12 a second single click event or 13 a second single click followed by a dblclick event when dblclick handler is present. 14 However the second click is dropped on the floor when the node under the cursor does not have a dblclick handler (see handleDoubleTapForDoubleClickAtPoint()) -so we end up sending one click event. 15 16 This patch fixes this case by sending the second tap through the normal single tap flow when the dblclick handler is not present. 17 18 * Shared/ios/InteractionInformationAtPosition.h: 19 * Shared/ios/InteractionInformationAtPosition.mm: 20 (WebKit::InteractionInformationAtPosition::encode const): 21 (WebKit::InteractionInformationAtPosition::decode): 22 * UIProcess/ios/WKContentViewInteraction.h: 23 * UIProcess/ios/WKContentViewInteraction.mm: 24 (-[WKContentView setupInteraction]): 25 (-[WKContentView gestureRecognizerShouldBegin:]): 26 (WebKit::WebPage::positionInformation): 27 (WebKit::WebPage::requestPositionInformation): 28 1 29 2019-09-24 Alex Christensen <achristensen@webkit.org> 2 30 -
trunk/Source/WebKit/Shared/ios/InteractionInformationAtPosition.h
r248447 r250315 52 52 bool canBeValid { true }; 53 53 bool nodeAtPositionIsFocusedElement { false }; 54 bool nodeAtPositionHasDoubleClickHandler { false }; 54 55 #if ENABLE(DATA_INTERACTION) 55 56 bool hasSelectionAtPosition { false }; -
trunk/Source/WebKit/Shared/ios/InteractionInformationAtPosition.mm
r248447 r250315 46 46 encoder << canBeValid; 47 47 encoder << nodeAtPositionIsFocusedElement; 48 encoder << nodeAtPositionHasDoubleClickHandler; 48 49 #if ENABLE(DATA_INTERACTION) 49 50 encoder << hasSelectionAtPosition; … … 98 99 return false; 99 100 101 if (!decoder.decode(result.nodeAtPositionHasDoubleClickHandler)) 102 return false; 103 100 104 #if ENABLE(DATA_INTERACTION) 101 105 if (!decoder.decode(result.hasSelectionAtPosition)) -
trunk/Source/WebKit/Shared/ios/InteractionInformationRequest.cpp
r246757 r250315 59 59 } 60 60 61 bool InteractionInformationRequest::isValidForRequest(const InteractionInformationRequest& other )61 bool InteractionInformationRequest::isValidForRequest(const InteractionInformationRequest& other, int radius) 62 62 { 63 if (other.point != point)64 return false;65 66 63 if (other.includeSnapshot && !includeSnapshot) 67 64 return false; … … 73 70 return false; 74 71 75 return true;72 return (other.point - point).diagonalLengthSquared() <= radius * radius; 76 73 } 77 74 78 bool InteractionInformationRequest::isApproximatelyValidForRequest(const InteractionInformationRequest& other )75 bool InteractionInformationRequest::isApproximatelyValidForRequest(const InteractionInformationRequest& other, int radius) 79 76 { 80 if (other.includeSnapshot && !includeSnapshot) 81 return false; 82 83 if (other.includeLinkIndicator && !includeLinkIndicator) 84 return false; 85 86 if (other.linkIndicatorShouldHaveLegacyMargins != linkIndicatorShouldHaveLegacyMargins) 87 return false; 88 89 return (other.point - point).diagonalLengthSquared() <= 4; 77 return isValidForRequest(other, radius); 90 78 } 91 79 -
trunk/Source/WebKit/Shared/ios/InteractionInformationRequest.h
r246757 r250315 51 51 } 52 52 53 bool isValidForRequest(const InteractionInformationRequest& );54 bool isApproximatelyValidForRequest(const InteractionInformationRequest& other);53 bool isValidForRequest(const InteractionInformationRequest&, int radius = 0); 54 bool isApproximatelyValidForRequest(const InteractionInformationRequest&, int radius); 55 55 56 56 void encode(IPC::Encoder&) const; -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r250256 r250315 2113 2113 } 2114 2114 2115 - (BOOL)_currentPositionInformationIsApproximatelyValidForRequest:(const WebKit::InteractionInformationRequest&)request 2116 { 2117 return _hasValidPositionInformation && _positionInformation.request.isApproximatelyValidForRequest(request );2115 - (BOOL)_currentPositionInformationIsApproximatelyValidForRequest:(const WebKit::InteractionInformationRequest&)request radiusForApproximation:(int)radius 2116 { 2117 return _hasValidPositionInformation && _positionInformation.request.isApproximatelyValidForRequest(request, radius); 2118 2118 } 2119 2119 … … 2192 2192 return !isInterruptingDecelerationForScrollViewOrAncestor([_singleTapGestureRecognizer lastTouchedScrollView]); 2193 2193 2194 if (gestureRecognizer == _doubleTapGestureRecognizerForDoubleClick) { 2195 // Do not start the double-tap-for-double-click gesture recognizer unless we've got a dblclick event handler on the node at the tap location. 2196 WebKit::InteractionInformationRequest request(WebCore::roundedIntPoint(point)); 2197 if ([self _currentPositionInformationIsApproximatelyValidForRequest:request radiusForApproximation:[_doubleTapGestureRecognizerForDoubleClick allowableMovement]]) 2198 return _positionInformation.nodeAtPositionHasDoubleClickHandler; 2199 if (![self ensurePositionInformationIsUpToDate:request]) 2200 return NO; 2201 return _positionInformation.nodeAtPositionHasDoubleClickHandler; 2202 } 2203 2194 2204 if (gestureRecognizer == _highlightLongPressGestureRecognizer 2195 2205 || gestureRecognizer == _doubleTapGestureRecognizer 2196 2206 || gestureRecognizer == _nonBlockingDoubleTapGestureRecognizer 2197 || gestureRecognizer == _doubleTapGestureRecognizerForDoubleClick2198 2207 || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer) { 2199 2208 … … 4472 4481 WebKit::InteractionInformationRequest request(WebCore::roundedIntPoint(point)); 4473 4482 [self requestAsynchronousPositionInformationUpdate:request]; 4474 if ([self _currentPositionInformationIsApproximatelyValidForRequest:request ] && _positionInformation.isSelectable)4483 if ([self _currentPositionInformationIsApproximatelyValidForRequest:request radiusForApproximation:2] && _positionInformation.isSelectable) 4475 4484 return [WKTextPosition textPositionWithRect:_positionInformation.caretRect]; 4476 4485 #endif -
trunk/Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm
r250256 r250315 2768 2768 2769 2769 FloatPoint adjustedPoint; 2770 Node* hitNode= m_page->mainFrame().nodeRespondingToClickEvents(request.point, adjustedPoint);2771 2772 info.nodeAtPositionIsFocusedElement = hitNode== m_focusedElement;2770 auto* nodeRespondingToClickEvents = m_page->mainFrame().nodeRespondingToClickEvents(request.point, adjustedPoint); 2771 2772 info.nodeAtPositionIsFocusedElement = nodeRespondingToClickEvents == m_focusedElement; 2773 2773 info.adjustedPointForNodeRespondingToClickEvents = adjustedPoint; 2774 info.nodeAtPositionHasDoubleClickHandler = m_page->mainFrame().nodeRespondingToDoubleClickEvent(request.point, adjustedPoint); 2774 2775 2775 2776 #if ENABLE(DATA_INTERACTION) … … 2780 2781 focusedElementPositionInformation(*this, *m_focusedElement, request, info); 2781 2782 2782 if (is<Element>( hitNode)) {2783 Element& element = downcast<Element>(*hitNode);2783 if (is<Element>(nodeRespondingToClickEvents)) { 2784 auto& element = downcast<Element>(*nodeRespondingToClickEvents); 2784 2785 elementPositionInformation(*this, element, request, info); 2785 2786 … … 2793 2794 // Prevent the callout bar from showing when tapping on the datalist button. 2794 2795 #if ENABLE(DATALIST_ELEMENT) 2795 if (is<HTMLInputElement>(hitNode)) { 2796 const HTMLInputElement& input = downcast<HTMLInputElement>(*hitNode); 2797 textInteractionPositionInformation(*this, input, request, info); 2798 } 2796 if (is<HTMLInputElement>(nodeRespondingToClickEvents)) 2797 textInteractionPositionInformation(*this, downcast<HTMLInputElement>(*nodeRespondingToClickEvents), request, info); 2799 2798 #endif 2800 2799
Note: See TracChangeset
for help on using the changeset viewer.