Skip to content

Commit

Permalink
[selectors-4] Note that adherence to grammar is insufficient for vali…
Browse files Browse the repository at this point in the history
…dity.
  • Loading branch information
fantasai committed Jan 1, 2018
1 parent 8d2e99a commit e60e220
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions selectors-4/Overview.bs
Expand Up @@ -3292,7 +3292,7 @@ Grammar</h2>
<dfn>&lt;pseudo-element-selector></dfn> = ':' <<pseudo-class-selector>>
</pre>

In addition to the above grammar,
In interpreting the above grammar,
the following rules apply:

* White space is forbidden between tokens except:
Expand All @@ -3307,6 +3307,11 @@ Grammar</h2>
with only a single ":" character at their start.
* In <<id-selector>>, the <<hash-token>>’s value must be an <a>identifier</a>.

Note: A selector is also subject to a variety of more specific syntactic constraints,
and adherence to the grammar above is necessary <em>but not sufficient</em>
for the selector to be considered valid.
See [[#invalid]] for additional rules for parsing selectors.

Note: The grammar above states that a combinator is optional
between two <<compound-selector>>s in a <<complex-selector>>.
This is only for grammatical purposes,
Expand All @@ -3319,15 +3324,13 @@ Grammar</h2>
if placed at the end of the last <<compound-selector>>
in a <<complex-selector>>.
In some circumstances, however,
it can be followed by more <<pseudo-element-selector>>s or <<pseudo-class-selector>>s
in the same <<compound-selector>>,
it can be followed by more <<pseudo-element-selector>>s or <<pseudo-class-selector>>s;
but these are specified on a case-by-case basis.
(For example, the <a>user action pseudo-classes</a> are allowed after any <a>pseudo-element</a>,
and the <a>tree-abiding pseudo-elements</a>
are allowed after the ''::slotted()'' pseudo-element)



<h2 id='api-hooks'>
API Hooks</h2>

Expand Down

0 comments on commit e60e220

Please sign in to comment.