[Bug 18842] New: [Custom]: Custom element instantiation creates older ShadowRoots for more derived types, which is counterintuitive

https://www.w3.org/Bugs/Public/show_bug.cgi?id=18842

           Summary: [Custom]: Custom element instantiation creates older
                    ShadowRoots for more derived types, which is
                    counterintuitive
           Product: WebAppsWG
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
        AssignedTo: dglazkov@chromium.org
        ReportedBy: dominicc@chromium.org
         QAContact: public-webapps-bugzilla@w3.org
            Blocks: 14968


Custom element instantiation processes a custom element’s prototype chain "in
reverse order (starting with the most-derived object)".

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:

<element name="x-happy-button" extends="button">
  <template>
      <img src="balloons.gif">
      <content></content>
      <img src="clowns.gif">
  </template>
</element>

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

then

<x-super-happy-button>Hello!</x-super-happy-button>

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.

-- 
Configure bugmail: https://www.w3.org/Bugs/Public/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

Received on Tuesday, 11 September 2012 23:53:41 UTC