forked from w3c/webref
-
Notifications
You must be signed in to change notification settings - Fork 0
/
css-typed-om.idl
388 lines (330 loc) · 12 KB
/
css-typed-om.idl
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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
// GENERATED CONTENT - DO NOT EDIT
// Content was automatically extracted by Reffy into webref
// (https://github.com/w3c/webref)
// Source: CSS Typed OM Level 1 (https://drafts.css-houdini.org/css-typed-om-1/)
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSStyleValue {
stringifier;
[Exposed=Window] static CSSStyleValue parse(USVString property, USVString cssText);
[Exposed=Window] static sequence<CSSStyleValue> parseAll(USVString property, USVString cssText);
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface StylePropertyMapReadOnly {
iterable<USVString, sequence<CSSStyleValue>>;
any get(USVString property);
/* 'any' means (undefined or CSSStyleValue) here,
see https://github.com/heycam/webidl/issues/60 */
sequence<CSSStyleValue> getAll(USVString property);
boolean has(USVString property);
readonly attribute unsigned long size;
};
[Exposed=Window]
interface StylePropertyMap : StylePropertyMapReadOnly {
undefined set(USVString property, (CSSStyleValue or USVString)... values);
undefined append(USVString property, (CSSStyleValue or USVString)... values);
undefined delete(USVString property);
undefined clear();
};
partial interface Element {
[SameObject] StylePropertyMapReadOnly computedStyleMap();
};
partial interface CSSStyleRule {
[SameObject] readonly attribute StylePropertyMap styleMap;
};
partial interface mixin ElementCSSInlineStyle {
[SameObject] readonly attribute StylePropertyMap attributeStyleMap;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSUnparsedValue : CSSStyleValue {
constructor(sequence<CSSUnparsedSegment> members);
iterable<CSSUnparsedSegment>;
readonly attribute unsigned long length;
getter CSSUnparsedSegment (unsigned long index);
setter CSSUnparsedSegment (unsigned long index, CSSUnparsedSegment val);
};
typedef (USVString or CSSVariableReferenceValue) CSSUnparsedSegment;
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSVariableReferenceValue {
constructor(USVString variable, optional CSSUnparsedValue? fallback = null);
attribute USVString variable;
readonly attribute CSSUnparsedValue? fallback;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSKeywordValue : CSSStyleValue {
constructor(USVString value);
attribute USVString value;
};
typedef (DOMString or CSSKeywordValue) CSSKeywordish;
typedef (double or CSSNumericValue) CSSNumberish;
enum CSSNumericBaseType {
"length",
"angle",
"time",
"frequency",
"resolution",
"flex",
"percent",
};
dictionary CSSNumericType {
long length;
long angle;
long time;
long frequency;
long resolution;
long flex;
long percent;
CSSNumericBaseType percentHint;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSNumericValue : CSSStyleValue {
CSSNumericValue add(CSSNumberish... values);
CSSNumericValue sub(CSSNumberish... values);
CSSNumericValue mul(CSSNumberish... values);
CSSNumericValue div(CSSNumberish... values);
CSSNumericValue min(CSSNumberish... values);
CSSNumericValue max(CSSNumberish... values);
boolean equals(CSSNumberish... value);
CSSUnitValue to(USVString unit);
CSSMathSum toSum(USVString... units);
CSSNumericType type();
[Exposed=Window] static CSSNumericValue parse(USVString cssText);
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSUnitValue : CSSNumericValue {
constructor(double value, USVString unit);
attribute double value;
readonly attribute USVString unit;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathValue : CSSNumericValue {
readonly attribute CSSMathOperator operator;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathSum : CSSMathValue {
constructor(CSSNumberish... args);
readonly attribute CSSNumericArray values;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathProduct : CSSMathValue {
constructor(CSSNumberish... args);
readonly attribute CSSNumericArray values;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathNegate : CSSMathValue {
constructor(CSSNumberish arg);
readonly attribute CSSNumericValue value;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathInvert : CSSMathValue {
constructor(CSSNumberish arg);
readonly attribute CSSNumericValue value;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathMin : CSSMathValue {
constructor(CSSNumberish... args);
readonly attribute CSSNumericArray values;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathMax : CSSMathValue {
constructor(CSSNumberish... args);
readonly attribute CSSNumericArray values;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMathClamp : CSSMathValue {
constructor(CSSNumberish lower, CSSNumberish value, CSSNumberish upper);
readonly attribute CSSNumericValue lower;
readonly attribute CSSNumericValue value;
readonly attribute CSSNumericValue upper;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSNumericArray {
iterable<CSSNumericValue>;
readonly attribute unsigned long length;
getter CSSNumericValue (unsigned long index);
};
enum CSSMathOperator {
"sum",
"product",
"negate",
"invert",
"min",
"max",
"clamp",
};
partial namespace CSS {
CSSUnitValue number(double value);
CSSUnitValue percent(double value);
// <length>
CSSUnitValue em(double value);
CSSUnitValue ex(double value);
CSSUnitValue ch(double value);
CSSUnitValue ic(double value);
CSSUnitValue rem(double value);
CSSUnitValue lh(double value);
CSSUnitValue rlh(double value);
CSSUnitValue vw(double value);
CSSUnitValue vh(double value);
CSSUnitValue vi(double value);
CSSUnitValue vb(double value);
CSSUnitValue vmin(double value);
CSSUnitValue vmax(double value);
CSSUnitValue cm(double value);
CSSUnitValue mm(double value);
CSSUnitValue Q(double value);
CSSUnitValue in(double value);
CSSUnitValue pt(double value);
CSSUnitValue pc(double value);
CSSUnitValue px(double value);
// <angle>
CSSUnitValue deg(double value);
CSSUnitValue grad(double value);
CSSUnitValue rad(double value);
CSSUnitValue turn(double value);
// <time>
CSSUnitValue s(double value);
CSSUnitValue ms(double value);
// <frequency>
CSSUnitValue Hz(double value);
CSSUnitValue kHz(double value);
// <resolution>
CSSUnitValue dpi(double value);
CSSUnitValue dpcm(double value);
CSSUnitValue dppx(double value);
// <flex>
CSSUnitValue fr(double value);
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSTransformValue : CSSStyleValue {
constructor(sequence<CSSTransformComponent> transforms);
iterable<CSSTransformComponent>;
readonly attribute unsigned long length;
getter CSSTransformComponent (unsigned long index);
setter CSSTransformComponent (unsigned long index, CSSTransformComponent val);
readonly attribute boolean is2D;
DOMMatrix toMatrix();
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSTransformComponent {
stringifier;
attribute boolean is2D;
DOMMatrix toMatrix();
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSTranslate : CSSTransformComponent {
constructor(CSSNumericValue x, CSSNumericValue y, optional CSSNumericValue z);
attribute CSSNumericValue x;
attribute CSSNumericValue y;
attribute CSSNumericValue z;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSRotate : CSSTransformComponent {
constructor(CSSNumericValue angle);
constructor(CSSNumberish x, CSSNumberish y, CSSNumberish z, CSSNumericValue angle);
attribute CSSNumberish x;
attribute CSSNumberish y;
attribute CSSNumberish z;
attribute CSSNumericValue angle;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSScale : CSSTransformComponent {
constructor(CSSNumberish x, CSSNumberish y, optional CSSNumberish z);
attribute CSSNumberish x;
attribute CSSNumberish y;
attribute CSSNumberish z;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSSkew : CSSTransformComponent {
constructor(CSSNumericValue ax, CSSNumericValue ay);
attribute CSSNumericValue ax;
attribute CSSNumericValue ay;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSSkewX : CSSTransformComponent {
constructor(CSSNumericValue ax);
attribute CSSNumericValue ax;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSSkewY : CSSTransformComponent {
constructor(CSSNumericValue ay);
attribute CSSNumericValue ay;
};
/* Note that skew(x,y) is *not* the same as skewX(x) skewY(y),
thus the separate interfaces for all three. */
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSPerspective : CSSTransformComponent {
constructor(CSSNumericValue length);
attribute CSSNumericValue length;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSMatrixComponent : CSSTransformComponent {
constructor(DOMMatrixReadOnly matrix, optional CSSMatrixComponentOptions options = {});
attribute DOMMatrix matrix;
};
dictionary CSSMatrixComponentOptions {
boolean is2D;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSImageValue : CSSStyleValue {
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSColorValue : CSSStyleValue {
readonly attribute CSSKeywordValue colorSpace;
CSSColorValue to(CSSKeywordish colorSpace);
[Exposed=Window] static CSSColorValue parse(USVString cssText);
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSRGB : CSSColorValue {
constructor(CSSNumberish r, CSSNumberish g, CSSNumberish b, optional CSSNumberish alpha = 1);
attribute CSSNumberish r;
attribute CSSNumberish g;
attribute CSSNumberish b;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSHSL : CSSColorValue {
constructor(CSSNumericValue h, CSSNumberish s, CSSNumberish l, optional CSSNumberish alpha = 1);
attribute CSSNumericValue h;
attribute CSSNumberish s;
attribute CSSNumberish l;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSHWB : CSSColorValue {
constructor(CSSNumericValue h, CSSNumberish w, CSSNumberish b, optional CSSNumberish alpha = 1);
attribute CSSNumericValue h;
attribute CSSNumberish w;
attribute CSSNumberish b;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSLCH : CSSColorValue {
constructor(CSSNumberish l, CSSNumberish c, CSSNumericValue h, optional CSSNumberish alpha = 1);
attribute CSSNumberish l;
attribute CSSNumberish c;
attribute CSSNumericValue h;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSLab : CSSColorValue {
constructor(CSSNumberish l, CSSNumberish a, CSSNumberish b, optional CSSNumberish alpha = 1);
attribute CSSNumberish l;
attribute CSSNumberish a;
attribute CSSNumberish b;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSColor : CSSColorValue {
constructor(CSSKeywordish colorSpace, sequence<CSSNumberish> channels, optional CSSNumberish alpha = 1);
attribute CSSKeywordish colorSpace;
attribute CSSPercentishArray channels;
attribute CSSNumberish alpha;
};
[Exposed=(Window, Worker, PaintWorklet, LayoutWorklet)]
interface CSSDeviceCMYK : CSSColorValue {
constructor(CSSNumberish c, CSSNumberish m, CSSNumberish y, CSSNumberish k, optional CSSNumberish alpha = 1);
attribute CSSNumberish c;
attribute CSSNumberish m;
attribute CSSNumberish y;
attribute CSSNumberish k;
attribute CSSNumberish alpha;
};