<?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>22920</bug_id>
          
          <creation_ts>2013-08-12 13:55:14 +0000</creation_ts>
          <short_desc>[Custom]: Custom element constructors should have class side inheritance</short_desc>
          <delta_ts>2013-08-29 21:47:32 +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>Linux</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>14968</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Erik Arvidsson">erik.arvidsson</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>cam</cc>
    
    <cc>dominicc</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>91898</commentid>
    <comment_count>0</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-08-12 13:55:14 +0000</bug_when>
    <thetext>Classes in ES6 have class side inheritance.

DOM in Firefox and WebKit also have class side inheritance.

Custom element constructor does not yet have class side inheritance.

class B extends HTMLElement {}
B = document.register(&apos;x-b&apos;, B);
assert(B.__proto__ === HTMLElement);

class C extends B {}
C = document.register(&apos;x-c&apos;, C);
assert(C.__proto__ === B);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92571</commentid>
    <comment_count>1</comment_count>
    <who name="Erik Arvidsson">erik.arvidsson</who>
    <bug_when>2013-08-26 14:07:30 +0000</bug_when>
    <thetext>Correction to previous post:

s/WebKit/Blink/

old habits die hard</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92616</commentid>
    <comment_count>2</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2013-08-27 02:55:13 +0000</bug_when>
    <thetext>FWIW, this is experimentally implemented in Blink.

The way the constructor is discovered is simply dereferencing the &apos;constructor&apos; property on the provided prototype. Prototype lookup does the rest.

This happens right after the prototype is retrieved from the options object.

The retrieved value isn&apos;t scrutinized.

If retrieving the constructor destroys the world, we throw an invalid context exception later (similar to the what happens if retrieving the prototype from the options destroys the world.)

Of course, I&apos;m open to changing any and all of these details. This is just the first cut to get feedback from developers.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92712</commentid>
    <comment_count>3</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-08-29 21:46:24 +0000</bug_when>
    <thetext>Custom Elements spec just says &quot;Let CONSTRUCTOR be the interface object whose interface prototype object is PROTOTYPE&quot;, fully relying on WebIDL properly defining what this means (including class-side inheritance).

From what I could glean, http://dev.w3.org/2006/webapi/WebIDL/#dfn-interface-object does not specify class-side inheritance. Should it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>92713</commentid>
    <comment_count>4</comment_count>
    <who name="Dominic Cooney">dominicc</who>
    <bug_when>2013-08-29 21:46:58 +0000</bug_when>
    <thetext>FWIW, the change that implemented constructor-side inheritance experimentally in Blink was rolled out.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>