-
Notifications
You must be signed in to change notification settings - Fork 375
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
Which standard defines :defined #665
Comments
What? HTML defines :defined, in the section you linked to:
This is the same as how it defines most pseudo-classes, in that same section. |
That section only defines when those pseudo-classes match HTML elements. The actual pseudo-classes themselves are defined by Selectors and UI Events. (It's not always entirely clear to me what purpose that distinction serves, but it's there.) |
Can we just not have that distinction, for :defined? I think that's what I was assuming. I guess that's where we need CSS experts like @tabatkins. |
Maybe, but then we should probably say something more in that section, that it also defines some pseudo-classes rather than just define when they match. |
The purpose of the distinction is that the CSSWG typically defines the actual CSS thing, and when necessary, the host language fills in whatever language-specific details are required. This distinction isn't theoretical wankery; SVG and HTML define things separately sometimes (or at least did in the past). But there's nothing theoretically wrong with another spec defining a pseudo-class, so long as it has enough visibility for the correct implementors to know about it. |
@annevk @domenic @tabatkins thanks for the clarity. Out of curiosity how does this impact us with the https://dom.spec.whatwg.org/#dom-element-matches
Typically UI Events cover canonical pseudo selectors (i.e. |
@tabatkins SVG and HTML aren't really separate languages/hosts though. They can be intertwined. I think it only works if there's a completely separate runtime of sorts that also happened to use Selectors, which I realize may be the case and I don't really object to the distinction per se (although I think in some areas it has caused a bunch of trouble due to the abstraction not being perfect). So the CSS WG doesn't object to HTML defining new pseudo-classes? And how HTML decides to name them? That used to be much more controversial at least. |
Of course, but they are allowed to give different definitions to how/when particular pseudo-classes match.
As I said, "so long as it has enough visibility for the correct implementors to know about it". In practice, the "correct implementors" are CSSWG members. So other specs can be the home for a particular pseudo-class’s definition, but the act of defining it still generally has to make at least a cursory pass thru the CSSWG. |
I don't really understand the next steps here, nor do I understand what is confusing about the status quo, so I am unassigning myself. If someone wants to pick this up I'll happily review patches. |
Basically: it's fine for HTML to define |
FYI - @jyasskin taught me https://drafts.csswg.org/indexes/#selectors has the list of pointers to where each pseudo selector is defined (a caveat that the list can fall out of date sometimes). |
It's exactly as up-to-date as the Bikeshed database is, module some delay in running the spider and regenning the CSSWG specs. |
So as long as the list above is the most reliable source of the complete list, everyone is happy? |
Yeah we can close this I suppose. I'll leave the upstream issue open since that still feels unresolved. |
HTML suggests https://html.spec.whatwg.org/#pseudo-classes are all defined in Selectors and CSS UI, but that doesn't appear to be the case for
:defined
.cc @snuggs
The text was updated successfully, but these errors were encountered: