New issue
Advanced search Search tips

Issue 701550 link

Starred by 1 user

Issue metadata

Status: Duplicate
Merged: issue 660758
Owner: ----
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 673698



Sign in to add a comment

Document#createElement[NS] argument options should be ElementCreationOptions

Project Member Reported by lunalu@chromium.org, Mar 14 2017

Issue description

According to the spec, we should remove these APIs in the idl file:
[NewObject, DoNotTestNewObject, CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName);
[NewObject, DoNotTestNewObject, CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);

And modify createElement[NS] APIs to:
[NewObject, CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, ElementCreationOptions options);
[NewObject, CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespace, DOMString qualifiedName, optional ElementCreationOptions options);

In addition, we should get rid of CreateElementFlags and use ElementCreationOptions instead in the C++ implementation
 

Comment 1 by lunalu@chromium.org, Mar 15 2017

Description: Show this description

Comment 2 by lunalu@chromium.org, Mar 15 2017

Owner: kojii@chromium.org

Comment 3 by kojii@chromium.org, Mar 16 2017

Owner: ----
Clearing the owner for the DOM team to triage and assign as appropriate.

Comment 4 by tkent@chromium.org, Mar 24 2017

Components: Blink>HTML>CustomElements
Summary: Document#createElement[NS] argument options should be ElementCreationOptions (was: Document#createElement[NS] argument options should be optional)
lunalu@, do you mean removing

    // https://w3c.github.io/webcomponents/spec/custom/#extensions-to-document-interface-to-instantiate
    // FIXME: The typeExtension arguments should not be nullable.
    [CustomElementCallbacks, PerWorldBindings, RaisesException] Element createElement(DOMString localName, (DOMString or Dictionary)? options);
    [CustomElementCallbacks, RaisesException] Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName, (DOMString or Dictionary)? options);

?

Comment 5 by lunalu@chromium.org, Mar 24 2017

tkent, no, I meant to remove (https://cs.chromium.org/chromium/src/third_party/WebKit/Source/core/dom/Document.idl?rcl=62349ad779505d73be7c1dbd3db83dc9a38dc99f&l=58):
Element createElement(DOMString localName);
Element createElementNS(DOMString? namespaceURI, DOMString qualifiedName);

I don't quite understand why in our Document.idl we have 2 definitions for createElement and createElementNS. Although I suspect functionally keeping 2 definitions is equivalent to the 1 defintion in the spec, we should probably make the argument |options| optional instead of nullable and only keep 1 definition for each method (to match the spec)?


Comment 6 by tkent@chromium.org, Apr 7 2017

Status: Available (was: Untriaged)
Components: -Blink>DOM

Comment 8 by tkent@chromium.org, Jan 24 2018

Mergedinto: 660758
Status: Duplicate (was: Available)

Sign in to add a comment