RESOLVED FIXED Bug 188561
mouseenter and mouseleave events don't get dispatched even when there is a capturing event listener for a slot ancestor
https://bugs.webkit.org/show_bug.cgi?id=188561
Summary mouseenter and mouseleave events don't get dispatched even when there is a ca...
Olli Pettay (:smaug)
Reported 2018-08-14 10:46:21 PDT
Created attachment 347090 [details] testcase, move mouse to top left corner, open console and reload and move mouse per instructions Per UIEvent spec, mouseenter/leave are composed events, so they do propagate from shadow DOM to host. But, assuming I'm reading the code right, the optimizations in EventHandler.cpp make mouseenter/leave handling depend on whether there are capturing event listeners, even though the listener on host can be bubbling listener, since when event is handled at that level, it is AT_TARGET, and all the listeners should be called. https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/page/EventHandler.cpp#L2529
Attachments
testcase, move mouse to top left corner, open console and reload and move mouse per instructions (1.07 KB, text/html)
2018-08-14 10:46 PDT, Olli Pettay (:smaug)
no flags
Fixes the bug (21.08 KB, patch)
2018-09-07 19:11 PDT, Ryosuke Niwa
no flags
Archive of layout-test-results from ews102 for mac-sierra (2.30 MB, application/zip)
2018-09-07 20:16 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews116 for mac-sierra (3.02 MB, application/zip)
2018-09-07 20:54 PDT, EWS Watchlist
no flags
Archive of layout-test-results from ews125 for ios-simulator-wk2 (2.27 MB, application/zip)
2018-09-07 21:08 PDT, EWS Watchlist
no flags
Fixed tests (20.16 KB, patch)
2018-09-07 22:14 PDT, Ryosuke Niwa
darin: review+
Ryosuke Niwa
Comment 1 2018-09-07 00:33:23 PDT
(In reply to Olli Pettay (:smaug) from comment #0) > Created attachment 347090 [details] > testcase, move mouse to top left corner, open console and reload and move > mouse per instructions > > Per UIEvent spec, mouseenter/leave are composed events, so they do propagate > from shadow DOM to host. > But, assuming I'm reading the code right, the optimizations in > EventHandler.cpp make mouseenter/leave handling depend on whether there are > capturing event listeners, even though the listener on host can be > bubbling listener, since when event is handled at that level, it is > AT_TARGET, and all the listeners should be called. The bubbling event listeners are checked as we walk up the ancestors: https://trac.webkit.org/browser/webkit/trunk/Source/WebCore/page/EventHandler.cpp#L2571 The bug we have is that we're not walking up past the shadow root here. We also need to make these events not-composed per https://github.com/w3c/uievents/issues/208
Ryosuke Niwa
Comment 2 2018-09-07 19:11:44 PDT
Created attachment 349229 [details] Fixes the bug
EWS Watchlist
Comment 3 2018-09-07 20:16:09 PDT
Comment on attachment 349229 [details] Fixes the bug Attachment 349229 [details] did not pass mac-ews (mac): Output: https://webkit-queues.webkit.org/results/9136486 New failing tests: fast/events/shadow-event-path.html
EWS Watchlist
Comment 4 2018-09-07 20:16:11 PDT
Created attachment 349234 [details] Archive of layout-test-results from ews102 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-ews. Bot: ews102 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 5 2018-09-07 20:53:59 PDT
Comment on attachment 349229 [details] Fixes the bug Attachment 349229 [details] did not pass mac-debug-ews (mac): Output: https://webkit-queues.webkit.org/results/9136533 New failing tests: fast/events/shadow-event-path.html
EWS Watchlist
Comment 6 2018-09-07 20:54:01 PDT
Created attachment 349236 [details] Archive of layout-test-results from ews116 for mac-sierra The attached test failures were seen while running run-webkit-tests on the mac-debug-ews. Bot: ews116 Port: mac-sierra Platform: Mac OS X 10.12.6
EWS Watchlist
Comment 7 2018-09-07 21:08:23 PDT
Comment on attachment 349229 [details] Fixes the bug Attachment 349229 [details] did not pass ios-sim-ews (ios-simulator-wk2): Output: https://webkit-queues.webkit.org/results/9136558 New failing tests: fast/shadow-dom/mouseenter-mouseleave-across-shadow-boundary.html fast/shadow-dom/mouseenter-mouseleave-inside-shadow-tree.html fast/shadow-dom/mouseenter-mouseleave-on-slot-parent.html
EWS Watchlist
Comment 8 2018-09-07 21:08:25 PDT
Created attachment 349237 [details] Archive of layout-test-results from ews125 for ios-simulator-wk2 The attached test failures were seen while running run-webkit-tests on the ios-sim-ews. Bot: ews125 Port: ios-simulator-wk2 Platform: Mac OS X 10.13.4
Ryosuke Niwa
Comment 9 2018-09-07 22:14:10 PDT
Created attachment 349242 [details] Fixed tests
Radar WebKit Bug Importer
Comment 10 2018-09-07 22:37:08 PDT
Ryosuke Niwa
Comment 11 2018-09-10 14:52:31 PDT
Thanks for the reviews!
Ryosuke Niwa
Comment 12 2018-09-10 14:54:16 PDT
Note You need to log in before you can comment on or make changes to this bug.