This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This is a bug to figure out the overall changes needed to the DOM event dispatch algorithm for shadow DOM.
So we need to modify event dispatch as follows: * Add a flag to restrict dispatch to the current tree (needed e.g. for <img>'s load and error events) * Calculate relatedTarget (might affect composed path) * Calculate the composed path based on relatedTarget, the aforementioned flag, ... Then listener invocation needs these changes: * Modify target, currentTarget, relatedTarget, offsetX/Y, Touch#target to be relative * Modify deepPath to exclude hidden/isolated trees And we should consider exposing these members: * path (excludes all shadow trees) * deepTarget (deepPath[0]) * deepRelatedTarget (not available right now) * deepOffsetX/Y (not available right now) * Touch#deepTarget (not available right now) (It seems a little bit unfortunate that we need to special case certain UI events in the generic event dispatch algorithm. Perhaps we can find a way for the UI Events specification to tackle the relatedTarget needs and such.)
Note that if we add a flag for event dispatch we should also add that flag to dispatchEvent(): obj.dispatchEvent(ev, { scope: "subtree" })
We don't need to do everything at once, like that obj.dispatchEvent(ev, { scope: "subtree" }) can be added if someone actually needs it. The current Shadow DOM and XBL have lived just fine without it. We don't want shorthand for deepPath[0], I think. So not that kind of deepTarget. And for relatedTarget there could be also a list, not deepRelatedTarget.
(In reply to Olli Pettay from comment #3) > The current Shadow DOM and XBL have lived just fine without it. Not really, see bug 20247 for which it is meant. I guess we don't need to expose the API to JavaScript directly, but we do need the feature.
Sure, Events need that flag, but it doesn't need to be exposed in any way to scripts, unless needed. (Though, I'm not really against that, but just hoping that we don't add such features to the platform that no one will use.)
Moved to Moved to https://github.com/w3c/webcomponents/issues/77