:defined is wonky for elements with valid custom element names in detached? documents |
|||||
Issue descriptionVersion: 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.
,
Aug 9 2016
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?
,
Aug 10 2016
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).
,
Aug 12 2016
It seems like people prefer to change the spec, so I prepared https://github.com/whatwg/dom/pull/291 to do so.
,
Aug 15 2016
Dava found that this also affects custom elements in <template>. We can flip the expected result of the tests when the spec change landed.
,
Aug 15 2016
Spec change has landed FYI. Thanks for finding this!
,
Aug 17 2016
,
Aug 19 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2a60d7660f68e0bae04400346c28604b144f9016 commit 2a60d7660f68e0bae04400346c28604b144f9016 Author: kojii <kojii@chromium.org> Date: Thu Aug 18 23:56:51 2016 Change custom element state in documents without browsing context The spec was changed to set the custom element state to "undefined" even if the document does not have browsing context[1]. [1] https://github.com/whatwg/dom/pull/291 BUG= 635402 Review-Url: https://codereview.chromium.org/2252003002 Cr-Commit-Position: refs/heads/master@{#412975} [modify] https://crrev.com/2a60d7660f68e0bae04400346c28604b144f9016/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.html [modify] https://crrev.com/2a60d7660f68e0bae04400346c28604b144f9016/third_party/WebKit/LayoutTests/custom-elements/spec/selectors/pseudo-class-defined.html [modify] https://crrev.com/2a60d7660f68e0bae04400346c28604b144f9016/third_party/WebKit/Source/core/dom/custom/CustomElement.cpp
,
Aug 19 2016
|
|||||
►
Sign in to add a comment |
|||||
Comment 1 by dominicc@chromium.org
, Aug 8 2016