<?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>18842</bug_id>
          
          <creation_ts>2012-09-11 23:53:39 +0000</creation_ts>
          <short_desc>[Custom]: Custom element instantiation creates older ShadowRoots for more derived types, which is counterintuitive</short_desc>
          <delta_ts>2012-10-24 20:03:12 +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>17103</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dominic Cooney">dominicc</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>73652</commentid>
    <comment_count>0</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2012-09-11 23:53:39 +0000</bug_when>
    <thetext>Custom element instantiation processes a custom element’s prototype chain &quot;in reverse order (starting with the most-derived object)&quot;.

This means in step 4.4.2, that more derived custom elements create their ShadowRoot first. This has the effect of masking their ShadowRoot with less-derived custom elements, which is counter-intuitive. For example, given:

&lt;element name=&quot;x-happy-button&quot; extends=&quot;button&quot;&gt;
  &lt;template&gt;
      &lt;img src=&quot;balloons.gif&quot;&gt;
      &lt;content&gt;&lt;/content&gt;
      &lt;img src=&quot;clowns.gif&quot;&gt;
  &lt;/template&gt;
&lt;/element&gt;

&lt;element name=&quot;x-super-happy-button&quot; extends=&quot;x-happy-button&quot;&gt;
  &lt;template&gt;
    &lt;div style=&quot;width: 500px; height: 500px; background: teal;&quot;&gt;
      &lt;img src=&quot;stars.gif&quot;&gt;
      &lt;shadow&gt;&lt;/shadow&gt;
      &lt;img src=&quot;puppies.gif&quot;&gt;
    &lt;/div&gt;
  &lt;/template&gt;
&lt;/element&gt;

then

&lt;x-super-happy-button&gt;Hello!&lt;/x-super-happy-button&gt;

will not be big, teal, nor have stars nor puppies, because the super happy ShadowRoot content will have been preempted by the younger, merely happy ShadowRoot which was instantiated later.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>77064</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2012-10-24 20:03:12 +0000</bug_when>
    <thetext>http://dvcs.w3.org/hg/webcomponents/rev/632c44aed726

Sorry, I misunderstood the meaning of &quot;most-derived&quot; to mean the opposite :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>