<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>25423</bug_id>
          
          <creation_ts>2014-04-23 04:35:33 +0000</creation_ts>
          <short_desc>[Shadow]: event.path should return every nodes in the event path, instead of erasing nodes on descendant trees.</short_desc>
          <delta_ts>2014-05-27 11:39:38 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>HISTORICAL - Component Model</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>14978</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Hayato Ito">hayato</reporter>
          <assigned_to name="Hayato Ito">hayato</assigned_to>
          <cc>annevk</cc>
    
    <cc>d</cc>
    
    <cc>dglazkov</cc>
    
    <cc>erik.arvidsson</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
    
    <cc>rafaelw</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>104245</commentid>
    <comment_count>0</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-04-23 04:35:33 +0000</bug_when>
    <thetext>It might be useful that we just expose every nodes in the event path in event.path API, instead of filtering out nodes on descendant trees.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104251</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-23 09:20:10 +0000</bug_when>
    <thetext>Note that there is another bug on .path open somewhere. It should be able to hold more than nodes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104254</commentid>
    <comment_count>2</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-04-23 09:52:39 +0000</bug_when>
    <thetext>(In reply to Anne from comment #1)
&gt; Note that there is another bug on .path open somewhere. It should be able to
&gt; hold more than nodes.

Yep. IIRC, event.path should return an array of *EventTarget*, rather than NodeList.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104256</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-23 10:27:44 +0000</bug_when>
    <thetext>Correct. Domenic, event.path is another property where we want a &quot;JavaScript Array&quot; solution quickly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104264</commentid>
    <comment_count>4</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-04-23 13:04:16 +0000</bug_when>
    <thetext>I think at the TAG we were fairly strongly on the side of just using normal mutable JavaScript arrays. This shouldn&apos;t be hard.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104266</commentid>
    <comment_count>5</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-04-23 13:54:45 +0000</bug_when>
    <thetext>To be clear I thought we also wanted to remove the retargetting that is done on the event path.

Composed tree

    a
    |
    b
    |
  [SR]
    |
    c
    |      
&lt;content&gt;
    |
    d

var calls = 0;
a.addEventListener(&apos;click&apos;, (e) =&gt; {
  assert.deepEqual([a, b, SR, c, content, d], e.path);
  calls++;
});
d.click();
assert.equal(calls, 1);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104270</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-23 14:32:57 +0000</bug_when>
    <thetext>Erik, if event.path works like that, it does not describe what happens for elements existing today as they hide the shadow tree. Do we really want to leak shadow trees all over the place?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104271</commentid>
    <comment_count>7</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2014-04-23 14:34:39 +0000</bug_when>
    <thetext>The idea would be to hide those from the path once the spec adds a way to make hidden shadow trees.

In Blink we would of course need to hide our internals for &lt;video&gt; etc even if the spec does not cover this yet.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104272</commentid>
    <comment_count>8</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-04-23 14:40:51 +0000</bug_when>
    <thetext>Hmm. http://w3c.github.io/webcomponents/spec/shadow/#events-that-are-always-stopped is still around too. Those magic lists are bad. How is this shipping without the bugs filed being addressed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104285</commentid>
    <comment_count>9</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-04-23 16:17:01 +0000</bug_when>
    <thetext>(In reply to Anne from comment #8)
&gt; Hmm.
&gt; http://w3c.github.io/webcomponents/spec/shadow/#events-that-are-always-
&gt; stopped is still around too. Those magic lists are bad. How is this shipping
&gt; without the bugs filed being addressed?

Not sure what you mean there. There&apos;s both a bug for it (https://www.w3.org/Bugs/Public/show_bug.cgi?id=20247) and an explicit item in the plan thing I sent out early this year (http://lists.w3.org/Archives/Public/public-webapps/2014JanMar/0338.html)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104318</commentid>
    <comment_count>10</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-04-24 07:48:41 +0000</bug_when>
    <thetext>(In reply to Erik Arvidsson from comment #5)
&gt; To be clear I thought we also wanted to remove the retargetting that is done
&gt; on the event path.

This could be filed as another issue.

Could you file another bug? I&apos;d like to see a use case for that there.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104898</commentid>
    <comment_count>11</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-05-01 07:42:33 +0000</bug_when>
    <thetext>I&apos;d like to move this issue forward.

Can we agree on this?

AFAIR, we have a reason for this change. I appreciate someone would give us a use case for this change in this discussion.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104912</commentid>
    <comment_count>12</comment_count>
    <who name="Rafael Weinstein">rafaelw</who>
    <bug_when>2014-05-01 17:08:52 +0000</bug_when>
    <thetext>a common pattern of event delegation is to put the delegate (listener) on the document root, but to mark specific nodes in the document which information about what to do with the specific event. When the delegate handles the event, it must inspect the node to retrieve the information (e.g. what method to invoke on the delegate). 

If the event.path is sanitized on it&apos;s way up as the event bubbles, in the information the document-wide delegate may need is no longer reachable because it belongs to the a node which has been removed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104951</commentid>
    <comment_count>13</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-02 08:26:33 +0000</bug_when>
    <thetext>However, if shadow tree nodes are just in there, it really isn&apos;t much of a &quot;shadow&quot; tree anymore, much more like a real tree. But I guess we lost that when we lost stronger encapsulation...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104975</commentid>
    <comment_count>14</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-05-02 14:43:35 +0000</bug_when>
    <thetext>(In reply to Anne from comment #13)
&gt; However, if shadow tree nodes are just in there, it really isn&apos;t much of a
&gt; &quot;shadow&quot; tree anymore, much more like a real tree. But I guess we lost that
&gt; when we lost stronger encapsulation...

Yup. Let&apos;s not forget to erase nodes from event path for &quot;closed&quot; shadow trees.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105292</commentid>
    <comment_count>15</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-05-07 10:32:48 +0000</bug_when>
    <thetext>Thank you for the comments.

Let me update the spec so that event.path will return every nodes, except for nodes in the *closed descendant trees*.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106839</commentid>
    <comment_count>16</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2014-05-27 11:39:38 +0000</bug_when>
    <thetext>Done at
https://github.com/w3c/webcomponents/commit/2a44fb1a32a3a6aaa7bd82d37f6bd17eb2d67535</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>