-
Notifications
You must be signed in to change notification settings - Fork 24
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
CSS selector
may be an inappropriate data type
#1137
Comments
Thanks for the feedback. Always good to try to "make sense" of the data that gets extracted ;)
Right, combinators are components of a selector, not selectors per se.
That may be something worth bringing to the CSS working group. I understand it as suggesting that the |
It is problematic when parsing against a CSS syntax derived from this data, indeed. Pseudo-class and pseudo-element selectors are defined with this syntax (simplified, for brevity):
I forgot to mention that, yes. Similarly, I guess I also have not touched on qualified rules (only at-rules are extracted), which have no corresponding type in Bikeshed. Selectors are closely (and almost only) related to style rules (which are qualified rules). MDN could gather selectors by collecting Anyway, these are just thoughts for now. I will follow discussions on pseudo-element combinators and I will create a dedicated issue on |
Here are some interesting related facts.
matches links to:
Selectors seems to define element selectors whereas CSS Paged Media defines page selectors. |
Since v11, Reffy extracts CSS selector definitions in
selector
at the root level. I was not sure about where and how to report the following problems regarding this data type. Please consider this issue as a feed back to open discussions on future versions of Reffy, not as an actual bug report.Selectors defines selector as a term that can refer to a simple selector, compound selector, complex selector, or selector list, and defines their basic syntax. All selectors extracted by Reffy actually are pseudo-classes and pseudo-elements, except
&
(which can replace any selector) and>
,+
,~
,||
, which match<combinator>
, and do not match the above definition of a selector, therefore I think these combinators should not be defined withdata-dfn-type="selector"
in Selectors.I think these pseudo-classes and pseudo-elements should probably be defined as
value
in the specs, without the leading:
or::
, eventually namespaced to<pseudo-class-selector>
or<pseudo-element-selector>
.Semantically, pseudo-elements are not considered part of a compound selector (see this section in Selectors). For example,
div::after
can be "interpreted" asdiv :: after
, ie. it selects the pseudo-element namedafter
, combined withdiv
.after
is nested in the pseudo tree ofdiv
. Similarly,div > span
selectsspan
directly nested in the element tree ofdiv
.There are discussions about leaving
::
as legacy and to define a new combinator to traverse a pseudo tree.<pseudo-element-selector>
matching::
followed by a pseudo-element name would also become legacy.The text was updated successfully, but these errors were encountered: