New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 771580 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Oct 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

event.relatedTarget returns the element inside the shadow tree

Project Member Reported by elkurin@google.com, Oct 4 2017

Issue description

Chrome Version: 61.0.3163.100 (Official Build) (64-bit)
OS: Linux OS

JS code:
http://jsbin.com/xasokabogo/1/edit?html,output

Expected Result:
relatedTarget which is in the shadow tree should return null after the event dispatch finishes.

Actual Result:
relatedTarget returns the element in the shadow tree. This means the content inside the shadow tree is leaking.
 

Comment 1 by kochi@chromium.org, Oct 5 2017

Cc: hayato@chromium.org
Status: Assigned (was: Untriaged)
The spec update is merged.
https://github.com/whatwg/dom/pull/513

Now if after event dispatching is finished and its target is in a shadow root,
relatedTarget should be cleared to null as well as target.
(in that case relatedTarget can be either in the shadow root or outside)
Project Member

Comment 2 by bugdroid1@chromium.org, Oct 6 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a

commit 9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a
Author: Eriko Kurimoto <elkurin@google.com>
Date: Fri Oct 06 09:20:06 2017

Add test for the behavior after EventDispatch

This corresponds to the DOM spec change
https://github.com/whatwg/dom/pull/513
not to leak elements inside shadow tree after event 
dispatch is complete.

Bug:  771580 ,  762829 
Change-Id: Ib77b4475c2c5bf174a6bcf3dc9f4dff583fd7d2a
Reviewed-on: https://chromium-review.googlesource.com/681894
Commit-Queue: Eriko Kurimoto <elkurin@google.com>
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#507013}
[modify] https://crrev.com/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/Extensions-to-Event-Interface.html
[add] https://crrev.com/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-post-dispatch-expected.txt
[add] https://crrev.com/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-post-dispatch.html
[modify] https://crrev.com/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-with-related-target.html
[modify] https://crrev.com/9c1d91c2ce388ffd5bfb0c005cd1c9f7016c7e3a/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/resources/event-path-test-helpers.js

Comment 3 Deleted

Comment 4 by kochi@chromium.org, Oct 11 2017

Owner: rakina@chromium.org
Rakina, could you fix the remaining test failures in
third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-post-dispatch.html
?

Comment 5 by kochi@chromium.org, Oct 13 2017

 Issue 762829  has been merged into this issue.

Comment 6 by kochi@chromium.org, Oct 13 2017

FYI the intern had a wip patch for this.
https://chromium-review.googlesource.com/c/chromium/src/+/701875

Comment 7 by rakina@chromium.org, Oct 16 2017

Status: Started (was: Assigned)
Project Member

Comment 8 by bugdroid1@chromium.org, Oct 18 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/c8804494d0f6e044bb28c71c53a360a821c730bf

commit c8804494d0f6e044bb28c71c53a360a821c730bf
Author: Rakina Zata Amni <rakina@chromium.org>
Date: Wed Oct 18 07:23:38 2017

Set relatedTarget to null if target is null in DispatchEventPostProcess

In some cases, relatedTarget kept its value after event dispatch has
finished even though target is set to null. See test file for the cases.

This change adds a check so that when target is set to null in the
post-processing phase, the change is also reflected in relatedTarget.

Bug:  771580 
Change-Id: Idda5d00c1a793b2669be66e76439851d1f66459c
Reviewed-on: https://chromium-review.googlesource.com/720897
Reviewed-by: Hayato Ito <hayato@chromium.org>
Reviewed-by: Takayoshi Kochi <kochi@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#509710}
[delete] https://crrev.com/69bf5caea128d736eea506fd3416de5eeb69ab0e/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-post-dispatch-expected.txt
[modify] https://crrev.com/c8804494d0f6e044bb28c71c53a360a821c730bf/third_party/WebKit/LayoutTests/external/wpt/shadow-dom/event-post-dispatch.html
[modify] https://crrev.com/c8804494d0f6e044bb28c71c53a360a821c730bf/third_party/WebKit/Source/core/dom/events/Event.cpp
[modify] https://crrev.com/c8804494d0f6e044bb28c71c53a360a821c730bf/third_party/WebKit/Source/core/dom/events/Event.h
[modify] https://crrev.com/c8804494d0f6e044bb28c71c53a360a821c730bf/third_party/WebKit/Source/core/dom/events/EventDispatcher.cpp
[modify] https://crrev.com/c8804494d0f6e044bb28c71c53a360a821c730bf/third_party/WebKit/Source/core/dom/events/NodeEventContext.cpp

Comment 9 by rakina@chromium.org, Oct 18 2017

Status: Fixed (was: Started)

Sign in to add a comment