[csswg-drafts] [selectors-4] circular references in section 3.1

therealglazou has just created a new issue for https://github.com/w3c/csswg-drafts:

== [selectors-4] circular references in section 3.1 ==
I see a few issues in that section.

Issue 1:
--------

> The subject of a selector is the element(s) that selector is defined to be about:
>
> ...
>     For a complex selector, it is any element that matches the last compound selector in the selector.
> 

The above is wrong: it says the element "matches" the last compound
selector. Which means "only". A more correct prose would say it matches
the last compound selector while its context matches the other compound
selector in the complex selector AND the relationships expressed by the
combinators...

Issue 2:
--------

  The definition of "subject of selector" relies on a mix of
  "represented" and "matches". I think it's wrong because below "match"
  is itself defined in reference to "subject"... We then have an
  circular ref there.

Proposal:
---------

I think we have too many circular definitions right now in that section
3.1. Here's a different proposal:

>   The term selector can refer to a simple selector, compound selector,
>   complex selector, or selector list.
> 
>   A simple selector is a single condition on an element. (...) A given
>   element is said to match a simple selector when it makes the
>   corresponding condition true.
> 
>   A compound selector is a sequence of simple selectors that are not
>   separated by a combinator. It represents a set of simultaneous
>   conditions on a single element. (...) A given element is said to
>   match a compound selector when it matches all simple selectors
>   in the compound selector.
> 
>   A combinator is a condition of relationship between two elements
>   represented by the compound selectors on either side of the
>   combinator. (...) Two given elements are said to match a combinator
>   when the condition of relationship between these elements is true.
> 
>   A complex selector is a sequence of one or more compound selectors
>   separated by combinators. It represents a set of simultaneous
>   conditions on a list of elements in particular relationships. (...)
>   A given element is said to match a complex selector when it exists
>   a list of elements individually matching each corresponding compound
>   selector in the complex selector, each pair of consecutive elements in
>   that list matches the combinator separating the two corresponding
>   compound selectors, and the last element in that list is the given
>   element.
> 
>   A list of simple/compound/(...)
> 
>   For simple, compound or complex selectors, the subject of that
>   selector is any element matching that selector. For a selector
>   list, the subject of that selector list is any element matching any
>   selector in the list.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/2240 using your GitHub account

Received on Tuesday, 30 January 2018 05:21:38 UTC