<?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>27017</bug_id>
          
          <creation_ts>2014-10-10 13:08:00 +0000</creation_ts>
          <short_desc>[Custom]: Constructor/prototype linkage needs to actually be defined, since it&apos;s dynamic, not static</short_desc>
          <delta_ts>2015-07-06 08:11:02 +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>
          
          <blocked>14968</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>annevk</cc>
    
    <cc>gkrizsanits</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>112946</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-10 13:08:00 +0000</bug_when>
    <thetext>See https://bugzilla.mozilla.org/show_bug.cgi?id=1081037#c1 for an explanation of the issues.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112958</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-10-10 16:22:39 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #0)
&gt; See https://bugzilla.mozilla.org/show_bug.cgi?id=1081037#c1 for an
&gt; explanation of the issues.

&gt; Specifically, all it says is:

&gt;   Let CONSTRUCTOR be the interface object whose interface prototype object is PROTOTYPE

&gt; What this would normally mean in Web IDL is the following:

  CONSTRUCTOR.prototype == PROTOTYPE
  PROTOTYPE.constructor == CONSTRUCTOR

&gt; but these are static constraints in Web IDL, since the set of interfaces is fixed.

Yep, that&apos;s exactly what it means. I could specify this in ES terms, rather than Web IDL, would that help?

http://es5.github.io/#x13.2

&gt; For the registerElement case, what happens if the same prototype is registered multiple times?  What does its .constructor end up being?  Futhermore, what should happen if the .constructor is non-configurable, or nonwritable, or both, before the registerElement call happens?  Is the property set via Put() or via  DefinePropertyOrThrow() or something else?

This is already spec&apos;d here: http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-constructor-generation

&gt; I mean, in terms of implementation we can just JS_LinkConstructorAndPrototype and move on for now, but that may not give us the same behavior that Chrome has, and per spec the behavior is just not defined</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112960</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-10 16:37:05 +0000</bug_when>
    <thetext>
&gt; Yep, that&apos;s exactly what it means.

There&apos;s a difference.  The Web IDL setup is about standard objects that are created as part of the initial scripting environment setup.  Therefore it doesn&apos;t have to specify how the properties are actually set/added/whatever because it doesn&apos;t matter: none of the objects have any properties before the set/add, there are no page-defined things on the prototypes, etc.

&gt; This is already spec&apos;d here: http://w3c.github.io/webcomponents/spec/custom/#dfn-custom-element-constructor-generation

Ah, step 1?  That covers it being already registered or having a non-configurable property named &quot;constructor&quot;, but doesn&apos;t cover what should happen if it _is_ configurable.  If the intent is that a [[DefineOwnProperty]] happens somewhere in here, that needs to be clearly specified.  Especially because [[DefineOwnProperty]] can have side-effects, so you have to define how it&apos;s ordered with other things.

Furthermore, you need to define exactly how one is supposed to determine &quot;has a non-configurable property named constructor&quot;.  I assume the intent is to do [[GetOwnProperty]] and then check the [[Configurable]] of the resulting property descriptor, but since this too can have side effects it&apos;s worth specifying exactly how and when it happens.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>121697</commentid>
    <comment_count>3</comment_count>
    <who name="Hayato Ito">hayato</who>
    <bug_when>2015-07-06 08:11:02 +0000</bug_when>
    <thetext>Moved to https://github.com/w3c/webcomponents/issues/190</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>