<?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>18630</bug_id>
          
          <creation_ts>2012-08-20 23:01:02 +0000</creation_ts>
          <short_desc>[Shadow]: It&apos;s unclear where a &apos;load&apos; event is fired for replaced elements which has an author shadow root.</short_desc>
          <delta_ts>2012-08-20 23:22:50 +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>WONTFIX</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="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>shinyak</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>72451</commentid>
    <comment_count>0</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-08-20 23:01:02 +0000</bug_when>
    <thetext>The spec says:
http://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html#html-elements
&gt; all HTML elements must have an equivalent of a shadow DOM subtree that is created and populated at the time of element instantiation.

According to the spec, &lt;img&gt; element should have a shadow DOM subtree like:

&lt;img id=A src=&apos;a.png&apos;&gt;
   -#shadow-root
      &lt;real-image-implementation&gt;

Next, we attach an author shadow root (and its children) to an image element like:

&lt;img src=&apos;a.png&apos;&gt;
   -#shadow-root
      &lt;real-image-implementation&gt;
   -#author-shadow-root
     - &lt;div id=B&gt;
        - &lt;shadow&gt;

So a composed shadow tree would become:

 &lt;img id=A src=&apos;a.png&apos;&gt;
    &lt;div id=B&gt;
        &lt;real-image-implementation&gt;

My question is:
- Where a &apos;load&apos; event should be fired after &apos;a.png&apos; is loaded?

Option A) On an &lt;img id=A&gt; element directly.
Option B) On a &lt;real-image-implementation&gt; so that &lt;div id=B&gt; can receive an load event.

If we adopt option B, we must not stop the &apos;load&apos; event at shadow boundary of &lt;img&gt;.

That means:
- We should not stop a load event if it is fired on real-image-implementation at the shadow boundary between &lt;img&gt; and &lt;real-image-implementation&gt;.
- We should stop other load events at the shadow boundary.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72452</commentid>
    <comment_count>1</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-08-20 23:03:52 +0000</bug_when>
    <thetext>My preference is option B.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72453</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-20 23:06:27 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; My preference is option B.

Can you explain why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72454</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-08-20 23:09:09 +0000</bug_when>
    <thetext>I don&apos;t have a strong technical reason, but it looks natural for me at first glance.

(In reply to comment #2)
&gt; (In reply to comment #1)
&gt; &gt; My preference is option B.
&gt; 
&gt; Can you explain why?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72455</commentid>
    <comment_count>4</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-08-20 23:17:35 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; I don&apos;t have a strong technical reason, but it looks natural for me at first
&gt; glance.

Here&apos;s why I think we should stay with option A (which is what is in HTML spec right now):

1) No additional work necessary. The HTML spec clearly states that the event is dispatched on HTMLImageElement.

2)  Logically, there&apos;s a clear separation of responsibilities. The &lt;real-image-implementation&gt; is just a pixel surface. The loading machinery lives in HTMLImageElement, where it should be. In a way, the &lt;real-image-implementation&gt; could be just a canvas tag. It has no loading/error plumbing whatsoever.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72456</commentid>
    <comment_count>5</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2012-08-20 23:22:50 +0000</bug_when>
    <thetext>Okay. Thank you. I don&apos;t have strong opinion on this because we don&apos;t have a strong use case that requires option B. Let&apos;s close the bug.

Shinya, please feel free to reopen this if you encounter a use case which requires option B.

(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; I don&apos;t have a strong technical reason, but it looks natural for me at first
&gt; &gt; glance.
&gt; 
&gt; Here&apos;s why I think we should stay with option A (which is what is in HTML spec
&gt; right now):
&gt; 
&gt; 1) No additional work necessary. The HTML spec clearly states that the event is
&gt; dispatched on HTMLImageElement.
&gt; 
&gt; 2)  Logically, there&apos;s a clear separation of responsibilities. The
&gt; &lt;real-image-implementation&gt; is just a pixel surface. The loading machinery
&gt; lives in HTMLImageElement, where it should be. In a way, the
&gt; &lt;real-image-implementation&gt; could be just a canvas tag. It has no loading/error
&gt; plumbing whatsoever.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>