Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[selectors-4] :defined #2258

Closed
annevk opened this issue Feb 2, 2018 · 7 comments
Closed

[selectors-4] :defined #2258

annevk opened this issue Feb 2, 2018 · 7 comments

Comments

@annevk
Copy link
Member

annevk commented Feb 2, 2018

HTML defines :defined: https://html.spec.whatwg.org/multipage/semantics-other.html#selector-defined.

  1. Is that enough for a definition of a new pseudo-class?
  2. Is it fine for HTML to define this?
  3. Should Selectors contain a registry of externally defined selectors?

(I'm asking this in part since we're considering a :heading(level) pseudo-class.)

See also: WICG/webcomponents#665.

cc @domenic @snuggs

@fantasai
Copy link
Collaborator

fantasai commented Feb 2, 2018

Can I get a layperson's definition of :defined and what it's used for? :)

Wrt :heading(), we've gotten requests for this an declined them so far. If it's something we want to add, we can add it to Selectors--it's definitely not an HTML-specific concept, so it should go into Selectors and not HTML.

@annevk
Copy link
Member Author

annevk commented Feb 3, 2018

:defined matches all elements that had no problem during construction, roughly. It's useful since you can now implement your own element class and sometimes you want to match elements for which the constructor has not yet run (or vice versa).

As for headings, that sounds reasonable, though we'll run into the data model issue again (though arguably we do already for other things, so it doesn't necessarily add to the problem).

@snuggs
Copy link

snuggs commented Mar 15, 2018

To embellish on @annevk's statement with an example.

<style>
  foo-bar { visibility: hidden }
  foo-bar:defined { visibility: show }
</style>

<foo-bar>You can't see me...yet</foo-bar>

If a user wanted to preserve real estate but not display until element is defined.

@annevk does this help or hurt?

@css-meeting-bot
Copy link
Member

css-meeting-bot commented Nov 21, 2018

The CSS Working Group just discussed :defined, and agreed to the following:

  • RESOLVED: Add :defined to selectors L4
The full IRC log of that discussion <dael> Topic: :defined
<dael> github: https://github.com//issues/2258
<dael> fantasai: HTML defines :defined pseudo class in its spec, in general we define in selectors and HTML refines. So should :defined be defined in selectors?
<dael> fantasai: Matches all elements that had no problem during constructions
<dael> Rossen: Any reason why it shouldn't be defined in selectors?
<dael> fantasai: Very HTML specific currently. That's the only reason I can think of
<dael> Rossen: Not crazy about the name, it's a little too generic
<dael> florian: Would fail to match on custom elements not defined properly and any element whose semantics are unknown to browser?
<dael> fantasai: Don't know
<dael> florian: Reading example that seems to be the case. If using on a not known element it won't match.
<dael> florian: Does make it non-HTML specific even if use cases are HTML specific
<dael> florian: Seems like we should do this, but also study more
<dael> fantasai: It's impl afaict
<dael> Rossen: Impl in blink?
<dael> fantasai: Not registering as invalid in test case.
<dael> emilio: Impl in blink, gecko, and webkit
<fantasai> http://software.hixie.ch/utilities/js/live-dom-viewer/?%3C!DOCTYPE%20html%3E%0A%3Cstyle%3E%0Ahtml%3Adefined%2C%20foo%3Adefined%20%7B%20border%3A%20solid%20green%3B%20%7D%0A%3C%2Fstyle%3E%0A%3Cfoo%3EThis%20is%20a%20test%3C%2Ffoo%3E
<tantek> are there tests for this?
<dael> Rossen: If this has impl in various UA and since it's a selector makes sense as part of selectors unless we're against it in the way it's defined. We should accept it and refine
<dael> florian: Sounds good
<dael> Rossen: Other comments or Objections to adding :defined to selectors L4?
<dael> RESOLVED: Add :defined to selectors L4

ewilligers pushed a commit to ewilligers/web-platform-tests that referenced this issue Nov 22, 2018
The :defined pseudo-class must match any element that is defined.
https://html.spec.whatwg.org/multipage/semantics-other.html#selector-defined

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Dec 11, 2018
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184
xeonchen pushed a commit to xeonchen/gecko that referenced this issue Dec 11, 2018
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Dec 11, 2018
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184
mykmelez pushed a commit to mykmelez/gecko that referenced this issue Dec 12, 2018
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184
@snuggs
Copy link

snuggs commented Dec 13, 2018

@annevk @fantasai is this good to close now that is on track with CSS Level4?

@annevk
Copy link
Member Author

annevk commented Dec 13, 2018

I think it would make sense to close this when the PR that adds this to Selectors Level 4 lands.

annevk added a commit to whatwg/html that referenced this issue Jan 23, 2019
Including :defined, which will help with w3c/csswg-drafts#2258.

Fixes #284 (again).
annevk added a commit to whatwg/html that referenced this issue Jan 24, 2019
Including :defined, which will help with w3c/csswg-drafts#2258.

Fixes #284 (again).
mustaqahmed pushed a commit to mustaqahmed/html that referenced this issue Feb 15, 2019
Including :defined, which will help with w3c/csswg-drafts#2258.

Fixes whatwg#284 (again).
mustaqahmed pushed a commit to mustaqahmed/html that referenced this issue Feb 15, 2019
Including :defined, which will help with w3c/csswg-drafts#2258.

Fixes whatwg#284 (again).
isaacdurazo added a commit to bocoup/html that referenced this issue Mar 15, 2019
Since the CSS Working Group has discussed and decided[1] to add the :defined pseudo-class to their spec under Selectors L4 and a pull request has been submitted with this change[2], we can remove it from here.

[1] w3c/csswg-drafts#2258
[2] w3c/csswg-drafts#3735
isaacdurazo added a commit to bocoup/html that referenced this issue Mar 15, 2019
Since the CSS Working Group has discussed and decided[1] to add the :defined pseudo-class to their spec under Selectors L4 and a pull request has been submitted with this change[2], we can remove it from here.

[1] w3c/csswg-drafts#2258
[2] w3c/csswg-drafts#3735
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 4cf05d8ae51e2a9a2c457414329dedd620cfd5fb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 676418ec18fd4c2d15dfb55c304bf2180135ec15
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 4cf05d8ae51e2a9a2c457414329dedd620cfd5fb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-comments-removed that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 676418ec18fd4c2d15dfb55c304bf2180135ec15
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 4cf05d8ae51e2a9a2c457414329dedd620cfd5fb
gecko-dev-updater pushed a commit to marco-c/gecko-dev-wordified-and-comments-removed that referenced this issue Oct 3, 2019
…tonly

Automatic update from web-platform-tests
[selectors] :defined CSS selector

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

The selector is being added to
[CSS Selectors Level 4](https://drafts.csswg.org/selectors/)
w3c/csswg-drafts#2258 (comment)

--
Merge pull request #14184 from ewilligers/defined-selector

[selectors] :defined CSS selector
--

wpt-commits: 92a561a3121a1831214a7b9f47931904ae3df5e7, b107846c443a49e7743185bb84eb43ab628e22dc
wpt-pr: 14184

UltraBlame original commit: 676418ec18fd4c2d15dfb55c304bf2180135ec15
zcorpan pushed a commit to bocoup/html that referenced this issue Oct 24, 2019
Since the CSS Working Group has discussed and decided[1] to add the :defined pseudo-class to their spec under Selectors L4 and a pull request has been submitted with this change[2], we can remove it from here.

[1] w3c/csswg-drafts#2258
[2] w3c/csswg-drafts#3735
@hober
Copy link
Member

hober commented Apr 21, 2021

I think it would make sense to close this when the PR that adds this to Selectors Level 4 lands.

As #3735 landed a while ago, can we close this issue now?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants