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

Issue 645527 link

Starred by 1 user

Issue metadata

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

Blocking:
issue 653993



Sign in to add a comment

e.path for events on window is confusing

Project Member Reported by ojan@chromium.org, Sep 9 2016

Issue description

http://plexode.com/eval3/#s=aekVQXANJVQMbAx1yAUpFHj0DVElCjFgOSVBUVZsfHRByHwMNA0uRk2Gdn1BYAR4BcA9SVkZTWjRGTUZEVVBTCQgEtKCipFUICg9EU0ZCVUY0nqAzUFBVCQocPU9h2VlVQtZCuLrU7NkmxE5GT+EI6Ors0uRPZq2B5CKJRexFEhJJRNIoJfTra7jcrlN8CIpFExXexVFpKUr2X7KJhGLSgJ4IBoBBJGBS4D4BLgBIhQf5QYgPJpQJEqlBGB5RbBJlC7ITGJUZeZGer3cYBLzjAZeAAA==

Type in the textarea at the bottom. e.path points to window instead of the actual path. I know we do some path fixup, but I'm having trouble understanding why we want to do this.

For context, it's making it hard to fix the backspace extension to work with shadow DOM: https://codereview.chromium.org/2326083002/
 

Comment 1 by hayato@chromium.org, Sep 12 2016

Could you use "document" instead of "window"? I think that is what you want.
See https://bugs.chromium.org/p/chromium/issues/detail?id=569707.

Nit: e.path is no longer recommended. If we can assume that chrome is >= 53, you should use e.composedPath(), instead of e.path.

Comment 2 by hayato@chromium.org, Sep 12 2016

I'm afraid that it might be unclear how event path should be on `window` in DOM Standard.
Let me re-check it, and file an issue for the spec, if necessary.

In any case, you can avoid an issue by registering event listener on document, instead of window.

Comment 3 by ojan@chromium.org, Sep 13 2016

document doesn't work because there might be a event handler on the document that calls preventDefault, in which case, we wouldn't want to navigate the page.

With my web developer hat on, it's very confusing that registering the listener on the window and document does different things.

Comment 4 by hayato@chromium.org, Sep 13 2016

I agree that it's confusing that window and document do different things.

I think we might want to *revert* the conclusion of:
https://bugs.chromium.org/p/chromium/issues/detail?id=569707

Let me update the spec, DOM Standard, at first, then try to fix Blink's implementation too.

Do you have any timeline? Is this urgent?

Comment 5 by ojan@chromium.org, Sep 14 2016

I don't know how urgent this is. Pam?

I think it can wait for you to update the spec first. 

Comment 6 by hayato@chromium.org, Sep 14 2016

Labels: -OS-Linux OS-All
Okay. Let me add this task to my backlog.

PR for DOM Standard is on-going: https://github.com/whatwg/dom/pull/327

Comment 7 by hayato@chromium.org, Sep 16 2016

I have updated the DOM Standard to clarify how e.path should be in an event listener on window.

The remaining task is to update Blink's implementation.

Comment 8 by pam@chromium.org, Sep 16 2016

Well, as Ojan proposed, the current workaround of using activeElement is likely to cover most cases, and certainly better than what the backspace extension is doing right now. So no huge urgency.
Project Member

Comment 9 by bugdroid1@chromium.org, Oct 3 2016

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

commit 92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254
Author: hayato <hayato@chromium.org>
Date: Mon Oct 03 04:03:34 2016

Make event.composedPath() on window behave the same way as that on document

The spec is: https://dom.spec.whatwg.org/#dom-event-composedpath
The relevant change of the spec: https://github.com/whatwg/dom/pull/327

I have updated the DOM Standard to clarify the behavior of event.composedPath() on
window.

The current Blink's implementation of event.composedPath() on window returns
just [window]. Now, event.composedPath() on window behaves the same way as that on document.

BUG= 645527 

Review-Url: https://codereview.chromium.org/2343923003
Cr-Commit-Position: refs/heads/master@{#422368}

[modify] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/LayoutTests/shadow-dom/event-composed-path.html
[modify] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/core/events/Event.cpp
[modify] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/core/events/EventPath.cpp
[modify] https://crrev.com/92dd0aa2f5587f380f7f8f7c58d1f9a9862e3254/third_party/WebKit/Source/core/events/EventPath.h

Status: Fixed (was: Assigned)

Comment 11 by pam@chromium.org, Oct 7 2016

Blocking: 653993

Sign in to add a comment