Pointer events do not propagate through shadow roots
Reported by
zambonif...@gmail.com,
Sep 6 2016
|
|||||||||
Issue description
To reproduce this bug, go to about:blank and paste the following script on the console (tested on Chrome 53.0.2785.92):
document.body.appendChild(document.createElement("div")).attachShadow({mode: "open"}).appendChild(document.createElement("button")).textContent = "Look at the console and hover over me!";
function log(e)
{
console.log(e.type);
}
window.addEventListener("mousemove", log);
window.addEventListener("pointermove", log);
,
Sep 26 2016
,
Sep 26 2016
,
Oct 3 2016
This could be related, I suspect there is something to do with hittesting: the button doesn't get any "mouseenter" even though "mouseover" is received.
,
Oct 3 2016
Hey Mustaq, are you looking at this yourself?
,
Oct 5 2016
Not really, just ran some tests w/o looking into a possible fix. I won't be able to look into it again before Friday. Feel free to assign it to yourself if you are able to start before that.
,
Oct 30 2016
I have a similar issue with SVG 'use' tag element which fails to detect mouse events on any of the rendered elements which are referenced by the use tag. I have attached sample code that I have used to perform the test. Regards, Anand
,
Oct 31 2016
,
Nov 1 2016
The main problem here is that the event path is incomplete for PointerEvent, ends at the shadow root w/o including the path from shadow host upward. This is not the case for mouse events. https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/events/EventDispatcher.cpp?rcl=1477913063&l=301
,
Nov 1 2016
I think the creation of the events is slightly different and perhaps the "composed" should be set to true here: https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/events/PointerEventFactory.cpp?sq=package:chromium&rcl=1477998970&l=139
,
Nov 3 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/80926f9622b2c2f7e2d12e128372769ceedd883b commit 80926f9622b2c2f7e2d12e128372769ceedd883b Author: mustaq <mustaq@chromium.org> Date: Thu Nov 03 15:34:46 2016 Fixed composed & detail fields in PointerEvents. This fixes the bug that event paths for PointerEvents was ending at the shadow root. Also refactored PointerEventFactory, fixed an old test for mouse buttons. BUG= 644398 , 548226 Review-Url: https://codereview.chromium.org/2467983002 Cr-Commit-Position: refs/heads/master@{#429596} [modify] https://crrev.com/80926f9622b2c2f7e2d12e128372769ceedd883b/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/80926f9622b2c2f7e2d12e128372769ceedd883b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties-expected.txt [modify] https://crrev.com/80926f9622b2c2f7e2d12e128372769ceedd883b/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties.html [modify] https://crrev.com/80926f9622b2c2f7e2d12e128372769ceedd883b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp [modify] https://crrev.com/80926f9622b2c2f7e2d12e128372769ceedd883b/third_party/WebKit/Source/core/events/PointerEventFactory.h
,
Nov 3 2016
,
Nov 3 2016
The bug could cause problems with any pages with shadowDOMs. Because it's a very simple change, worth merging to M55.
,
Nov 4 2016
Your change meets the bar and is auto-approved for M55 (branch: 2883)
,
Nov 4 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/538f85ad1261f957bd9c17b7b52d5c75c45a3afc commit 538f85ad1261f957bd9c17b7b52d5c75c45a3afc Author: Mustaq Ahmed <mustaq@google.com> Date: Fri Nov 04 18:58:09 2016 Fixed composed & detail fields in PointerEvents. This fixes the bug that event paths for PointerEvents was ending at the shadow root. Also refactored PointerEventFactory, fixed an old test for mouse buttons. BUG= 644398 , 548226 Review-Url: https://codereview.chromium.org/2467983002 Cr-Commit-Position: refs/heads/master@{#429596} (cherry picked from commit 80926f9622b2c2f7e2d12e128372769ceedd883b) Review URL: https://codereview.chromium.org/2478313003 . Cr-Commit-Position: refs/branch-heads/2883@{#459} Cr-Branched-From: 614d31daee2f61b0180df403a8ad43f20b9f6dd7-refs/heads/master@{#423768} [modify] https://crrev.com/538f85ad1261f957bd9c17b7b52d5c75c45a3afc/third_party/WebKit/LayoutTests/TestExpectations [modify] https://crrev.com/538f85ad1261f957bd9c17b7b52d5c75c45a3afc/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties-expected.txt [modify] https://crrev.com/538f85ad1261f957bd9c17b7b52d5c75c45a3afc/third_party/WebKit/LayoutTests/fast/events/pointerevents/mouse-pointer-event-properties.html [modify] https://crrev.com/538f85ad1261f957bd9c17b7b52d5c75c45a3afc/third_party/WebKit/Source/core/events/PointerEventFactory.cpp [modify] https://crrev.com/538f85ad1261f957bd9c17b7b52d5c75c45a3afc/third_party/WebKit/Source/core/events/PointerEventFactory.h |
|||||||||
►
Sign in to add a comment |
|||||||||
Comment 1 by jarek.fo...@gmail.com
, Sep 24 2016