[Bug 17090] [Shadow]: Listening to specific nodes, distributed to insertion points is hard

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

Hayato Ito <hayato@chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |hayato@chromium.org

--- Comment #1 from Hayato Ito <hayato@chromium.org> 2012-05-18 10:14:11 UTC ---
I agree that this use case is worth discussing.

In current spec, an event listener which is registered to an insertion point
can not know which distributed node does trigger the event.
It sounds reasonable that developers want to know the clicked node through
event.target as long as it does not break upper/lower boundary.
In current implementation, event.target returns InsertionPoint itself, not the
distributed node which triggers the event.

(In reply to comment #0)
> Consider this use case:
> 
> * There is an insertion point, with zero or more nodes distributed into it
> * User clicks on one of the items
> * The event handler in shadow DOM subtree wants to know which item was
> clicked on.
> 
> Our newly-implemented lower-boundary encapsulation logic will
> dutifully prevent this from happening.
> 
> So currently, the only solution here is to register an event listener
> on each node that's distributed to the insertion point.
> 
> This seems suboptimal, since it effectively leaks the functional
> encapsulation (now you have to worry about cleaning up the event
> listeners when the node is moved, etc.)

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Friday, 18 May 2012 10:14:19 UTC