<?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>28564</bug_id>
          
          <creation_ts>2015-04-27 08:26:48 +0000</creation_ts>
          <short_desc>[Shadow]: Event model</short_desc>
          <delta_ts>2015-05-27 03:11:05 +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>MOVED</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>
          <dependson>20017</dependson>
    
    <dependson>20247</dependson>
    
    <dependson>23887</dependson>
    
    <dependson>25458</dependson>
    
    <dependson>26892</dependson>
    
    <dependson>28558</dependson>
    
    <dependson>28560</dependson>
          <blocked>28552</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>bugs</cc>
    
    <cc>hayato</cc>
    
    <cc>mike</cc>
    
    <cc>public-webapps</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>119926</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 08:26:48 +0000</bug_when>
    <thetext>This is a bug to figure out the overall changes needed to the DOM event dispatch algorithm for shadow DOM.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119928</commentid>
    <comment_count>1</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 08:58:43 +0000</bug_when>
    <thetext>So we need to modify event dispatch as follows:

* Add a flag to restrict dispatch to the current tree (needed e.g. for &lt;img&gt;&apos;s load and error events)
* Calculate relatedTarget (might affect composed path)
* Calculate the composed path based on relatedTarget, the aforementioned flag, ...

Then listener invocation needs these changes:

* Modify target, currentTarget, relatedTarget, offsetX/Y, Touch#target to be relative
* Modify deepPath to exclude hidden/isolated trees

And we should consider exposing these members:

* path (excludes all shadow trees)
* deepTarget (deepPath[0])
* deepRelatedTarget (not available right now)
* deepOffsetX/Y (not available right now)
* Touch#deepTarget (not available right now)

(It seems a little bit unfortunate that we need to special case certain UI events in the generic event dispatch algorithm. Perhaps we can find a way for the UI Events specification to tackle the relatedTarget needs and such.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119934</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 13:16:31 +0000</bug_when>
    <thetext>Note that if we add a flag for event dispatch we should also add that flag to dispatchEvent():

  obj.dispatchEvent(ev, { scope: &quot;subtree&quot; })</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119945</commentid>
    <comment_count>3</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2015-04-27 16:34:44 +0000</bug_when>
    <thetext>We don&apos;t need to do everything at once, like that 
obj.dispatchEvent(ev, { scope: &quot;subtree&quot; }) can be added if someone actually
needs it.
The current Shadow DOM and XBL have lived just fine without it.

We don&apos;t want shorthand for deepPath[0], I think. So not that kind of deepTarget.
And for relatedTarget there could be also a list, not deepRelatedTarget.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119946</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2015-04-27 16:45:48 +0000</bug_when>
    <thetext>(In reply to Olli Pettay from comment #3)
&gt; The current Shadow DOM and XBL have lived just fine without it.

Not really, see bug 20247 for which it is meant. I guess we don&apos;t need to expose the API to JavaScript directly, but we do need the feature.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>119947</commentid>
    <comment_count>5</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2015-04-27 16:51:16 +0000</bug_when>
    <thetext>Sure, Events need that flag, but it doesn&apos;t need to be exposed in any way to scripts, unless needed.
(Though, I&apos;m not really against that, but just hoping that we don&apos;t add such features to the platform that no one will use.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>120521</commentid>
    <comment_count>6</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-05-27 03:11:05 +0000</bug_when>
    <thetext>Moved to Moved to https://github.com/w3c/webcomponents/issues/77</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>