New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 635402 link

Starred by 3 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug

Blocking:
issue 594918



Sign in to add a comment

:defined is wonky for elements with valid custom element names in detached? documents

Project Member Reported by dominicc@chromium.org, Aug 8 2016

Issue description

Version: ToT r410302
OS: Ubuntu 14.04

What steps will reproduce the problem?
(1) Run the attached repro.

What is the expected output?

In two documents (the main document and the detached document) without any custom elements registered, I would expect :defined to work the same way.

What do you see instead?

:defined is true for elements with valid custom element names is DOMImplementation-created documents.
 
repro.html
272 bytes View Download
Blocking: 549918

Comment 2 by kojii@chromium.org, Aug 9 2016

Blocking: -549918 594918
Labels: -OS-Linux -OS-Android -OS-Windows -OS-Chrome -OS-Mac OS-All

Comment 3 by kojii@chromium.org, Aug 9 2016

Cc: domenic@chromium.org kojii@chromium.org
Owner: dominicc@chromium.org
This looks like by-design.

create an element:
https://dom.spec.whatwg.org/#concept-create-element
7.2. Set ... custom element state set to "uncustomized"
7.3. If document has a browsing context, ... set result’s custom element state to "undefined".

I don't have strong opinions which is correct, but it might mean ":not(:defined)" matches to upgradable elements, and documents without browsing context is not upgradable.

Do we want to raise to github issue?
Really interesting find.

I think I kind of prefer the spec as-is. But I opened https://github.com/w3c/webcomponents/issues/540 to see if anyone has a preference. I am willing to change it if so (by removing the browsing context requirement for step 7.3, probably).
It seems like people prefer to change the spec, so I prepared https://github.com/whatwg/dom/pull/291 to do so.

Comment 6 by kojii@chromium.org, Aug 15 2016

Cc: davaajav@google.com
Dava found that this also affects custom elements in <template>. We can flip the expected result of the tests when the spec change landed.
Spec change has landed FYI. Thanks for finding this!

Comment 8 by kojii@chromium.org, Aug 17 2016

Cc: dominicc@chromium.org
Owner: kojii@chromium.org

Comment 10 by kojii@chromium.org, Aug 19 2016

Status: Fixed (was: Assigned)

Sign in to add a comment