<?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>20653</bug_id>
          
          <creation_ts>2013-01-12 00:26:08 +0000</creation_ts>
          <short_desc>need a way for Web Components to cause new interface objects to exist dynamically</short_desc>
          <delta_ts>2016-06-02 20:52:31 +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>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>20493</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dimitri Glazkov">dglazkov</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>allen</cc>
    
    <cc>bzbarsky</cc>
    
    <cc>d</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>81289</commentid>
    <comment_count>0</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-01-12 00:26:08 +0000</bug_when>
    <thetext>ES5 says all function objects need to have it:

http://ecma-international.org/ecma-262/5.1/#sec-13.2

We should too, right? http://www.w3.org/TR/WebIDL/#dfn-function-object</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81290</commentid>
    <comment_count>1</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-01-12 00:36:55 +0000</bug_when>
    <thetext>Yes, although most uses of &quot;function object&quot; in the spec define a prototype (and length) property for them, at least the one mentioned in http://dev.w3.org/2006/webapi/WebIDL/#es-environment does not.  Also, the note in http://dev.w3.org/2006/webapi/WebIDL/#interface-object assumes that by linking to #dfn-function-object it means that it will already be required to have &quot;prototype&quot; property, which isn&apos;t true.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81292</commentid>
    <comment_count>2</comment_count>
    <who name="Allen Wirfs-Brock">allen</who>
    <bug_when>2013-01-12 01:04:00 +0000</bug_when>
    <thetext>But note that even in ES5, built-in functions don&apos;t have a prototype property and are not usable as constructors (they do not have a [[Construct]] internal method).  

In ES6, functions syntactically defined as methods (concise methods in object literals and class definitions) also will not have a prototype property and are not usable as constructors. 

I think it would be fine for WebIDL to treat all method like functions in the same manner as ES6 concise methods.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81294</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-01-12 01:10:54 +0000</bug_when>
    <thetext>That is interesting to know.  Once we recast Web IDL&apos;s ES requirements in terms of ES6, we should look at which functions don&apos;t need to be constructable like this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81295</commentid>
    <comment_count>4</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-12 01:12:42 +0000</bug_when>
    <thetext>Indeed.  And there are certainly plenty of prototype-less Functions around right now in WebIDL too:

[20:09:43.043] Object.getOwnPropertyDescriptor(Array.prototype.push, &quot;prototype&quot;)
[20:09:43.045] undefined
--
[20:09:52.795] Object.getOwnPropertyDescriptor(document.getElementById, &quot;prototype&quot;)
[20:09:52.797] undefined

compared to:

[20:11:44.744] Object.getOwnPropertyDescriptor(EventTarget, &quot;prototype&quot;)
[20:11:44.747] ({configurable:false, enumerable:false, value:{addEventListener:function addEventListener() {
    [native code]
}, removeEventListener:function removeEventListener() {
    [native code]
}, dispatchEvent:function dispatchEvent() {
    [native code]
}}, writable:false})

What we sorta want is a place defining interface objects that Web Components can link to....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81296</commentid>
    <comment_count>5</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-01-12 01:14:04 +0000</bug_when>
    <thetext>But yes, the note that claims that being a function object implies having a .prototype property in #interface-object doesn&apos;t make that much sense to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91601</commentid>
    <comment_count>6</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-08-04 06:59:20 +0000</bug_when>
    <thetext>OK, so it looks like there aren&apos;t any cases in the spec where we&apos;re defining a “prototype” property where we shouldn&apos;t be.

(In reply to comment #4)
&gt; What we sorta want is a place defining interface objects that Web Components
&gt; can link to....

Got a link to the Web Components spec where this is needed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91648</commentid>
    <comment_count>7</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2013-08-05 15:53:40 +0000</bug_when>
    <thetext>(In reply to comment #6)

&gt; Got a link to the Web Components spec where this is needed?

Here&apos;s the spec:

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html

Here&apos;s the place where we generate a constructor:

https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/custom/index.html#dfn-custom-element-constructor-generation</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>126665</commentid>
    <comment_count>8</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2016-06-02 20:52:31 +0000</bug_when>
    <thetext>Custom elements seems to have solved this without any Web IDL changes.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>