@@ -127,17 +127,19 @@ See [[#computed-value]].
127
127
they throw away invalid properties,
128
128
and if you write the same property multiple times in a single declaration block,
129
129
all but the last valid one will be thrown away.
130
+ (This is an important part of CSS's error-recovery
131
+ and forward-compatibility behavior.)
130
132
131
133
This works fine if the syntax of a property never changes over the lifetime of a page.
132
134
If a custom property is registered, however,
133
135
it can change its syntax,
134
136
so that a property that was previously invalid
135
137
suddenly becomes valid.
136
138
137
- The only way to handle this is to either store every declaration,
139
+ The only ways to handle this are to either store every declaration,
138
140
even those that were initially invalid
139
141
(increasing the memory cost of pages),
140
- or re-parsing the entire page's CSS
142
+ or to re-parse the entire page's CSS
141
143
with the new syntax rules
142
144
(increasing the processing cost of registering a custom property).
143
145
Neither of these are very desirable.
@@ -149,7 +151,8 @@ See [[#computed-value]].
149
151
which is the entire reason for CSS's error-recovery behavior
150
152
and the practice of writing multiple declarations for varying levels of support.
151
153
A custom property, on the other hand,
152
- has its syntax controlled by the page author;
154
+ has its syntax controlled by the page author,
155
+ according to whatever stylesheet or script they've included in the page;
153
156
there's no unpredictability to be managed.
154
157
Throwing away syntax-violating custom properties
155
158
would thus only be, at best, a convenience for the page author,
0 commit comments