New issue
Advanced search Search tips

Issue 644398 link

Starred by 5 users

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

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);

 
I'm also able to reproduce this bug.
Cc: rbyers@chromium.org nzolghadr@chromium.org
Components: Blink>Input
Labels: -Pri-3 Hotlist-Input-Dev PointerEvent Pri-2
Owner: mustaq@chromium.org
Status: Assigned (was: Unconfirmed)
Cc: dtapu...@chromium.org
Labels: OS-All
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.
Hey Mustaq, are you looking at this yourself?
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.

Comment 7 by abong...@gmail.com, 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
target.html
1.5 KB View Download
capture.js
293 bytes View Download

Comment 8 by mustaq@chromium.org, Oct 31 2016

Status: Started (was: Assigned)
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
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


Status: Fixed (was: Started)
Labels: M-55 Merge-Request-55
The bug could cause problems with any pages with shadowDOMs. Because it's a very simple change, worth merging to M55.

Comment 14 by dimu@chromium.org, Nov 4 2016

Labels: -Merge-Request-55 Merge-Approved-55 Hotlist-Merge-Approved
Your change meets the bar and is auto-approved for M55 (branch: 2883)
Project Member

Comment 15 by bugdroid1@chromium.org, Nov 4 2016

Labels: -merge-approved-55 merge-merged-2883
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