<?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>25139</bug_id>
          
          <creation_ts>2014-03-24 16:56:47 +0000</creation_ts>
          <short_desc>[Custom]: Bogus createElement/createElementNS IDL</short_desc>
          <delta_ts>2014-05-09 19:44: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>14968</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Boris Zbarsky">bzbarsky</reporter>
          <assigned_to name="Dimitri Glazkov">dglazkov</assigned_to>
          <cc>mike</cc>
    
    <cc>mrbkap</cc>
    
    <cc>public-webapps</cc>
    
    <cc>wchen</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>102838</commentid>
    <comment_count>0</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-03-24 16:56:47 +0000</bug_when>
    <thetext>http://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate says:

  partial interface Document {
    Element createElement(DOMString localName, optional DOMString typeExtension);
    Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional DOMString typeExtension);
  };

This will fail in a conformant WebIDL implementation, because for example it creates two overloads of createElement:

  [NewObject] Element createElement(DOMString localName);
  Element createElement(DOMString localName, optional DOMString typeExtension);

but WebIDL says:

  If there is more than one entry in an effective overload set that has a given
  type list length, then for those entries there MUST be an index i such that for
  each pair of entries the types at index i are distinguishable.

and in this case the overload set for type list length == 1 has two entries which are identical.

In practice, Gecko instead has this IDL:

 partial interface Document {
   [NewObject]
   Element createElement(DOMString localName, DOMString typeExtension);
   [NewObject]
   Element createElementNS(DOMString? namespace, DOMString qualifiedName, DOMString typeExtension);
 };

(note lack of &quot;optional&quot;, which is key); I&apos;m sorry that we didn&apos;t provide feedback on this when we implemented something different from the spec.

That said Blink&apos;s IDL here is:

    [CustomElementCallbacks, PerWorldBindings, ActivityLogging=ForIsolatedWorlds, RaisesException] Element createElement(DOMString localName, [TreatNullAs=NullString] DOMString typeExtension);

which also has a non-optional typeExtension....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105479</commentid>
    <comment_count>1</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-05-08 20:42:49 +0000</bug_when>
    <thetext>Make sense. I was originally just monkeypatching createElement, but then turned it into partial, if I recall this correctly.

https://github.com/w3c/webcomponents/pull/10 PTAL?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105565</commentid>
    <comment_count>2</comment_count>
    <who name="Dimitri Glazkov">dglazkov</who>
    <bug_when>2014-05-09 19:44:12 +0000</bug_when>
    <thetext>https://github.com/w3c/webcomponents/commit/b282d45f9aa96ac9f19ea2ceacad2966b7ea45f6</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>