RESOLVED FIXED 198999
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
https://bugs.webkit.org/show_bug.cgi?id=198999
Summary [Pointer Events] Respect pointer capture when dispatching mouse boundary even...
Antoine Quint
Reported 2019-06-19 07:14:15 PDT
[Pointer Events] Respect pointer capture when dispatching mouse boundary events and updating :hover
Attachments
Patch (27.84 KB, patch)
2019-06-19 07:31 PDT, Antoine Quint
no flags
Patch (36.60 KB, patch)
2019-06-19 08:19 PDT, Antoine Quint
no flags
Archive of layout-test-results from ews106 for mac-highsierra-wk2 (2.72 MB, application/zip)
2019-06-19 09:39 PDT, EWS Watchlist
no flags
Patch (39.82 KB, patch)
2019-06-19 10:22 PDT, Antoine Quint
no flags
Archive of layout-test-results from ews104 for mac-highsierra-wk2 (2.94 MB, application/zip)
2019-06-19 11:18 PDT, EWS Watchlist
no flags
Patch (43.64 KB, patch)
2019-06-20 07:08 PDT, Antoine Quint
no flags
Patch (2.87 KB, patch)
2019-06-22 13:07 PDT, Antoine Quint
no flags
Patch (2.13 KB, patch)
2019-06-23 07:32 PDT, Antoine Quint
no flags
Patch (30.93 KB, patch)
2019-06-26 06:02 PDT, Antoine Quint
no flags
Archive of layout-test-results from ews106 for mac-highsierra-wk2 (2.83 MB, application/zip)
2019-06-26 07:28 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews115 for mac-highsierra (3.93 MB, application/zip)
2019-06-26 08:16 PDT, EWS Watchlist
no flags
Patch (31.26 KB, patch)
2019-06-26 09:43 PDT, Antoine Quint
no flags
Patch (2.12 KB, patch)
2019-06-26 15:08 PDT, Antoine Quint
dino: review+
Antoine Quint
Comment 1 2019-06-19 07:31:45 PDT
Antoine Quint
Comment 2 2019-06-19 08:19:29 PDT
EWS Watchlist
Comment 3 2019-06-19 09:39:29 PDT
Comment on attachment 372463 [details] Patch Attachment 372463 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/12521208 New failing tests: imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html pointerevents/mouse/pointer-capture.html
EWS Watchlist
Comment 4 2019-06-19 09:39:30 PDT
Created attachment 372468 [details] Archive of layout-test-results from ews106 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Antoine Quint
Comment 5 2019-06-19 10:22:18 PDT
EWS Watchlist
Comment 6 2019-06-19 11:18:40 PDT
Comment on attachment 372472 [details] Patch Attachment 372472 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/12522352 New failing tests: pointerevents/mouse/pointer-capture.html
EWS Watchlist
Comment 7 2019-06-19 11:18:42 PDT
Created attachment 372481 [details] Archive of layout-test-results from ews104 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews104 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
Antoine Quint
Comment 8 2019-06-20 07:08:27 PDT
Dean Jackson
Comment 9 2019-06-20 11:39:15 PDT
Comment on attachment 372551 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372551&action=review > Source/WebCore/page/EventHandler.h:417 > + bool dispatchMouseEvent(const AtomString& eventType, Node* target, bool cancelable, int clickCount, const PlatformMouseEvent&, bool setUnder, const HitTestRequest&, MouseEventWithHitTestResults&); I think you should give this a slightly different name to make it more clear. Or maybe call the other one base? Or use default parameter values?
Ryosuke Niwa
Comment 10 2019-06-20 15:10:30 PDT
Comment on attachment 372551 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=372551&action=review > Source/WebCore/dom/Document.cpp:3740 > + Element* targetElement = result.targetElement(); Please use makeRefPtr. > Source/WebCore/page/EventHandler.cpp:2045 > if (swallowEvent) This function also calls updateMouseEventTargetNode for onlyUpdateScrollbars is true or when newSubframe is set up above. Don't we also need to prevent it from getting called when pointer capturing is going on? > Source/WebCore/page/EventHandler.cpp:2166 > + // If we have pointer capture enabled, it will be disabled by virtue of receiving a "pointerup" event. For :active and :hover > + // styles to be set correctly when prepareMouseEvent() is called below, we should already reset pointer capture. > + m_frame.page()->pointerCaptureController().releasePointerCapture(m_capturingMouseEventsElement.get(), mousePointerID); > + // We must also reset m_capturingMouseEventsElement to ensure boundary mouse events are dispatched on the hit-testing target. > + m_capturingMouseEventsElement = nullptr; > + // The click event target may differ from the hit-testing target, so let's not dispatch boundary mouse events as part of dispatching > + // the click event below. Can we consolidate comments into a single block? This code interleaving with comments is hard to read. > Source/WebCore/page/EventHandler.cpp:2665 > bool EventHandler::dispatchMouseEvent(const AtomString& eventType, Node* targetNode, bool /*cancelable*/, int clickCount, const PlatformMouseEvent& platformMouseEvent, bool setUnder) This function also always calls updateMouseEventTargetNode. It seems that we either need to add a condition to avoid calling updateMouseEventTargetNode when there is pointer capturing going on or assert that there is no point capturing happening.
Antoine Quint
Comment 11 2019-06-21 01:45:10 PDT
(In reply to Ryosuke Niwa from comment #10) > Comment on attachment 372551 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=372551&action=review > > > Source/WebCore/dom/Document.cpp:3740 > > + Element* targetElement = result.targetElement(); > > Please use makeRefPtr. Will fix in commit. > > Source/WebCore/page/EventHandler.cpp:2045 > > if (swallowEvent) > > This function also calls updateMouseEventTargetNode for onlyUpdateScrollbars > is true or when newSubframe is set up above. > Don't we also need to prevent it from getting called when pointer capturing > is going on? I don't think it's necessary since I believe calls to updateMouseEventTargetNode() will do the right thing based on m_capturingMouseEventsElement being set to the capturing pointer element. > > Source/WebCore/page/EventHandler.cpp:2166 > > + // If we have pointer capture enabled, it will be disabled by virtue of receiving a "pointerup" event. For :active and :hover > > + // styles to be set correctly when prepareMouseEvent() is called below, we should already reset pointer capture. > > + m_frame.page()->pointerCaptureController().releasePointerCapture(m_capturingMouseEventsElement.get(), mousePointerID); > > + // We must also reset m_capturingMouseEventsElement to ensure boundary mouse events are dispatched on the hit-testing target. > > + m_capturingMouseEventsElement = nullptr; > > + // The click event target may differ from the hit-testing target, so let's not dispatch boundary mouse events as part of dispatching > > + // the click event below. > > Can we consolidate comments into a single block? This code interleaving with > comments is hard to read. Sure thing, will fix in commit. > > Source/WebCore/page/EventHandler.cpp:2665 > > bool EventHandler::dispatchMouseEvent(const AtomString& eventType, Node* targetNode, bool /*cancelable*/, int clickCount, const PlatformMouseEvent& platformMouseEvent, bool setUnder) > > This function also always calls updateMouseEventTargetNode. > It seems that we either need to add a condition to avoid calling > updateMouseEventTargetNode > when there is pointer capturing going on or assert that there is no point > capturing happening. Like above, I don't think this is necessary since m_capturingMouseEventsElement will be set to the capturing mouse element. Calling this function should be harmless.
Antoine Quint
Comment 12 2019-06-21 01:47:35 PDT
Radar WebKit Bug Importer
Comment 13 2019-06-21 01:49:16 PDT
Antoine Quint
Comment 14 2019-06-22 13:07:39 PDT
Reopening to attach new patch.
Antoine Quint
Comment 15 2019-06-22 13:07:41 PDT
Antoine Quint
Comment 16 2019-06-22 13:09:58 PDT
Antoine Quint
Comment 17 2019-06-23 07:32:54 PDT
Reopening to attach new patch.
Antoine Quint
Comment 18 2019-06-23 07:32:56 PDT
Antoine Quint
Comment 19 2019-06-24 03:01:08 PDT
Antoine Quint
Comment 20 2019-06-24 03:45:42 PDT
Antoine Quint
Comment 21 2019-06-24 03:47:10 PDT
Reopening, this caused a regression in imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html, so this wasn't fully baked.
Antoine Quint
Comment 22 2019-06-26 06:02:40 PDT
EWS Watchlist
Comment 23 2019-06-26 07:28:52 PDT
Comment on attachment 372919 [details] Patch Attachment 372919 [details] did not pass mac-wk2-ews (mac-wk2): Output: https://webkit-queues.webkit.org/results/12580777 New failing tests: media/audio-delete-while-slider-thumb-clicked.html
EWS Watchlist
Comment 24 2019-06-26 07:28:54 PDT
Created attachment 372923 [details] Archive of layout-test-results from ews106 for mac-highsierra-wk2 The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews. Bot: ews106 Port: mac-highsierra-wk2 Platform: Mac OS X 10.13.6
EWS Watchlist
Comment 25 2019-06-26 08:16:03 PDT
Comment on attachment 372919 [details] Patch Attachment 372919 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/12580836 New failing tests: fast/forms/number/number-large-padding.html fast/forms/range/slider-delete-while-dragging-thumb.html fast/forms/input-appearance-spinbutton-up.html fast/forms/number/number-change-type-on-focus.html fast/forms/range/slider-transformed.html media/media-controls-drag-timeline-set-controls-property.html fast/forms/number/number-spinbutton-state.html media/audio-delete-while-slider-thumb-clicked.html fast/forms/input-step-as-double.html fast/forms/number/number-spinbutton-capturing.html fast/forms/range/slider-zoomed.html fast/forms/range/range-type-change-onchange-2.html fast/forms/number/number-spinbutton-click-in-iframe.html fast/forms/number/number-losing-renderer-on-click.html
EWS Watchlist
Comment 26 2019-06-26 08:16:05 PDT
Created attachment 372924 [details] Archive of layout-test-results from ews115 for mac-highsierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews115 Port: mac-highsierra Platform: Mac OS X 10.13.6
Antoine Quint
Comment 27 2019-06-26 09:43:46 PDT
Antoine Quint
Comment 28 2019-06-26 11:36:53 PDT
Antoine Quint
Comment 29 2019-06-26 15:08:45 PDT
Reopening to attach new patch.
Antoine Quint
Comment 30 2019-06-26 15:08:47 PDT
Antoine Quint
Comment 31 2019-06-26 15:11:40 PDT
Truitt Savell
Comment 32 2019-06-26 16:48:49 PDT
Looks like the changes in https://trac.webkit.org/changeset/246844/webkit broke 11 tests: imported/w3c/web-platform-tests/pointerevents/pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse.html imported/w3c/web-platform-tests/pointerevents/pointerevent_click_during_capture.html imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_for_disconnected_node.html imported/w3c/web-platform-tests/pointerevents/pointerevent_lostpointercapture_is_first.html imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_capture_change_hover.html imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_in_frame.html imported/w3c/web-platform-tests/pointerevents/pointerevent_mouse_pointercapture_inactivate_pointer.html imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_invalid_pointerid.html imported/w3c/web-platform-tests/pointerevents/pointerevent_releasepointercapture_onpointerup_mouse.html imported/w3c/web-platform-tests/pointerevents/pointerevent_setpointercapture_relatedtarget.html Results: https://build.webkit.org/results/Apple%20High%20Sierra%20Debug%20WK1%20(Tests)/r246845%20(9730)/results.html History: http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard.html#showAllRuns=true&tests=imported%2Fw3c%2Fweb-platform-tests%2Fpointerevents%2Fpointerevent_boundary_events_at_implicit_release_hoverable_pointers.html Looks like most of these are harness timeouts and some are instant failures.
Antoine Quint
Comment 33 2019-06-26 21:43:58 PDT
I think the iOS failures were addressed in https://trac.webkit.org/r246849. Going to check again.
Antoine Quint
Comment 34 2019-06-26 23:19:26 PDT
Yes, all clear on the iOS front.
Truitt Savell
Comment 35 2019-06-28 07:55:42 PDT
(In reply to Truitt Savell from comment #32) > Looks like the changes in https://trac.webkit.org/changeset/246844/webkit > > broke 11 tests: > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_boundary_events_at_implicit_release_hoverable_pointers.html > imported/w3c/web-platform-tests/pointerevents/pointerevent_capture_mouse.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_click_during_capture.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_lostpointercapture_for_disconnected_node.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_lostpointercapture_is_first.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_mouse_capture_change_hover.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_mouse_pointercapture_in_frame.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_mouse_pointercapture_inactivate_pointer.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_releasepointercapture_invalid_pointerid.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_releasepointercapture_onpointerup_mouse.html > imported/w3c/web-platform-tests/pointerevents/ > pointerevent_setpointercapture_relatedtarget.html > > Results: > https://build.webkit.org/results/ > Apple%20High%20Sierra%20Debug%20WK1%20(Tests)/r246845%20(9730)/results.html > > History: > http://webkit-test-results.webkit.org/dashboards/flakiness_dashboard. > html#showAllRuns=true&tests=imported%2Fw3c%2Fweb-platform- > tests%2Fpointerevents%2Fpointerevent_boundary_events_at_implicit_release_hove > rable_pointers.html > > Looks like most of these are harness timeouts and some are instant failures. All of these failures are still occurring on Mac flakily and High Sierra Debug WK1 and Leaks constantly. Is this fixable today?
Truitt Savell
Comment 36 2019-07-01 14:23:49 PDT
Reverted r246849 for reason: 12 tests broken in r246844 require this to be rolled out. Committed r247023: <https://trac.webkit.org/changeset/247023>
Truitt Savell
Comment 37 2019-07-01 14:26:01 PDT
Reverted r246844 for reason: Broke 12 tests in imported/w3c/web-platform-tests/pointerevents/ Committed r247024: <https://trac.webkit.org/changeset/247024>
Antoine Quint
Comment 38 2019-07-05 03:25:42 PDT
Antoine Quint
Comment 39 2019-07-05 03:26:41 PDT
There was a new uninitialised boolean member variable in PointerCaptureController.h that caused bad issues with --leaks. This is now addressed in the newer patch.
Note You need to log in before you can comment on or make changes to this bug.