createElementNS() ignores namespace for custom element processing |
||
Issue description
Chrome Version: ToT
OS: All but iOS
What steps will reproduce the problem?
(1) Open the following URL:
data:text/html;charset=utf-8,<body><script> class PlasticDiv extends HTMLDivElement {} customElements.define('plastic-div', PlasticDiv, { extends: 'div' }); var pdiv = document.createElementNS('urn:foo', 'div', {is:'plastic-div'}); alert(pdiv instanceof PlasticDiv);</script>
What is the expected result?
An alert dialog with "false" is opened.
What happens instead?
An alert dialog with "true" is opened.
With DCHECK-enabled build, a check failure happens:
[24870:775:0129/155402.421440:FATAL:CustomElement.cpp(122)] Check failed: ShouldCreateCustomElement(tag_name) || ShouldCreateCustomizedBuiltinElement(tag_name).
0 libbase.dylib 0x00000001050f319e base::debug::StackTrace::StackTrace(unsigned long) + 174
1 libbase.dylib 0x00000001050f325d base::debug::StackTrace::StackTrace(unsigned long) + 29
2 libbase.dylib 0x00000001050f16dc base::debug::StackTrace::StackTrace() + 28
3 libbase.dylib 0x000000010518a8ff logging::LogMessage::~LogMessage() + 479
4 libbase.dylib 0x0000000105188635 logging::LogMessage::~LogMessage() + 21
5 libblink_core.dylib 0x0000000120fd0563 blink::CustomElement::CreateCustomElementSync(blink::Document&, blink::QualifiedName const&, blink::CustomElementDefinition*) + 211
6 libblink_core.dylib 0x000000012071c45f blink::Document::createElementNS(WTF::AtomicString const&, WTF::AtomicString const&, blink::StringOrDictionary const&, blink::ExceptionState&) + 959
Firefox works correctly.
,
Jan 30 2018
This issue doesn't happen with autonomous custom elements.
,
Jan 30 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/968b4a0fd847a365d51a80c502791674b974d06a commit 968b4a0fd847a365d51a80c502791674b974d06a Author: Kent Tamura <tkent@chromium.org> Date: Tue Jan 30 05:55:43 2018 custom-elements: document.createElementNS() should check namespace URIs. Custom Element V1 supports only XHTML namespace, and Document::createElemenNS() ignored specified namespace URI. - Reject namespace URIs other than XHTML's one on finding 'definition'. - Check existence of 'definition' instead of names on choosing appropriate element factory. The new behavior matches to Firefox and the specification. Bug: 806665 Change-Id: I458685eeb48019be9da086b3b2a8703deac655c6 Reviewed-on: https://chromium-review.googlesource.com/892541 Reviewed-by: Yoshifumi Inoue <yosin@chromium.org> Commit-Queue: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/master@{#532782} [add] https://crrev.com/968b4a0fd847a365d51a80c502791674b974d06a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/Document-createElementNS-expected.txt [add] https://crrev.com/968b4a0fd847a365d51a80c502791674b974d06a/third_party/WebKit/LayoutTests/external/wpt/custom-elements/Document-createElementNS.html [modify] https://crrev.com/968b4a0fd847a365d51a80c502791674b974d06a/third_party/WebKit/Source/core/dom/Document.cpp
,
Jan 30 2018
|
||
►
Sign in to add a comment |
||
Comment 1 by tkent@chromium.org
, Jan 30 2018Status: Started (was: Available)