New issue
Advanced search Search tips

Issue 809887 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 1
Type: Bug-Regression



Sign in to add a comment

document.createElement() with undefined autonomous custom element name sometimes creates HTMLUnknownElement

Project Member Reported by tkent@chromium.org, Feb 7 2018

Issue description

Chrome Version: 66 canary
OS: All but iOS

What steps will reproduce the problem?
(1) Open DevTools console, and type the following:
  (new Document()).createElementNS("http://www.w3.org/1999/xhtml", "x-foo",
 {}).constructor.name

What is the expected result?
Show "HTMLElement"

What happens instead?
Show "HTMLUnknownElement"

Please use labels and text to provide additional information.
Google Chrome 64 works correctly. This is a recent regression, probably made by me!

https://html.spec.whatwg.org/multipage/dom.html#elements-in-the-dom:element-interface


 

Comment 1 by tkent@chromium.org, Feb 7 2018

- This doesn't happen if we use window.document instead of (new Document())
- This doesn't happen if we remove the third argument {}

Comment 2 by tkent@chromium.org, Feb 8 2018

Status: Started (was: Assigned)
Project Member

Comment 3 by bugdroid1@chromium.org, Feb 8 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/021c2a9786554cc2c7f8bbcaa7cbe52e995e462f

commit 021c2a9786554cc2c7f8bbcaa7cbe52e995e462f
Author: Kent Tamura <tkent@chromium.org>
Date: Thu Feb 08 04:32:51 2018

custom-elements: document.createElementNS should not create HTMLUnknownElement for a valid custom element name

Document::CreatRawElement() should check CustomElement::IsValidName().
It failed only if the Document didn't have V0 RegistrationContext.

Bug:  809887 
Change-Id: I4e5d283658673db3e1db15b136ca5729d29e2442
Reviewed-on: https://chromium-review.googlesource.com/908128
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#535299}
[modify] https://crrev.com/021c2a9786554cc2c7f8bbcaa7cbe52e995e462f/third_party/WebKit/LayoutTests/external/wpt/custom-elements/Document-createElementNS.html
[modify] https://crrev.com/021c2a9786554cc2c7f8bbcaa7cbe52e995e462f/third_party/WebKit/Source/core/dom/Document.cpp

Comment 4 by tkent@chromium.org, Feb 8 2018

Status: Fixed (was: Started)

Sign in to add a comment