[Bug 23887] [Shadow] Put only the final destination insertion point to the event path

https://www.w3.org/Bugs/Public/show_bug.cgi?id=23887

Olli Pettay <bugs@pettay.fi> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|WONTFIX                     |---

--- Comment #47 from Olli Pettay <bugs@pettay.fi> ---
(In reply to Steve Orvell from comment #43)
> Let's go back to this case in
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=23887#c39 and review the
> counter-argument.
> 
>     <content select=".header"></content>
>     <content select=".content"></content>
> 
> 
> > Why? Add a listener to the shadow host? You can easily filter out events in the 
> > listener, for example by using the content.getDistributedNodes().
> > Or you can add listeners to the distributed nodes themselves.
> 
> Neither option is acceptable.
> 
> If a listener is added to the shadowRoot, then each handler must start at
> event.target and walk up the tree checking if the element is in the specific
> content's list of distributed nodes. This has a non-trivial cost in code and
> performance.
Making propagation path more complicated has also performance cost, and
makes event propagation inconsistent.
Also, it is rather trivial cost in code, and makes code less unexpected, since
propagation path doesn't have inconsistencies.


> Alternatively, if handlers are attached to the distributed nodes, there's no
> good way today for the developer to respond to nodes that are added/removed.
> You can watch for mutations on the host's childList, but you will not see
> elements that are re-projected this way.
Which is why I suggested making getDistributedNodes more useful. As of now it
is rather
dummy plain list, but one should be able to get notification when it has been
changed.

> 
> At this point, I don't see an alternative to requiring all insertion points
> to be in the event path. If we don't include insertion points, we run into
> the problems listed above. If we include only the last insertion point, we
> have composition fail.

XBL1 has the long tradition to put listener to the binding parent (shadowroot),
and that hasn't been a perf problem.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.

Received on Friday, 21 March 2014 17:08:23 UTC