Changeset 265088 in webkit
- Timestamp:
- Jul 30, 2020 10:12:33 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r265083 r265088 1 2020-07-30 Antoine Quint <graouts@webkit.org> 2 3 [iOS] Unable to swipe on IMDB.com after long press on image 4 https://bugs.webkit.org/show_bug.cgi?id=214968 5 <rdar://problem/66234421> 6 7 Reviewed by Wenson Hsieh. 8 9 Add a test that triggers a long press gesture on an <img> and checks a single "pointerdown" event 10 was dispatched. Prior to the WebCore change in this patch, two events would be dispatched. 11 12 * pointerevents/ios/long-press-yields-single-pointerdown-event-expected.txt: Added. 13 * pointerevents/ios/long-press-yields-single-pointerdown-event.html: Added. 14 1 15 2020-07-30 Hector Lopez <hector_i_lopez@apple.com> 2 16 -
trunk/Source/WebCore/ChangeLog
r265086 r265088 1 2020-07-30 Antoine Quint <graouts@webkit.org> 2 3 [iOS] Unable to swipe on IMDB.com after long press on image 4 https://bugs.webkit.org/show_bug.cgi?id=214968 5 <rdar://problem/66234421> 6 7 Reviewed by Wenson Hsieh. 8 9 When a long press occurs on an <img>, a system drag interaction is initiated on iOS. In WebCore, 10 EventHandler::tryToBeginDragAtPoint() is called and a synthetic mouse event is produced, causing 11 handleMousePressEvent() to be called. Further down the call chain, dispatchPointerEventIfNeeded() 12 is called and a valid PointerEvent is generated in PointerCaptureController::pointerEventForMouseEvent() 13 with "pointerType" set to "mouse", even though there is already a touch interaction initiated. 14 15 We now check whether there are known touches before generating a PointerEvent for a MouseEvent. 16 17 In the case of IMDb, the page would keep track of "pointerdown" events to track whether a multi-touch 18 user gesture is in progress so that their slide shows can support two-finger zooming as well as 19 single-finger swiping. In the case of a long press, the second "pointerdown" event would trick 20 the code in thinking a zoom gesture was initiated and it never recovered. 21 22 Test: pointerevents/ios/long-press-yields-single-pointerdown-event.html 23 24 * page/PointerCaptureController.cpp: 25 (WebCore::PointerCaptureController::pointerEventForMouseEvent): 26 1 27 2020-07-30 Chris Dumez <cdumez@apple.com> 2 28 -
trunk/Source/WebCore/page/PointerCaptureController.cpp
r261961 r265088 302 302 RefPtr<PointerEvent> PointerCaptureController::pointerEventForMouseEvent(const MouseEvent& mouseEvent) 303 303 { 304 // If we already have known touches then we cannot dispatch a mouse event, 305 // for instance in the case of a long press to initiate a system drag. 306 for (auto& capturingData : m_activePointerIdsToCapturingData.values()) { 307 if (capturingData.pointerType != PointerEvent::mousePointerType()) 308 return nullptr; 309 } 310 304 311 const auto& type = mouseEvent.type(); 305 312 const auto& names = eventNames();
Note: See TracChangeset
for help on using the changeset viewer.