@@ -38,7 +38,9 @@ Repository: w3c/css-houdini-drafts
38
38
spec:css-transforms-1; type:type; text:<transform-function>
39
39
spec:cssom-1; type:interface; text:CSS
40
40
spec:css-color-4; type:property; text:color
41
- spec:dom; type:dfn; text:ascii case-insensitive
41
+ spec:dom;
42
+ type:dfn; text:ascii case-insensitive
43
+ type:interface; text:Document
42
44
</pre>
43
45
44
46
Introduction {#intro}
@@ -76,7 +78,7 @@ partial interface CSS {
76
78
};
77
79
</pre>
78
80
79
- Additional, the {{Window }} object gains a new <dfn attribute for=Window>\[[registeredPropertySet]]</dfn> private slot,
81
+ Additional, the {{Document }} object gains a new <dfn attribute for=Window>\[[registeredPropertySet]]</dfn> private slot,
80
82
which is a set of records that describe registered custom properties.
81
83
82
84
The {{PropertyDescriptor}} dictionary {#the-propertydescriptor-dictionary}
@@ -118,7 +120,13 @@ as arguments of the same names.
118
120
and |initialValue| being a string,
119
121
execute these steps:
120
122
121
- 1. Attempt to parse |name|
123
+ 1. Let |property set|
124
+ be the value of the
125
+ <a>current global object's</a>
126
+ <a>associated <code>Document</code></a> 's
127
+ {{[[registeredPropertySet]]}} slot.
128
+
129
+ 2. Attempt to parse |name|
122
130
as a <<custom-property-name>> .
123
131
If this fails,
124
132
<a>throw</a> a {{SyntaxError}}
@@ -127,13 +135,13 @@ as arguments of the same names.
127
135
Otherwise,
128
136
let |parsed name| be the parsed value.
129
137
130
- If the window's {{[[registeredPropertySet]]}} slot
138
+ If |property set|
131
139
already contains an entry with |parsed name| as its property name
132
140
(compared codepoint-wise),
133
141
<a>throw</a> an {{InvalidModificationError}}
134
142
and exit this algorithm.
135
143
136
- 2 . If |syntax| is not present,
144
+ 3 . If |syntax| is not present,
137
145
or is equal to <code> "*"</code> (U+002A ASTERISK),
138
146
let |parsed syntax| be undefined,
139
147
and skip to the next step of this algorithm.
@@ -151,7 +159,7 @@ as arguments of the same names.
151
159
Future levels of this specification are expected to expand the complexity of allowed syntax strings,
152
160
allowing custom properties that more closely resemble the full breadth of what CSS properties allow.
153
161
154
- 3 . If |parsed syntax| is undefined,
162
+ 4 . If |parsed syntax| is undefined,
155
163
and |initialValue| is not present,
156
164
let |parsed initial value| be empty.
157
165
This must be treated identically to the "default" initial value of custom properties,
@@ -184,17 +192,17 @@ as arguments of the same names.
184
192
<a>throw</a> a {{SyntaxError}}
185
193
and exit this algorithm.
186
194
187
- 4 . If |inherits| is present,
195
+ 5 . If |inherits| is present,
188
196
set |inherit flag| to its value.
189
197
Otherwise, set |inherit flag| to false.
190
198
191
- 5 . Let |registered property| be a record
199
+ 6 . Let |registered property| be a record
192
200
with a property name of |parsed name|,
193
201
a syntax of |parsed syntax|,
194
202
an initial value of |parsed initial value|,
195
203
and an inherit flag of |inherit flag|.
196
204
Add |registered property|
197
- to the window's {{[[registeredPropertySet]]}} .
205
+ to |property set| .
198
206
</div>
199
207
200
208
A property value is <dfn export>computationally idempotent</dfn>
@@ -231,16 +239,22 @@ with a <code>name</code> set to its sole argument.
231
239
<div algorithm>
232
240
To <dfn>unregister a custom property</dfn> with the name |name|:
233
241
234
- 1. If the window's {{[[registeredPropertySet]]}}
242
+ 1. Let |property set|
243
+ be the value of the
244
+ <a>current global object's</a>
245
+ <a>associated <code>Document</code></a> 's
246
+ {{[[registeredPropertySet]]}} slot.
247
+
248
+ 2. If |property set|
235
249
contains a record with a property name matching |name|
236
250
(compared codepoint-wise),
237
- remove the record from the set.
251
+ remove the record from |property set| .
238
252
239
253
Otherwise,
240
254
<a>throw</a> a {{NotFoundError}} .
241
255
</div>
242
256
243
- When the window 's {{[[registeredPropertySet]]}} changes,
257
+ When the <a>current global object's</a> <a>associated <code>Document</code></a> 's {{[[registeredPropertySet]]}} changes,
244
258
previously syntactically invalid property values can become valid and vice versa.
245
259
This can change the set of <a>declared values</a> which requires the <a>cascade</a> to be recomputed.
246
260
0 commit comments