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

Issue 736967 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , Chrome , Mac
Pri: 2
Type: Bug

Blocking:
issue 648828
issue 808311



Sign in to add a comment

The :defined selector matches for undefined customized built-in elements

Project Member Reported by dominicc@chromium.org, Jun 27 2017

Issue description

Chrome Version       : ToT r482199 w/ --enable-blink-features=CustomElementsBuiltin
URLs (if applicable) : http://jsbin.com/vanunonoce/edit?html,output

What is the expected result?

The <div is="my-div"> should match the :not(:defined) selector and have a green dashed border.

What happens instead of that?

It doesn't match the selector.

Here's the spec:

https://html.spec.whatwg.org/#selector-defined says: "The :defined pseudo-class must match any element that is defined."

https://dom.spec.whatwg.org/#concept-create-element says:

5. If definition is non-null, and definition’s name is not equal to its local name ...
5.2 Set .. custom element state set to "undefined" 
 
Blocking: 648828

Comment 2 by kochi@chromium.org, Oct 16 2017

Components: Blink>CSS
Owner: ----
Can this be triaged by CSS people?
Labels: -Type-Bug Type-Feature
Status: Untriaged (was: Unconfirmed)
I don't think this is implemented in Blink yet. It doesn't work in Firefox 56 either.
Labels: -Pri-2 Pri-3
Status: Available (was: Untriaged)
Labels: Update-Quarterly
Labels: -Update-Quarterly

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

Components: -Blink>CSS
Labels: -Type-Feature -Pri-3 Pri-2 Type-Bug
Actually, :defined was already implemented.

In blink::HTMLConstructionSite code path, it seems we don't implement step 7.3 of https://dom.spec.whatwg.org/#concept-create-element .

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

Blocking: 808311
Owner: tkent@chromium.org
Status: Started (was: Available)
Project Member

Comment 9 by bugdroid1@chromium.org, Feb 6 2018

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

commit 932a24c73fb4cfd4f80ba94ea729ebfcddcb0dc9
Author: Kent Tamura <tkent@chromium.org>
Date: Tue Feb 06 04:23:07 2018

custom-elements: Fix a bug that HTML parser didn't set custom element state correctly for unknown "is" attribute value.

In HTML parser, if custom element definition is not found and the
element local name is invalid for custom element name, custom element
state of the element was set to "Uncustomized", which won't be upgraded.

It should be "Undefined" if "is" attribute exists.

Also, CustomElementRegistry::AddCandidate() didn't pick up a correct
name for customized built-in candidates.

A Blink layout test for :defined is upstreamed to WPT.

Bug:  736967 
Change-Id: I583073eabc4ac276c6990161516c7b289905909b
Reviewed-on: https://chromium-review.googlesource.com/903423
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Commit-Queue: Kent Tamura <tkent@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534621}
[rename] https://crrev.com/932a24c73fb4cfd4f80ba94ea729ebfcddcb0dc9/third_party/WebKit/LayoutTests/external/wpt/custom-elements/pseudo-class-defined.html
[modify] https://crrev.com/932a24c73fb4cfd4f80ba94ea729ebfcddcb0dc9/third_party/WebKit/Source/core/html/custom/CustomElementRegistry.cpp
[modify] https://crrev.com/932a24c73fb4cfd4f80ba94ea729ebfcddcb0dc9/third_party/WebKit/Source/core/html/parser/HTMLConstructionSite.cpp

Status: Fixed (was: Started)

Sign in to add a comment