2

I'm trying to create a small CSS web course and wanted some clarification before I proceeded with how I define combinators to students watching.

I've noticed a difference with W3C and MDN in combinator definition though.

The W3C website and CSS spec saying that the Multiple Selector is not part of combinators while MDN says that it is grouped as a combinator.

MDN: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors

I know that MDN follows WHATWG but where is there CSS spec for combinators in it? I have been looking around 4.16 for a mention of combinators but couldn't find any.

4.16 - https://html.spec.whatwg.org/multipage/semantics-other.html#selectors

Is the WHATWG as complete as W3C or is it only an add-on to the lacking parts of W3C's spec? Am I suppose to just refer to MDN if it's not there?

Related Update:

If anyone has wiki editing powers for MDN hoping you can change the <h2> heading name since it may represent the table to only include combinators.

From 'Combinators' to 'Combinators & Multiple Selectors'

Link-with-bad-hash-name: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors#Combinators

Jonathan002
  • 9,639
  • 8
  • 37
  • 58

1 Answers1

5

The WHATWG isn't responsible for any CSS specs. The CSS Working Group is a W3C Working Group. The only CSS specs you'll find are all in w3.org, including Selectors. Other specs may define their own selectors (for example, the :defined pseudo-class appears in the HTML spec), but the selector syntax, and how selectors work in general, is defined by Selectors.

In any case, the Selectors spec is right: there is no such thing as a "multiple selector". That's just a term made up by jQuery as if it were a selector itself, but it's not, it's just a notation used to separate multiple selectors. It's not a "selector" itself, let alone one called a "multiple selector", or a combinator despite what jQuery and MDN claim. The Selectors spec has a very clear and very precise definition of "combinator", one that there's no way the comma could ever fit in, instead living in its own section entirely.

See also: Correct terms and words for sections and parts of selectors

BoltClock
  • 700,868
  • 160
  • 1,392
  • 1,356
  • 1
    So is MDN wrong to include it in their table when listing out what classifies as a combinator? – Jonathan002 Feb 16 '18 at 18:10
  • 2
    Luckily, MDN is also wiki editable. I have adjusted the wiki page to be a mite more clear. – TylerH Feb 16 '18 at 18:19
  • @TylerH: I wish I could convert all my pent-up disillusionment with MDN into effort editing the thing. *If only they would just let me.* – BoltClock Feb 16 '18 at 18:23
  • @TylerH: Thanks, are your changes effective in real time? I'm trying to look for it on the page, it still shows the table with it – Jonathan002 Feb 16 '18 at 18:23
  • I don't think MDN was wrong per se. MDN and W3C have different target audiences. The rest of that MDN page accurately describes the difference. The table at the top mentions it to make it an easy reference rather than just technically correct. @Jonathan002 TylerH's changes are pretty subtle: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors$compare?locale=en-US&to=1359631&from=1347781 – mercator Feb 16 '18 at 18:33
  • @mercator: Thanks for showing me the changes. : ) Although I think even if the top part refers to combinators and multiple selectors on the page, the `

    ` should be at least changed from 'Combinators' to 'Combinators & Multiple Selectors' since it makes it seem like the table below is only going to present combinators. Link with bad-hash-name: https://developer.mozilla.org/en-US/docs/Learn/CSS/Introduction_to_CSS/Combinators_and_multiple_selectors#Combinators

    – Jonathan002 Feb 16 '18 at 18:38
  • 1
    @mercator: That's not an excuse to use terminology incorrectly. I don't for a second believe making something easier to understand requires misinforming the reader by twisting known facts into blatantly incorrect information. I've never, ever had to do that in any of my answers on this site (and [I've answered a **ton** of Selectors questions](https://stackoverflow.com/search?q=user:106224+%5Bcss-selectors%5D), let alone CSS). What makes this even more absurd is the fact that the paragraph just before the table is a near-direct quote from the spec which contradicts the meaning of the comma! – BoltClock Feb 16 '18 at 18:46
  • @Jonathan002 Yes, they are real time, but like mercator said my change was pretty subtle; I just added an "s" on the end! – TylerH Feb 16 '18 at 18:49
  • @BoltClock They will let you now if you just login with your GitHub account which you just recently made... – TylerH Feb 16 '18 at 22:03
  • @BoltClock if you put one jillionth the effort into building out mdn that you do here, webdev would be better off for it. not saying its perfect or even that i disagree with you, but certainly think it is the ideal space for us to have what we need. like here. – albert Feb 17 '18 at 17:37
  • 2
    @albert: Yeah, I might as well. I'll see what I can do. – BoltClock Feb 17 '18 at 17:43
  • @BoltClock marvelous! i felt very similar to that about wikipedia awhile back. starting getting more into openness and community....etc. while i'm not going to author anything helpful, will fix linkrot/grammar/etc., while i'm there. actually being on here is where i got most of the ethos from. anyways, every bit helps. thanks homie. – albert Feb 17 '18 at 18:01