[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

Boris Zbarsky <bzbarsky@mit.edu> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bzbarsky@mit.edu

--- Comment #50 from Boris Zbarsky <bzbarsky@mit.edu> ---
I would like to clarify what the expected behavior is here, at least in the
simple case.

Say the light DOM looks like this:

  <div id="1"> 
    <div id="2">
      <div id="3"></div>
    <div>
  </div>

The <div id="1"> has a shadow DOM like so (I'm going to give the shadow root an
ID, though I realize it's not an element; that's just for ease of referring to
it):

  <shadowroot id="4">
    <div id="5">
      <div id="6">
        <content id="7"></content>
      </div>
    </div>
  </shadowroot>

and the <div id="6"> has a shadow DOM like so:

  <shadowroot id="8">
    <div id="9">
      <content id="10"></content>
    </div>
  </shadowroot>

Now an event is fired at <div id="3">.  In the composed tree, the parent chain
looks like 3, 2, 9, 6, 5, 1, I believe.

If I am following the algorithm at
http://w3c.github.io/webcomponents/spec/shadow/#event-paths correctly, we start
with the event path being [3, 2], then we see that the destination insertion
points of <div id="3"> is not empty and that none of them are shadow insertion
points, so we set the path to [3, 2, 7, 10] (note that the order of the
insertion points here is "rootmost first", unlike normal event path behavior).

Now we start off at the <content id="10"> and start walking the parent chain. 
We add "9" to the path, then we add "8" to the path.  Then CURRENT is a shadow
root, so we skip to its shadow host, which is "6".  We keep walking: "5", "4",
skip to "1".  So the final path is:

  3,2,7,10,9,8,6,5,4,1

I have ignored for now issues dealing with multiple shadow trees and whatever
scenario comment 13 is talking about.

I have confirmed that in the above simple testcase Chrome in fact has the event
path I just described.

What I don't quite understand, if we posit that we do want to put all the
insertion points in the path, is why the path is not the somewhat more
intuitive:

  3,2,10,9,8,7,6,5,4,1

?

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

Received on Friday, 21 March 2014 21:39:12 UTC