[Bug 25139] New: [Custom]: Bogus createElement/createElementNS IDL

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

            Bug ID: 25139
           Summary: [Custom]: Bogus createElement/createElementNS IDL
           Product: WebAppsWG
           Version: unspecified
          Hardware: PC
                OS: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Component Model
          Assignee: dglazkov@chromium.org
          Reporter: bzbarsky@mit.edu
        QA Contact: public-webapps-bugzilla@w3.org
                CC: mike@w3.org, mrbkap@gmail.com, public-webapps@w3.org,
                    wchen@mozilla.com
            Blocks: 14968

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 "optional", which is key); I'm sorry that we didn't provide
feedback on this when we implemented something different from the spec.

That said Blink's IDL here is:

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

which also has a non-optional typeExtension....

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Received on Monday, 24 March 2014 16:56:49 UTC