1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
//! CSS Parsing Results data structures (§5.2).
//!
//! Per §5.2 L1625-1721 of CSS Syntax Module Level 3: the result of
//! parsing can be a stylesheet, a rule (at-rule or qualified rule), a
//! declaration, or a component value (preserved token, function, or
//! simple block).
use Token;
/// §5.2 L1632-1633: A stylesheet has a list of rules.
/// §5.2 L1635-1637: A rule is either an at-rule or a qualified rule.
///
/// Also carries a `Declarations` variant (§5.5.5 L2492-2498) for the
/// mixed list output of `consume_a_blocks_contents` — a block's
/// contents can be a sequence of declarations interleaved with rules,
/// and we model each declaration-list run as a `Rule::Declarations`.
/// §5.2 L1639-1650: An at-rule has a name, a prelude (list of component
/// values), and optionally a list of declarations and a list of child
/// rules (only for "block at-rules" ending in a {}-block).
/// §5.2 L1652-1657: A qualified rule has a prelude, declarations, and
/// child rules.
/// §5.2 L1663-1669: A declaration has a name, a value (list of
/// component values), an `important` flag, and an optional
/// `original_text`.
/// §5.2 L1681-1685: A component value is one of the preserved tokens,
/// a function, or a simple block.
/// §5.2 L1705-1708: A function has a name and a value (list of
/// component values).
/// §5.2 L1710-1719: A simple block has an associated token (the
/// opening token) and a value (list of component values).
/// §5.2 L1710-1719: The associated token kind of a simple block,
/// mirroring the opening `{` / `[` / `(`.
/// Error returned by parser algorithms when an explicit "parse error"
/// path is taken per WHATWG §5.5 (e.g. `consume_a_qualified_rule`'s
/// "parse error: return a syntax error" step at L2330).
///
/// This is a marker type — it carries no diagnostic payload because
/// the WHATWG algorithms themselves do not specify any. Higher-level
/// callers (CSSOM) decide whether to drop the result, log it, or
/// surface a structured error.
;