e.path for events on window is confusing |
||||
Issue descriptionhttp://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/
,
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.
,
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.
,
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?
,
Sep 14 2016
I don't know how urgent this is. Pam? I think it can wait for you to update the spec first.
,
Sep 14 2016
Okay. Let me add this task to my backlog. PR for DOM Standard is on-going: https://github.com/whatwg/dom/pull/327
,
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.
,
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.
,
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
,
Oct 3 2016
,
Oct 7 2016
|
||||
►
Sign in to add a comment |
||||
Comment 1 by hayato@chromium.org
, Sep 12 2016