[shadow-dom] Event Retargeting

The more I read this algorithm to figure out how to rewrite DOM event
dispatch the more confused I get. For starters it would probably help
if ancestor was renamed to event parent.

I was wondering if this rewrite of 3.1-3.3 is correct:

1. Let CONTEXT be null.
2. If ANCESTOR is an insertion point, set CONTEXT to the top-most item
in STACK that is not an insertion point, if any.
3. If STACK is empty, push ANCESTOR on STACK.

I think this would be quite a bit clearer.


Also, I think this algorithm gives the wrong result. Given a tree
<a><b/></a>. Now to <a> we apply a shadow tree with an insertion point
for <b>. This algorithm seems to say that we go through the shadow
tree and when we reach the shadow root we change the target, but that
would mean the shadow tree is observable from the DOM, which is bad.
Am I misunderstanding something here?


-- 
http://annevankesteren.nl/

Received on Tuesday, 12 February 2013 15:56:27 UTC