Bug 19875 - [Shadow]: Retargeting algorithm is incorrectly retargets at lower boundary
[Shadow]: Retargeting algorithm is incorrectly retargets at lower boundary
Status: RESOLVED FIXED
Product: WebAppsWG
Classification: Unclassified
Component: HISTORICAL - DOM3 Events
unspecified
PC Windows NT
: P2 normal
: ---
Assigned To: Doug Schepers
public-webapps-bugzilla
:
Depends on:
Blocks: 18428
  Show dependency treegraph
 
Reported: 2012-11-06 09:18 UTC by Sergey G. Grekhov
Modified: 2012-11-08 21:35 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey G. Grekhov 2012-11-06 09:18:18 UTC
This is offshot of https://bugs.webkit.org/show_bug.cgi?id=101309. 

It's unclear from Shadow DOM specification why parent calculation algorithm shouldn't be invoked for document nodes distributed to the insertion points. See https://bugs.webkit.org/show_bug.cgi?id=101309 for example
Comment 1 Hayato Ito 2012-11-06 09:40:04 UTC
In my understanding, the parent calculation algorithm should be also invoked for a node distributed to insertion points.
Comment 2 Dimitri Glazkov 2012-11-08 20:48:27 UTC
Okay, running the event retargeting algorithm on the tree in https://bugs.webkit.org/show_bug.cgi?id=101309:

1) We start with "#li3", push it into STACK and add (#li3, #li3) to TARGETS
2) According to parent calculation algo, next up is "content"
3) Since it's an insertion point, we push "content" to STACK and add (content, content) to TARGETS
4) Next up is "ul#ip_wrapper"
5) We add (ul#ip_wrapper, content) to TARGETS
6) Next up is "div"
7) We add (div, content) to TARGETS
8) Next up is ShadowRoot
9) We add (ShadowRoot, content) to targets, then pop STACK
10) Next up is "ul.stories"
11) We add (ul.stories, #li3) to TARGETS
...

So the problem is starts with step 3. We should _not_ retarget at insertion point.
Comment 3 Dimitri Glazkov 2012-11-08 21:35:06 UTC
Okay, running the event retargeting algorithm on the tree in https://bugs.webkit.org/show_bug.cgi?id=101309:

1) We start with "#li3", push it into STACK and add (#li3, #li3) to TARGETS
2) According to parent calculation algo, next up is "content"
3) Since it's an insertion point, we push "content" to STACK and add (content, content) to TARGETS
4) Next up is "ul#ip_wrapper"
5) We add (ul#ip_wrapper, content) to TARGETS
6) Next up is "div"
7) We add (div, content) to TARGETS
8) Next up is ShadowRoot
9) We add (ShadowRoot, content) to targets, then pop STACK
10) Next up is "ul.stories"
11) We add (ul.stories, #li3) to TARGETS
...

So the problem is starts with step 3. We should _not_ retarget at insertion point.
Comment 4 Dimitri Glazkov 2012-11-08 21:35:46 UTC
http://dvcs.w3.org/hg/webcomponents/rev/c7b1b3f1caf6