Skip to content

Commit

Permalink
custom-elements: document.createElementNS() should set prefixes to cu…
Browse files Browse the repository at this point in the history
…stom elements.

We had a bug that createElementNS() ignored prefixes.
New behavior matches to the specification and Firefox.

* Document-createElementNS.html:
  Fix a copypasta error.

* ScriptCustomElementDefinition::CreateElementSync:
  Implement Step 6.1.10.

* Document::createElementNS:
  Fix an argument of definition lookup.

* CustomElement::CreateUndefinedElement:
  Use Document::CreateRawElement(), which sets prefixes correctly,
  instead of HTMLElementFactory::createHTMLElement().

* ustomElementDefinition::CreateElementAsync:
  Use Document::CreateRawElement(), which sets prefixes correctly,
  instead of HTMLElementFactory::createRawHTMLElement().

Bug: 806639
Change-Id: I74b431d4475d7cf84f65ab0ff1b24773cbc64079
Reviewed-on: https://chromium-review.googlesource.com/892802
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#532821}
  • Loading branch information
tkent-google authored and chromium-wpt-export-bot committed Jan 30, 2018
1 parent 19098db commit b22a445
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion custom-elements/Document-createElementNS.html
Expand Up @@ -28,7 +28,7 @@

customElements.define('my-builtin', MyBuiltinElement, { extends: 'address' });
let element = document.createElementNS('http://www.w3.org/1999/xhtml', 'p:address', { is: 'my-builtin'});
assert_true(element instanceof MyElement);
assert_true(element instanceof MyBuiltinElement);
assert_equals(element.prefix, 'p');
}, 'builtin: document.createElementNS should create custom elements with prefixes.');

Expand Down

0 comments on commit b22a445

Please sign in to comment.