|
27 | 27 | * <selector-list> = <complex-selector-list> |
28 | 28 | * <complex-selector-list> = <complex-selector># |
29 | 29 | * <compound-selector-list> = <compound-selector># |
30 | | - * <complex-selector> = <compound-selector> [ <combinator>? <compound-selector> ]* |
| 30 | + * <complex-selector> = [ <type-selector> <combinator>? ]* <compound-selector> |
31 | 31 | * <compound-selector> = [ <type-selector>? <subclass-selector>* ]! |
32 | | - * <combinator> = '>' | '+' | '~' | [ '|' '|' ] |
| 32 | + * <combinator> = '>' | [ '|' '|' ] |
33 | 33 | * <type-selector> = <ident-token> | '*' |
34 | 34 | * <subclass-selector> = <id-selector> | <class-selector> | <attribute-selector> |
35 | 35 | * <id-selector> = <hash-token> |
|
47 | 47 | * - ID selectors (e.g. `#unique-id`) |
48 | 48 | * - Attribute selectors (e.g. `[attribute-name]` or `[attribute-name="value"]`) |
49 | 49 | * - Comma-separated selector lists (e.g. `.selector-1, .selector-2`) |
50 | | - * - The following combinators: |
51 | | - * - descendant (e.g. `.parent .descendant`) |
52 | | - * - child (`.parent > .child`) |
| 50 | + * - The following combinators. Only type (element) selectors are allowed in non-final position: |
| 51 | + * - descendant (e.g. `el .descendant`) |
| 52 | + * - child (`el > .child`) |
53 | 53 | * |
54 | 54 | * Unsupported selector syntax: |
55 | 55 | * - Pseudo-element selectors (e.g. `::before`) |
56 | 56 | * - Pseudo-class selectors (e.g. `:hover` or `:nth-child(2)`) |
57 | 57 | * - Namespace prefixes (e.g. `svg|title` or `[xlink|href]`) |
58 | 58 | * - The following combinators: |
59 | | - * - Next sibling (`.sibling + .sibling`) |
60 | | - * - Subsequent sibling (`.sibling ~ .sibling`) |
| 59 | + * - Next sibling (`el + el`) |
| 60 | + * - Subsequent sibling (`el ~ el`) |
| 61 | + * |
| 62 | + * Future ideas |
| 63 | + * - Namespace type selectors could be implemented with select namespaces in order to |
| 64 | + * select elements from a namespace, for example: |
| 65 | + * - `svg|*` to select all SVG elements |
| 66 | + * - `html|title` to select only HTML TITLE elements. |
61 | 67 | * |
62 | 68 | * @since TBD |
63 | 69 | * |
|
0 commit comments