XenevaOS
Loading...
Searching...
No Matches
autogenerated_propset.h
Go to the documentation of this file.
1/*
2 * This file is part of LibCSS
3 * Licensed under the MIT License,
4 * http://www.opensource.org/licenses/mit-license.php
5 * Copyright 2017 The NetSurf Project
6 */
7
11#define ALIGN_CONTENT_INDEX 10
12#define ALIGN_CONTENT_SHIFT 20
13#define ALIGN_CONTENT_MASK 0x700000
14
15static inline css_error set_align_content(css_computed_style *style, uint8_t
16 type)
17{
18 uint32_t *bits = &style->i.bits[ALIGN_CONTENT_INDEX];
19
20 /* 3bits: ttt : type */
21 *bits = (*bits & ~ALIGN_CONTENT_MASK) | (((uint32_t)type & 0x7) <<
23
24 return CSS_OK;
25}
26#undef ALIGN_CONTENT_INDEX
27#undef ALIGN_CONTENT_SHIFT
28#undef ALIGN_CONTENT_MASK
29
30#define ALIGN_ITEMS_INDEX 10
31#define ALIGN_ITEMS_SHIFT 23
32#define ALIGN_ITEMS_MASK 0x3800000
33
34static inline css_error set_align_items(css_computed_style *style, uint8_t type)
35{
36 uint32_t *bits = &style->i.bits[ALIGN_ITEMS_INDEX];
37
38 /* 3bits: ttt : type */
39 *bits = (*bits & ~ALIGN_ITEMS_MASK) | (((uint32_t)type & 0x7) <<
41
42 return CSS_OK;
43}
44#undef ALIGN_ITEMS_INDEX
45#undef ALIGN_ITEMS_SHIFT
46#undef ALIGN_ITEMS_MASK
47
48#define ALIGN_SELF_INDEX 10
49#define ALIGN_SELF_SHIFT 26
50#define ALIGN_SELF_MASK 0x1c000000
51
52static inline css_error set_align_self(css_computed_style *style, uint8_t type)
53{
54 uint32_t *bits = &style->i.bits[ALIGN_SELF_INDEX];
55
56 /* 3bits: ttt : type */
57 *bits = (*bits & ~ALIGN_SELF_MASK) | (((uint32_t)type & 0x7) <<
59
60 return CSS_OK;
61}
62#undef ALIGN_SELF_INDEX
63#undef ALIGN_SELF_SHIFT
64#undef ALIGN_SELF_MASK
65
66#define BACKGROUND_ATTACHMENT_INDEX 14
67#define BACKGROUND_ATTACHMENT_SHIFT 28
68#define BACKGROUND_ATTACHMENT_MASK 0x30000000
69
70static inline css_error set_background_attachment(css_computed_style *style,
71 uint8_t type)
72{
74
75 /* 2bits: tt : type */
76 *bits = (*bits & ~BACKGROUND_ATTACHMENT_MASK) | (((uint32_t)type & 0x3)
78
79 return CSS_OK;
80}
81#undef BACKGROUND_ATTACHMENT_INDEX
82#undef BACKGROUND_ATTACHMENT_SHIFT
83#undef BACKGROUND_ATTACHMENT_MASK
84
85#define BACKGROUND_COLOR_INDEX 14
86#define BACKGROUND_COLOR_SHIFT 30
87#define BACKGROUND_COLOR_MASK 0xc0000000
88
89static inline css_error set_background_color(css_computed_style *style, uint8_t
90 type, css_color color)
91{
92 uint32_t *bits = &style->i.bits[BACKGROUND_COLOR_INDEX];
93
94 /* 2bits: tt : type */
95 *bits = (*bits & ~BACKGROUND_COLOR_MASK) | (((uint32_t)type & 0x3) <<
97
98 style->i.background_color = color;
99
100 return CSS_OK;
101}
102#undef BACKGROUND_COLOR_INDEX
103#undef BACKGROUND_COLOR_SHIFT
104#undef BACKGROUND_COLOR_MASK
105
106#define BACKGROUND_IMAGE_INDEX 14
107#define BACKGROUND_IMAGE_SHIFT 16
108#define BACKGROUND_IMAGE_MASK 0x10000
109
110static inline css_error set_background_image(css_computed_style *style, uint8_t
111 type, lwc_string *string)
112{
113 uint32_t *bits = &style->i.bits[BACKGROUND_IMAGE_INDEX];
114
115 /* 1bit: t : type */
116 *bits = (*bits & ~BACKGROUND_IMAGE_MASK) | (((uint32_t)type & 0x1) <<
118
119 lwc_string *old_string = style->i.background_image;
120
121 if (string != NULL) {
122 style->i.background_image = lwc_string_ref(string);
123 } else {
124 style->i.background_image = NULL;
125 }
126
127 if (old_string != NULL)
128 lwc_string_unref(old_string);
129
130 return CSS_OK;
131}
132#undef BACKGROUND_IMAGE_INDEX
133#undef BACKGROUND_IMAGE_SHIFT
134#undef BACKGROUND_IMAGE_MASK
135
136#define BACKGROUND_POSITION_INDEX 12
137#define BACKGROUND_POSITION_SHIFT 10
138#define BACKGROUND_POSITION_MASK 0x1ffc00
139
140static inline css_error set_background_position(css_computed_style *style,
141 uint8_t type, css_fixed length_a, css_unit unit_a, css_fixed
142 length_b, css_unit unit_b)
143{
144 uint32_t *bits = &style->i.bits[BACKGROUND_POSITION_INDEX];
145
146 /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
147 *bits = (*bits & ~BACKGROUND_POSITION_MASK) | ((((uint32_t)type & 0x1)
148 | (unit_b << 1) | (unit_a << 6)) <<
150
151 style->i.background_position_a = length_a;
152
153 style->i.background_position_b = length_b;
154
155 return CSS_OK;
156}
157#undef BACKGROUND_POSITION_INDEX
158#undef BACKGROUND_POSITION_SHIFT
159#undef BACKGROUND_POSITION_MASK
160
161#define BACKGROUND_REPEAT_INDEX 10
162#define BACKGROUND_REPEAT_SHIFT 29
163#define BACKGROUND_REPEAT_MASK 0xe0000000
164
165static inline css_error set_background_repeat(css_computed_style *style,
166 uint8_t type)
167{
168 uint32_t *bits = &style->i.bits[BACKGROUND_REPEAT_INDEX];
169
170 /* 3bits: ttt : type */
171 *bits = (*bits & ~BACKGROUND_REPEAT_MASK) | (((uint32_t)type & 0x7) <<
173
174 return CSS_OK;
175}
176#undef BACKGROUND_REPEAT_INDEX
177#undef BACKGROUND_REPEAT_SHIFT
178#undef BACKGROUND_REPEAT_MASK
179
180#define BORDER_BOTTOM_COLOR_INDEX 11
181#define BORDER_BOTTOM_COLOR_SHIFT 0
182#define BORDER_BOTTOM_COLOR_MASK 0x3
183
184static inline css_error set_border_bottom_color(css_computed_style *style,
185 uint8_t type, css_color color)
186{
187 uint32_t *bits = &style->i.bits[BORDER_BOTTOM_COLOR_INDEX];
188
189 /* 2bits: tt : type */
190 *bits = (*bits & ~BORDER_BOTTOM_COLOR_MASK) | (((uint32_t)type & 0x3)
192
193 style->i.border_bottom_color = color;
194
195 return CSS_OK;
196}
197#undef BORDER_BOTTOM_COLOR_INDEX
198#undef BORDER_BOTTOM_COLOR_SHIFT
199#undef BORDER_BOTTOM_COLOR_MASK
200
201#define BORDER_BOTTOM_STYLE_INDEX 13
202#define BORDER_BOTTOM_STYLE_SHIFT 28
203#define BORDER_BOTTOM_STYLE_MASK 0xf0000000
204
205static inline css_error set_border_bottom_style(css_computed_style *style,
206 uint8_t type)
207{
208 uint32_t *bits = &style->i.bits[BORDER_BOTTOM_STYLE_INDEX];
209
210 /* 4bits: tttt : type */
211 *bits = (*bits & ~BORDER_BOTTOM_STYLE_MASK) | (((uint32_t)type & 0xf)
213
214 return CSS_OK;
215}
216#undef BORDER_BOTTOM_STYLE_INDEX
217#undef BORDER_BOTTOM_STYLE_SHIFT
218#undef BORDER_BOTTOM_STYLE_MASK
219
220#define BORDER_BOTTOM_WIDTH_INDEX 0
221#define BORDER_BOTTOM_WIDTH_SHIFT 0
222#define BORDER_BOTTOM_WIDTH_MASK 0xff
223
224static inline css_error set_border_bottom_width(css_computed_style *style,
225 uint8_t type, css_fixed length, css_unit unit)
226{
227 uint32_t *bits = &style->i.bits[BORDER_BOTTOM_WIDTH_INDEX];
228
229 /* 8bits: uuuuuttt : unit | type */
230 *bits = (*bits & ~BORDER_BOTTOM_WIDTH_MASK) | ((((uint32_t)type & 0x7)
231 | (unit << 3)) << BORDER_BOTTOM_WIDTH_SHIFT);
232
233 style->i.border_bottom_width = length;
234
235 return CSS_OK;
236}
237#undef BORDER_BOTTOM_WIDTH_INDEX
238#undef BORDER_BOTTOM_WIDTH_SHIFT
239#undef BORDER_BOTTOM_WIDTH_MASK
240
241#define BORDER_COLLAPSE_INDEX 11
242#define BORDER_COLLAPSE_SHIFT 2
243#define BORDER_COLLAPSE_MASK 0xc
244
245static inline css_error set_border_collapse(css_computed_style *style, uint8_t
246 type)
247{
248 uint32_t *bits = &style->i.bits[BORDER_COLLAPSE_INDEX];
249
250 /* 2bits: tt : type */
251 *bits = (*bits & ~BORDER_COLLAPSE_MASK) | (((uint32_t)type & 0x3) <<
253
254 return CSS_OK;
255}
256#undef BORDER_COLLAPSE_INDEX
257#undef BORDER_COLLAPSE_SHIFT
258#undef BORDER_COLLAPSE_MASK
259
260#define BORDER_LEFT_COLOR_INDEX 11
261#define BORDER_LEFT_COLOR_SHIFT 4
262#define BORDER_LEFT_COLOR_MASK 0x30
263
264static inline css_error set_border_left_color(css_computed_style *style,
265 uint8_t type, css_color color)
266{
267 uint32_t *bits = &style->i.bits[BORDER_LEFT_COLOR_INDEX];
268
269 /* 2bits: tt : type */
270 *bits = (*bits & ~BORDER_LEFT_COLOR_MASK) | (((uint32_t)type & 0x3) <<
272
273 style->i.border_left_color = color;
274
275 return CSS_OK;
276}
277#undef BORDER_LEFT_COLOR_INDEX
278#undef BORDER_LEFT_COLOR_SHIFT
279#undef BORDER_LEFT_COLOR_MASK
280
281#define BORDER_LEFT_STYLE_INDEX 9
282#define BORDER_LEFT_STYLE_SHIFT 3
283#define BORDER_LEFT_STYLE_MASK 0x78
284
285static inline css_error set_border_left_style(css_computed_style *style,
286 uint8_t type)
287{
288 uint32_t *bits = &style->i.bits[BORDER_LEFT_STYLE_INDEX];
289
290 /* 4bits: tttt : type */
291 *bits = (*bits & ~BORDER_LEFT_STYLE_MASK) | (((uint32_t)type & 0xf) <<
293
294 return CSS_OK;
295}
296#undef BORDER_LEFT_STYLE_INDEX
297#undef BORDER_LEFT_STYLE_SHIFT
298#undef BORDER_LEFT_STYLE_MASK
299
300#define BORDER_LEFT_WIDTH_INDEX 0
301#define BORDER_LEFT_WIDTH_SHIFT 8
302#define BORDER_LEFT_WIDTH_MASK 0xff00
303
304static inline css_error set_border_left_width(css_computed_style *style,
305 uint8_t type, css_fixed length, css_unit unit)
306{
307 uint32_t *bits = &style->i.bits[BORDER_LEFT_WIDTH_INDEX];
308
309 /* 8bits: uuuuuttt : unit | type */
310 *bits = (*bits & ~BORDER_LEFT_WIDTH_MASK) | ((((uint32_t)type & 0x7) | (
311 unit << 3)) << BORDER_LEFT_WIDTH_SHIFT);
312
313 style->i.border_left_width = length;
314
315 return CSS_OK;
316}
317#undef BORDER_LEFT_WIDTH_INDEX
318#undef BORDER_LEFT_WIDTH_SHIFT
319#undef BORDER_LEFT_WIDTH_MASK
320
321#define BORDER_RIGHT_COLOR_INDEX 11
322#define BORDER_RIGHT_COLOR_SHIFT 6
323#define BORDER_RIGHT_COLOR_MASK 0xc0
324
325static inline css_error set_border_right_color(css_computed_style *style,
326 uint8_t type, css_color color)
327{
328 uint32_t *bits = &style->i.bits[BORDER_RIGHT_COLOR_INDEX];
329
330 /* 2bits: tt : type */
331 *bits = (*bits & ~BORDER_RIGHT_COLOR_MASK) | (((uint32_t)type & 0x3) <<
333
334 style->i.border_right_color = color;
335
336 return CSS_OK;
337}
338#undef BORDER_RIGHT_COLOR_INDEX
339#undef BORDER_RIGHT_COLOR_SHIFT
340#undef BORDER_RIGHT_COLOR_MASK
341
342#define BORDER_RIGHT_STYLE_INDEX 9
343#define BORDER_RIGHT_STYLE_SHIFT 7
344#define BORDER_RIGHT_STYLE_MASK 0x780
345
346static inline css_error set_border_right_style(css_computed_style *style,
347 uint8_t type)
348{
349 uint32_t *bits = &style->i.bits[BORDER_RIGHT_STYLE_INDEX];
350
351 /* 4bits: tttt : type */
352 *bits = (*bits & ~BORDER_RIGHT_STYLE_MASK) | (((uint32_t)type & 0xf) <<
354
355 return CSS_OK;
356}
357#undef BORDER_RIGHT_STYLE_INDEX
358#undef BORDER_RIGHT_STYLE_SHIFT
359#undef BORDER_RIGHT_STYLE_MASK
360
361#define BORDER_RIGHT_WIDTH_INDEX 0
362#define BORDER_RIGHT_WIDTH_SHIFT 16
363#define BORDER_RIGHT_WIDTH_MASK 0xff0000
364
365static inline css_error set_border_right_width(css_computed_style *style,
366 uint8_t type, css_fixed length, css_unit unit)
367{
368 uint32_t *bits = &style->i.bits[BORDER_RIGHT_WIDTH_INDEX];
369
370 /* 8bits: uuuuuttt : unit | type */
371 *bits = (*bits & ~BORDER_RIGHT_WIDTH_MASK) | ((((uint32_t)type & 0x7) |
372 (unit << 3)) << BORDER_RIGHT_WIDTH_SHIFT);
373
374 style->i.border_right_width = length;
375
376 return CSS_OK;
377}
378#undef BORDER_RIGHT_WIDTH_INDEX
379#undef BORDER_RIGHT_WIDTH_SHIFT
380#undef BORDER_RIGHT_WIDTH_MASK
381
382#define BORDER_SPACING_INDEX 12
383#define BORDER_SPACING_SHIFT 21
384#define BORDER_SPACING_MASK 0xffe00000
385
386static inline css_error set_border_spacing(css_computed_style *style, uint8_t
387 type, css_fixed length_a, css_unit unit_a, css_fixed length_b,
388 css_unit unit_b)
389{
390 uint32_t *bits = &style->i.bits[BORDER_SPACING_INDEX];
391
392 /* 11bits: aaaaabbbbbt : unit_a | unit_b | type */
393 *bits = (*bits & ~BORDER_SPACING_MASK) | ((((uint32_t)type & 0x1) | (
394 unit_b << 1) | (unit_a << 6)) << BORDER_SPACING_SHIFT);
395
396 style->i.border_spacing_a = length_a;
397
398 style->i.border_spacing_b = length_b;
399
400 return CSS_OK;
401}
402#undef BORDER_SPACING_INDEX
403#undef BORDER_SPACING_SHIFT
404#undef BORDER_SPACING_MASK
405
406#define BORDER_TOP_COLOR_INDEX 11
407#define BORDER_TOP_COLOR_SHIFT 8
408#define BORDER_TOP_COLOR_MASK 0x300
409
410static inline css_error set_border_top_color(css_computed_style *style, uint8_t
411 type, css_color color)
412{
413 uint32_t *bits = &style->i.bits[BORDER_TOP_COLOR_INDEX];
414
415 /* 2bits: tt : type */
416 *bits = (*bits & ~BORDER_TOP_COLOR_MASK) | (((uint32_t)type & 0x3) <<
418
419 style->i.border_top_color = color;
420
421 return CSS_OK;
422}
423#undef BORDER_TOP_COLOR_INDEX
424#undef BORDER_TOP_COLOR_SHIFT
425#undef BORDER_TOP_COLOR_MASK
426
427#define BORDER_TOP_STYLE_INDEX 9
428#define BORDER_TOP_STYLE_SHIFT 11
429#define BORDER_TOP_STYLE_MASK 0x7800
430
431static inline css_error set_border_top_style(css_computed_style *style, uint8_t
432 type)
433{
434 uint32_t *bits = &style->i.bits[BORDER_TOP_STYLE_INDEX];
435
436 /* 4bits: tttt : type */
437 *bits = (*bits & ~BORDER_TOP_STYLE_MASK) | (((uint32_t)type & 0xf) <<
439
440 return CSS_OK;
441}
442#undef BORDER_TOP_STYLE_INDEX
443#undef BORDER_TOP_STYLE_SHIFT
444#undef BORDER_TOP_STYLE_MASK
445
446#define BORDER_TOP_WIDTH_INDEX 0
447#define BORDER_TOP_WIDTH_SHIFT 24
448#define BORDER_TOP_WIDTH_MASK 0xff000000
449
450static inline css_error set_border_top_width(css_computed_style *style, uint8_t
451 type, css_fixed length, css_unit unit)
452{
453 uint32_t *bits = &style->i.bits[BORDER_TOP_WIDTH_INDEX];
454
455 /* 8bits: uuuuuttt : unit | type */
456 *bits = (*bits & ~BORDER_TOP_WIDTH_MASK) | ((((uint32_t)type & 0x7) | (
457 unit << 3)) << BORDER_TOP_WIDTH_SHIFT);
458
459 style->i.border_top_width = length;
460
461 return CSS_OK;
462}
463#undef BORDER_TOP_WIDTH_INDEX
464#undef BORDER_TOP_WIDTH_SHIFT
465#undef BORDER_TOP_WIDTH_MASK
466
467#define BOTTOM_INDEX 3
468#define BOTTOM_SHIFT 11
469#define BOTTOM_MASK 0x3f800
470
471static inline css_error set_bottom(css_computed_style *style, uint8_t type,
472 css_fixed length, css_unit unit)
473{
474 uint32_t *bits = &style->i.bits[BOTTOM_INDEX];
475
476 /* 7bits: uuuuutt : unit | type */
477 *bits = (*bits & ~BOTTOM_MASK) | ((((uint32_t)type & 0x3) | (unit <<
478 2)) << BOTTOM_SHIFT);
479
480 style->i.bottom = length;
481
482 return CSS_OK;
483}
484#undef BOTTOM_INDEX
485#undef BOTTOM_SHIFT
486#undef BOTTOM_MASK
487
488#define BOX_SIZING_INDEX 11
489#define BOX_SIZING_SHIFT 10
490#define BOX_SIZING_MASK 0xc00
491
492static inline css_error set_box_sizing(css_computed_style *style, uint8_t type)
493{
494 uint32_t *bits = &style->i.bits[BOX_SIZING_INDEX];
495
496 /* 2bits: tt : type */
497 *bits = (*bits & ~BOX_SIZING_MASK) | (((uint32_t)type & 0x3) <<
499
500 return CSS_OK;
501}
502#undef BOX_SIZING_INDEX
503#undef BOX_SIZING_SHIFT
504#undef BOX_SIZING_MASK
505
506#define BREAK_AFTER_INDEX 9
507#define BREAK_AFTER_SHIFT 15
508#define BREAK_AFTER_MASK 0x78000
509
510static inline css_error set_break_after(css_computed_style *style, uint8_t type)
511{
512 uint32_t *bits = &style->i.bits[BREAK_AFTER_INDEX];
513
514 /* 4bits: tttt : type */
515 *bits = (*bits & ~BREAK_AFTER_MASK) | (((uint32_t)type & 0xf) <<
517
518 return CSS_OK;
519}
520#undef BREAK_AFTER_INDEX
521#undef BREAK_AFTER_SHIFT
522#undef BREAK_AFTER_MASK
523
524#define BREAK_BEFORE_INDEX 9
525#define BREAK_BEFORE_SHIFT 19
526#define BREAK_BEFORE_MASK 0x780000
527
528static inline css_error set_break_before(css_computed_style *style, uint8_t
529 type)
530{
531 uint32_t *bits = &style->i.bits[BREAK_BEFORE_INDEX];
532
533 /* 4bits: tttt : type */
534 *bits = (*bits & ~BREAK_BEFORE_MASK) | (((uint32_t)type & 0xf) <<
536
537 return CSS_OK;
538}
539#undef BREAK_BEFORE_INDEX
540#undef BREAK_BEFORE_SHIFT
541#undef BREAK_BEFORE_MASK
542
543#define BREAK_INSIDE_INDEX 9
544#define BREAK_INSIDE_SHIFT 23
545#define BREAK_INSIDE_MASK 0x7800000
546
547static inline css_error set_break_inside(css_computed_style *style, uint8_t
548 type)
549{
550 uint32_t *bits = &style->i.bits[BREAK_INSIDE_INDEX];
551
552 /* 4bits: tttt : type */
553 *bits = (*bits & ~BREAK_INSIDE_MASK) | (((uint32_t)type & 0xf) <<
555
556 return CSS_OK;
557}
558#undef BREAK_INSIDE_INDEX
559#undef BREAK_INSIDE_SHIFT
560#undef BREAK_INSIDE_MASK
561
562#define CAPTION_SIDE_INDEX 11
563#define CAPTION_SIDE_SHIFT 12
564#define CAPTION_SIDE_MASK 0x3000
565
566static inline css_error set_caption_side(css_computed_style *style, uint8_t
567 type)
568{
569 uint32_t *bits = &style->i.bits[CAPTION_SIDE_INDEX];
570
571 /* 2bits: tt : type */
572 *bits = (*bits & ~CAPTION_SIDE_MASK) | (((uint32_t)type & 0x3) <<
574
575 return CSS_OK;
576}
577#undef CAPTION_SIDE_INDEX
578#undef CAPTION_SIDE_SHIFT
579#undef CAPTION_SIDE_MASK
580
581#define CLEAR_INDEX 13
582#define CLEAR_SHIFT 1
583#define CLEAR_MASK 0xe
584
585static inline css_error set_clear(css_computed_style *style, uint8_t type)
586{
587 uint32_t *bits = &style->i.bits[CLEAR_INDEX];
588
589 /* 3bits: ttt : type */
590 *bits = (*bits & ~CLEAR_MASK) | (((uint32_t)type & 0x7) << CLEAR_SHIFT);
591
592 return CSS_OK;
593}
594#undef CLEAR_INDEX
595#undef CLEAR_SHIFT
596#undef CLEAR_MASK
597
598#define CLIP_INDEX 2
599#define CLIP_SHIFT 6
600#define CLIP_MASK 0xffffffc0
601static inline css_error set_clip(
602 css_computed_style *style, uint8_t type,
604{
605 uint32_t *bits;
606
607 bits = &style->i.bits[CLIP_INDEX];
608
609 /*
610 26bits: tt tttr rrrr bbbb blll llTR BLyy:
611 units: top | right | bottom | left
612 opcodes: top | right | bottom | left | type
613 */
614 *bits = (*bits & ~CLIP_MASK) |
615 ((type & 0x3) << CLIP_SHIFT);
616
617 if (type == CSS_CLIP_RECT) {
618 *bits |= (((rect->top_auto ? 0x20 : 0) |
619 (rect->right_auto ? 0x10 : 0) |
620 (rect->bottom_auto ? 0x8 : 0) |
621 (rect->left_auto ? 0x4 : 0)) << CLIP_SHIFT);
622
623 *bits |= (((rect->tunit << 5) | rect->runit)
624 << (CLIP_SHIFT + 16));
625
626 *bits |= (((rect->bunit << 5) | rect->lunit)
627 << (CLIP_SHIFT + 6));
628
629 style->i.clip_a = rect->top;
630 style->i.clip_b = rect->right;
631 style->i.clip_c = rect->bottom;
632 style->i.clip_d = rect->left;
633 }
634
635 return CSS_OK;
636}
637#undef CLIP_INDEX
638#undef CLIP_SHIFT
639#undef CLIP_MASK
640
641#define COLOR_INDEX 14
642#define COLOR_SHIFT 17
643#define COLOR_MASK 0x20000
644
645static inline css_error set_color(css_computed_style *style, uint8_t type,
647{
648 uint32_t *bits = &style->i.bits[COLOR_INDEX];
649
650 /* 1bit: t : type */
651 *bits = (*bits & ~COLOR_MASK) | (((uint32_t)type & 0x1) << COLOR_SHIFT);
652
653 style->i.color = color;
654
655 return CSS_OK;
656}
657#undef COLOR_INDEX
658#undef COLOR_SHIFT
659#undef COLOR_MASK
660
661#define COLUMN_COUNT_INDEX 11
662#define COLUMN_COUNT_SHIFT 14
663#define COLUMN_COUNT_MASK 0xc000
664
665static inline css_error set_column_count(css_computed_style *style, uint8_t
666 type, int32_t integer)
667{
668 uint32_t *bits = &style->i.bits[COLUMN_COUNT_INDEX];
669
670 /* 2bits: tt : type */
671 *bits = (*bits & ~COLUMN_COUNT_MASK) | (((uint32_t)type & 0x3) <<
673
674 style->i.column_count = integer;
675
676 return CSS_OK;
677}
678#undef COLUMN_COUNT_INDEX
679#undef COLUMN_COUNT_SHIFT
680#undef COLUMN_COUNT_MASK
681
682#define COLUMN_FILL_INDEX 11
683#define COLUMN_FILL_SHIFT 16
684#define COLUMN_FILL_MASK 0x30000
685
686static inline css_error set_column_fill(css_computed_style *style, uint8_t type)
687{
688 uint32_t *bits = &style->i.bits[COLUMN_FILL_INDEX];
689
690 /* 2bits: tt : type */
691 *bits = (*bits & ~COLUMN_FILL_MASK) | (((uint32_t)type & 0x3) <<
693
694 return CSS_OK;
695}
696#undef COLUMN_FILL_INDEX
697#undef COLUMN_FILL_SHIFT
698#undef COLUMN_FILL_MASK
699
700#define COLUMN_GAP_INDEX 3
701#define COLUMN_GAP_SHIFT 18
702#define COLUMN_GAP_MASK 0x1fc0000
703
704static inline css_error set_column_gap(css_computed_style *style, uint8_t type,
705 css_fixed length, css_unit unit)
706{
707 uint32_t *bits = &style->i.bits[COLUMN_GAP_INDEX];
708
709 /* 7bits: uuuuutt : unit | type */
710 *bits = (*bits & ~COLUMN_GAP_MASK) | ((((uint32_t)type & 0x3) | (unit
711 << 2)) << COLUMN_GAP_SHIFT);
712
713 style->i.column_gap = length;
714
715 return CSS_OK;
716}
717#undef COLUMN_GAP_INDEX
718#undef COLUMN_GAP_SHIFT
719#undef COLUMN_GAP_MASK
720
721#define COLUMN_RULE_COLOR_INDEX 11
722#define COLUMN_RULE_COLOR_SHIFT 18
723#define COLUMN_RULE_COLOR_MASK 0xc0000
724
725static inline css_error set_column_rule_color(css_computed_style *style,
726 uint8_t type, css_color color)
727{
728 uint32_t *bits = &style->i.bits[COLUMN_RULE_COLOR_INDEX];
729
730 /* 2bits: tt : type */
731 *bits = (*bits & ~COLUMN_RULE_COLOR_MASK) | (((uint32_t)type & 0x3) <<
733
734 style->i.column_rule_color = color;
735
736 return CSS_OK;
737}
738#undef COLUMN_RULE_COLOR_INDEX
739#undef COLUMN_RULE_COLOR_SHIFT
740#undef COLUMN_RULE_COLOR_MASK
741
742#define COLUMN_RULE_STYLE_INDEX 7
743#define COLUMN_RULE_STYLE_SHIFT 0
744#define COLUMN_RULE_STYLE_MASK 0xf
745
746static inline css_error set_column_rule_style(css_computed_style *style,
747 uint8_t type)
748{
749 uint32_t *bits = &style->i.bits[COLUMN_RULE_STYLE_INDEX];
750
751 /* 4bits: tttt : type */
752 *bits = (*bits & ~COLUMN_RULE_STYLE_MASK) | (((uint32_t)type & 0xf) <<
754
755 return CSS_OK;
756}
757#undef COLUMN_RULE_STYLE_INDEX
758#undef COLUMN_RULE_STYLE_SHIFT
759#undef COLUMN_RULE_STYLE_MASK
760
761#define COLUMN_RULE_WIDTH_INDEX 1
762#define COLUMN_RULE_WIDTH_SHIFT 7
763#define COLUMN_RULE_WIDTH_MASK 0x7f80
764
765static inline css_error set_column_rule_width(css_computed_style *style,
766 uint8_t type, css_fixed length, css_unit unit)
767{
768 uint32_t *bits = &style->i.bits[COLUMN_RULE_WIDTH_INDEX];
769
770 /* 8bits: uuuuuttt : unit | type */
771 *bits = (*bits & ~COLUMN_RULE_WIDTH_MASK) | ((((uint32_t)type & 0x7) | (
772 unit << 3)) << COLUMN_RULE_WIDTH_SHIFT);
773
774 style->i.column_rule_width = length;
775
776 return CSS_OK;
777}
778#undef COLUMN_RULE_WIDTH_INDEX
779#undef COLUMN_RULE_WIDTH_SHIFT
780#undef COLUMN_RULE_WIDTH_MASK
781
782#define COLUMN_SPAN_INDEX 11
783#define COLUMN_SPAN_SHIFT 20
784#define COLUMN_SPAN_MASK 0x300000
785
786static inline css_error set_column_span(css_computed_style *style, uint8_t type)
787{
788 uint32_t *bits = &style->i.bits[COLUMN_SPAN_INDEX];
789
790 /* 2bits: tt : type */
791 *bits = (*bits & ~COLUMN_SPAN_MASK) | (((uint32_t)type & 0x3) <<
793
794 return CSS_OK;
795}
796#undef COLUMN_SPAN_INDEX
797#undef COLUMN_SPAN_SHIFT
798#undef COLUMN_SPAN_MASK
799
800#define COLUMN_WIDTH_INDEX 3
801#define COLUMN_WIDTH_SHIFT 25
802#define COLUMN_WIDTH_MASK 0xfe000000
803
804static inline css_error set_column_width(css_computed_style *style, uint8_t
805 type, css_fixed length, css_unit unit)
806{
807 uint32_t *bits = &style->i.bits[COLUMN_WIDTH_INDEX];
808
809 /* 7bits: uuuuutt : unit | type */
810 *bits = (*bits & ~COLUMN_WIDTH_MASK) | ((((uint32_t)type & 0x3) | (unit
811 << 2)) << COLUMN_WIDTH_SHIFT);
812
813 style->i.column_width = length;
814
815 return CSS_OK;
816}
817#undef COLUMN_WIDTH_INDEX
818#undef COLUMN_WIDTH_SHIFT
819#undef COLUMN_WIDTH_MASK
820
821#define CONTENT_INDEX 11
822#define CONTENT_SHIFT 22
823#define CONTENT_MASK 0xc00000
824static inline css_error set_content(
825 css_computed_style *style, uint8_t type,
827{
828 uint32_t *bits;
829 css_computed_content_item *oldcontent;
831
832 /* 2bits: type */
833 bits = &style->i.bits[CONTENT_INDEX];
834 oldcontent = style->content;
835
836 *bits = (*bits & ~CONTENT_MASK) |
837 ((type & 0x3) << CONTENT_SHIFT);
838
839 for (c = content; c != NULL &&
840 c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
841 switch (c->type) {
843 c->data.string = lwc_string_ref(c->data.string);
844 break;
846 c->data.uri = lwc_string_ref(c->data.uri);
847 break;
849 c->data.attr = lwc_string_ref(c->data.attr);
850 break;
852 c->data.counter.name =
853 lwc_string_ref(c->data.counter.name);
854 break;
856 c->data.counters.name =
857 lwc_string_ref(c->data.counters.name);
858 c->data.counters.sep =
859 lwc_string_ref(c->data.counters.sep);
860 break;
861 default:
862 break;
863 }
864 }
865
866 style->content = content;
867
868 /* Free existing array */
869 if (oldcontent != NULL) {
870 for (c = oldcontent;
871 c->type != CSS_COMPUTED_CONTENT_NONE; c++) {
872 switch (c->type) {
875 break;
878 break;
881 break;
884 break;
888 break;
889 default:
890 break;
891 }
892 }
893
894 if (oldcontent != content)
895 free(oldcontent);
896 }
897
898 return CSS_OK;
899}
900#undef CONTENT_INDEX
901#undef CONTENT_SHIFT
902#undef CONTENT_MASK
903
904#define COUNTER_INCREMENT_INDEX 14
905#define COUNTER_INCREMENT_SHIFT 18
906#define COUNTER_INCREMENT_MASK 0x40000
907
908static inline css_error set_counter_increment(css_computed_style *style,
909 uint8_t type, css_computed_counter *counter_arr)
910{
911 uint32_t *bits = &style->i.bits[COUNTER_INCREMENT_INDEX];
912
913 /* 1bit: t : type */
914 *bits = (*bits & ~COUNTER_INCREMENT_MASK) | (((uint32_t)type & 0x1) <<
916
917 css_computed_counter *old_counter_arr = style->counter_increment;
919
920 for (c = counter_arr; c != NULL && c->name != NULL; c++)
921 c->name = lwc_string_ref(c->name);
922
923 style->counter_increment = counter_arr;
924
925 /* Free existing array */
926 if (old_counter_arr != NULL) {
927 for (c = old_counter_arr; c->name != NULL; c++)
929
930 if (old_counter_arr != counter_arr)
931 free(old_counter_arr);
932 }
933
934 return CSS_OK;
935}
936#undef COUNTER_INCREMENT_INDEX
937#undef COUNTER_INCREMENT_SHIFT
938#undef COUNTER_INCREMENT_MASK
939
940#define COUNTER_RESET_INDEX 14
941#define COUNTER_RESET_SHIFT 19
942#define COUNTER_RESET_MASK 0x80000
943
944static inline css_error set_counter_reset(css_computed_style *style, uint8_t
945 type, css_computed_counter *counter_arr)
946{
947 uint32_t *bits = &style->i.bits[COUNTER_RESET_INDEX];
948
949 /* 1bit: t : type */
950 *bits = (*bits & ~COUNTER_RESET_MASK) | (((uint32_t)type & 0x1) <<
952
953 css_computed_counter *old_counter_arr = style->counter_reset;
955
956 for (c = counter_arr; c != NULL && c->name != NULL; c++)
957 c->name = lwc_string_ref(c->name);
958
959 style->counter_reset = counter_arr;
960
961 /* Free existing array */
962 if (old_counter_arr != NULL) {
963 for (c = old_counter_arr; c->name != NULL; c++)
965
966 if (old_counter_arr != counter_arr)
967 free(old_counter_arr);
968 }
969
970 return CSS_OK;
971}
972#undef COUNTER_RESET_INDEX
973#undef COUNTER_RESET_SHIFT
974#undef COUNTER_RESET_MASK
975
976#define CURSOR_INDEX 9
977#define CURSOR_SHIFT 27
978#define CURSOR_MASK 0xf8000000
979
980static inline css_error set_cursor(css_computed_style *style, uint8_t type,
981 lwc_string **string_arr)
982{
983 uint32_t *bits = &style->i.bits[CURSOR_INDEX];
984
985 /* 5bits: ttttt : type */
986 *bits = (*bits & ~CURSOR_MASK) | (((uint32_t)type & 0x1f) <<
988
989 lwc_string **old_string_arr = style->cursor;
990 lwc_string **s;
991
992 for (s = string_arr; s != NULL && *s != NULL; s++)
993 *s = lwc_string_ref(*s);
994
995 style->cursor = string_arr;
996
997 /* Free existing array */
998 if (old_string_arr != NULL) {
999 for (s = old_string_arr; *s != NULL; s++)
1000 lwc_string_unref(*s);
1001
1002 if (old_string_arr != string_arr)
1003 free(old_string_arr);
1004 }
1005
1006 return CSS_OK;
1007}
1008#undef CURSOR_INDEX
1009#undef CURSOR_SHIFT
1010#undef CURSOR_MASK
1011
1012#define DIRECTION_INDEX 11
1013#define DIRECTION_SHIFT 24
1014#define DIRECTION_MASK 0x3000000
1015
1016static inline css_error set_direction(css_computed_style *style, uint8_t type)
1017{
1018 uint32_t *bits = &style->i.bits[DIRECTION_INDEX];
1019
1020 /* 2bits: tt : type */
1021 *bits = (*bits & ~DIRECTION_MASK) | (((uint32_t)type & 0x3) <<
1023
1024 return CSS_OK;
1025}
1026#undef DIRECTION_INDEX
1027#undef DIRECTION_SHIFT
1028#undef DIRECTION_MASK
1029
1030#define DISPLAY_INDEX 8
1031#define DISPLAY_SHIFT 3
1032#define DISPLAY_MASK 0xf8
1033
1034static inline css_error set_display(css_computed_style *style, uint8_t type)
1035{
1036 uint32_t *bits = &style->i.bits[DISPLAY_INDEX];
1037
1038 /* 5bits: ttttt : type */
1039 *bits = (*bits & ~DISPLAY_MASK) | (((uint32_t)type & 0x1f) <<
1041
1042 return CSS_OK;
1043}
1044#undef DISPLAY_INDEX
1045#undef DISPLAY_SHIFT
1046#undef DISPLAY_MASK
1047
1048#define EMPTY_CELLS_INDEX 11
1049#define EMPTY_CELLS_SHIFT 26
1050#define EMPTY_CELLS_MASK 0xc000000
1051
1052static inline css_error set_empty_cells(css_computed_style *style, uint8_t type)
1053{
1054 uint32_t *bits = &style->i.bits[EMPTY_CELLS_INDEX];
1055
1056 /* 2bits: tt : type */
1057 *bits = (*bits & ~EMPTY_CELLS_MASK) | (((uint32_t)type & 0x3) <<
1059
1060 return CSS_OK;
1061}
1062#undef EMPTY_CELLS_INDEX
1063#undef EMPTY_CELLS_SHIFT
1064#undef EMPTY_CELLS_MASK
1065
1066#define FILL_OPACITY_INDEX 14
1067#define FILL_OPACITY_SHIFT 20
1068#define FILL_OPACITY_MASK 0x100000
1069
1070static inline css_error set_fill_opacity(css_computed_style *style, uint8_t
1071 type, css_fixed fixed)
1072{
1073 uint32_t *bits = &style->i.bits[FILL_OPACITY_INDEX];
1074
1075 /* 1bit: t : type */
1076 *bits = (*bits & ~FILL_OPACITY_MASK) | (((uint32_t)type & 0x1) <<
1078
1079 style->i.fill_opacity = fixed;
1080
1081 return CSS_OK;
1082}
1083#undef FILL_OPACITY_INDEX
1084#undef FILL_OPACITY_SHIFT
1085#undef FILL_OPACITY_MASK
1086
1087#define FLEX_BASIS_INDEX 7
1088#define FLEX_BASIS_SHIFT 4
1089#define FLEX_BASIS_MASK 0x7f0
1090
1091static inline css_error set_flex_basis(css_computed_style *style, uint8_t type,
1092 css_fixed length, css_unit unit)
1093{
1094 uint32_t *bits = &style->i.bits[FLEX_BASIS_INDEX];
1095
1096 /* 7bits: uuuuutt : unit | type */
1097 *bits = (*bits & ~FLEX_BASIS_MASK) | ((((uint32_t)type & 0x3) | (unit
1098 << 2)) << FLEX_BASIS_SHIFT);
1099
1100 style->i.flex_basis = length;
1101
1102 return CSS_OK;
1103}
1104#undef FLEX_BASIS_INDEX
1105#undef FLEX_BASIS_SHIFT
1106#undef FLEX_BASIS_MASK
1107
1108#define FLEX_DIRECTION_INDEX 13
1109#define FLEX_DIRECTION_SHIFT 4
1110#define FLEX_DIRECTION_MASK 0x70
1111
1112static inline css_error set_flex_direction(css_computed_style *style, uint8_t
1113 type)
1114{
1115 uint32_t *bits = &style->i.bits[FLEX_DIRECTION_INDEX];
1116
1117 /* 3bits: ttt : type */
1118 *bits = (*bits & ~FLEX_DIRECTION_MASK) | (((uint32_t)type & 0x7) <<
1120
1121 return CSS_OK;
1122}
1123#undef FLEX_DIRECTION_INDEX
1124#undef FLEX_DIRECTION_SHIFT
1125#undef FLEX_DIRECTION_MASK
1126
1127#define FLEX_GROW_INDEX 14
1128#define FLEX_GROW_SHIFT 21
1129#define FLEX_GROW_MASK 0x200000
1130
1131static inline css_error set_flex_grow(css_computed_style *style, uint8_t type,
1132 css_fixed fixed)
1133{
1134 uint32_t *bits = &style->i.bits[FLEX_GROW_INDEX];
1135
1136 /* 1bit: t : type */
1137 *bits = (*bits & ~FLEX_GROW_MASK) | (((uint32_t)type & 0x1) <<
1139
1140 style->i.flex_grow = fixed;
1141
1142 return CSS_OK;
1143}
1144#undef FLEX_GROW_INDEX
1145#undef FLEX_GROW_SHIFT
1146#undef FLEX_GROW_MASK
1147
1148#define FLEX_SHRINK_INDEX 14
1149#define FLEX_SHRINK_SHIFT 22
1150#define FLEX_SHRINK_MASK 0x400000
1151
1152static inline css_error set_flex_shrink(css_computed_style *style, uint8_t
1153 type, css_fixed fixed)
1154{
1155 uint32_t *bits = &style->i.bits[FLEX_SHRINK_INDEX];
1156
1157 /* 1bit: t : type */
1158 *bits = (*bits & ~FLEX_SHRINK_MASK) | (((uint32_t)type & 0x1) <<
1160
1161 style->i.flex_shrink = fixed;
1162
1163 return CSS_OK;
1164}
1165#undef FLEX_SHRINK_INDEX
1166#undef FLEX_SHRINK_SHIFT
1167#undef FLEX_SHRINK_MASK
1168
1169#define FLEX_WRAP_INDEX 11
1170#define FLEX_WRAP_SHIFT 28
1171#define FLEX_WRAP_MASK 0x30000000
1172
1173static inline css_error set_flex_wrap(css_computed_style *style, uint8_t type)
1174{
1175 uint32_t *bits = &style->i.bits[FLEX_WRAP_INDEX];
1176
1177 /* 2bits: tt : type */
1178 *bits = (*bits & ~FLEX_WRAP_MASK) | (((uint32_t)type & 0x3) <<
1180
1181 return CSS_OK;
1182}
1183#undef FLEX_WRAP_INDEX
1184#undef FLEX_WRAP_SHIFT
1185#undef FLEX_WRAP_MASK
1186
1187#define FLOAT_INDEX 11
1188#define FLOAT_SHIFT 30
1189#define FLOAT_MASK 0xc0000000
1190
1191static inline css_error set_float(css_computed_style *style, uint8_t type)
1192{
1193 uint32_t *bits = &style->i.bits[FLOAT_INDEX];
1194
1195 /* 2bits: tt : type */
1196 *bits = (*bits & ~FLOAT_MASK) | (((uint32_t)type & 0x3) << FLOAT_SHIFT);
1197
1198 return CSS_OK;
1199}
1200#undef FLOAT_INDEX
1201#undef FLOAT_SHIFT
1202#undef FLOAT_MASK
1203
1204#define FONT_FAMILY_INDEX 13
1205#define FONT_FAMILY_SHIFT 7
1206#define FONT_FAMILY_MASK 0x380
1207
1208static inline css_error set_font_family(css_computed_style *style, uint8_t
1209 type, lwc_string **string_arr)
1210{
1211 uint32_t *bits = &style->i.bits[FONT_FAMILY_INDEX];
1212
1213 /* 3bits: ttt : type */
1214 *bits = (*bits & ~FONT_FAMILY_MASK) | (((uint32_t)type & 0x7) <<
1216
1217 lwc_string **old_string_arr = style->font_family;
1218 lwc_string **s;
1219
1220 for (s = string_arr; s != NULL && *s != NULL; s++)
1221 *s = lwc_string_ref(*s);
1222
1223 style->font_family = string_arr;
1224
1225 /* Free existing array */
1226 if (old_string_arr != NULL) {
1227 for (s = old_string_arr; *s != NULL; s++)
1228 lwc_string_unref(*s);
1229
1230 if (old_string_arr != string_arr)
1231 free(old_string_arr);
1232 }
1233
1234 return CSS_OK;
1235}
1236#undef FONT_FAMILY_INDEX
1237#undef FONT_FAMILY_SHIFT
1238#undef FONT_FAMILY_MASK
1239
1240#define FONT_SIZE_INDEX 1
1241#define FONT_SIZE_SHIFT 23
1242#define FONT_SIZE_MASK 0xff800000
1243
1244static inline css_error set_font_size(css_computed_style *style, uint8_t type,
1245 css_fixed length, css_unit unit)
1246{
1247 uint32_t *bits = &style->i.bits[FONT_SIZE_INDEX];
1248
1249 /* 9bits: uuuuutttt : unit | type */
1250 *bits = (*bits & ~FONT_SIZE_MASK) | ((((uint32_t)type & 0xf) | (unit <<
1251 4)) << FONT_SIZE_SHIFT);
1252
1253 style->i.font_size = length;
1254
1255 return CSS_OK;
1256}
1257#undef FONT_SIZE_INDEX
1258#undef FONT_SIZE_SHIFT
1259#undef FONT_SIZE_MASK
1260
1261#define FONT_STYLE_INDEX 10
1262#define FONT_STYLE_SHIFT 0
1263#define FONT_STYLE_MASK 0x3
1264
1265static inline css_error set_font_style(css_computed_style *style, uint8_t type)
1266{
1267 uint32_t *bits = &style->i.bits[FONT_STYLE_INDEX];
1268
1269 /* 2bits: tt : type */
1270 *bits = (*bits & ~FONT_STYLE_MASK) | (((uint32_t)type & 0x3) <<
1272
1273 return CSS_OK;
1274}
1275#undef FONT_STYLE_INDEX
1276#undef FONT_STYLE_SHIFT
1277#undef FONT_STYLE_MASK
1278
1279#define FONT_VARIANT_INDEX 10
1280#define FONT_VARIANT_SHIFT 2
1281#define FONT_VARIANT_MASK 0xc
1282
1283static inline css_error set_font_variant(css_computed_style *style, uint8_t
1284 type)
1285{
1286 uint32_t *bits = &style->i.bits[FONT_VARIANT_INDEX];
1287
1288 /* 2bits: tt : type */
1289 *bits = (*bits & ~FONT_VARIANT_MASK) | (((uint32_t)type & 0x3) <<
1291
1292 return CSS_OK;
1293}
1294#undef FONT_VARIANT_INDEX
1295#undef FONT_VARIANT_SHIFT
1296#undef FONT_VARIANT_MASK
1297
1298#define FONT_WEIGHT_INDEX 6
1299#define FONT_WEIGHT_SHIFT 0
1300#define FONT_WEIGHT_MASK 0xf
1301
1302static inline css_error set_font_weight(css_computed_style *style, uint8_t type)
1303{
1304 uint32_t *bits = &style->i.bits[FONT_WEIGHT_INDEX];
1305
1306 /* 4bits: tttt : type */
1307 *bits = (*bits & ~FONT_WEIGHT_MASK) | (((uint32_t)type & 0xf) <<
1309
1310 return CSS_OK;
1311}
1312#undef FONT_WEIGHT_INDEX
1313#undef FONT_WEIGHT_SHIFT
1314#undef FONT_WEIGHT_MASK
1315
1316#define HEIGHT_INDEX 7
1317#define HEIGHT_SHIFT 11
1318#define HEIGHT_MASK 0x3f800
1319
1320static inline css_error set_height(css_computed_style *style, uint8_t type,
1321 css_fixed length, css_unit unit)
1322{
1323 uint32_t *bits = &style->i.bits[HEIGHT_INDEX];
1324
1325 /* 7bits: uuuuutt : unit | type */
1326 *bits = (*bits & ~HEIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit <<
1327 2)) << HEIGHT_SHIFT);
1328
1329 style->i.height = length;
1330
1331 return CSS_OK;
1332}
1333#undef HEIGHT_INDEX
1334#undef HEIGHT_SHIFT
1335#undef HEIGHT_MASK
1336
1337#define JUSTIFY_CONTENT_INDEX 13
1338#define JUSTIFY_CONTENT_SHIFT 10
1339#define JUSTIFY_CONTENT_MASK 0x1c00
1340
1341static inline css_error set_justify_content(css_computed_style *style, uint8_t
1342 type)
1343{
1344 uint32_t *bits = &style->i.bits[JUSTIFY_CONTENT_INDEX];
1345
1346 /* 3bits: ttt : type */
1347 *bits = (*bits & ~JUSTIFY_CONTENT_MASK) | (((uint32_t)type & 0x7) <<
1349
1350 return CSS_OK;
1351}
1352#undef JUSTIFY_CONTENT_INDEX
1353#undef JUSTIFY_CONTENT_SHIFT
1354#undef JUSTIFY_CONTENT_MASK
1355
1356#define LEFT_INDEX 7
1357#define LEFT_SHIFT 18
1358#define LEFT_MASK 0x1fc0000
1359
1360static inline css_error set_left(css_computed_style *style, uint8_t type,
1361 css_fixed length, css_unit unit)
1362{
1363 uint32_t *bits = &style->i.bits[LEFT_INDEX];
1364
1365 /* 7bits: uuuuutt : unit | type */
1366 *bits = (*bits & ~LEFT_MASK) | ((((uint32_t)type & 0x3) | (unit << 2))
1367 << LEFT_SHIFT);
1368
1369 style->i.left = length;
1370
1371 return CSS_OK;
1372}
1373#undef LEFT_INDEX
1374#undef LEFT_SHIFT
1375#undef LEFT_MASK
1376
1377#define LETTER_SPACING_INDEX 7
1378#define LETTER_SPACING_SHIFT 25
1379#define LETTER_SPACING_MASK 0xfe000000
1380
1381static inline css_error set_letter_spacing(css_computed_style *style, uint8_t
1382 type, css_fixed length, css_unit unit)
1383{
1384 uint32_t *bits = &style->i.bits[LETTER_SPACING_INDEX];
1385
1386 /* 7bits: uuuuutt : unit | type */
1387 *bits = (*bits & ~LETTER_SPACING_MASK) | ((((uint32_t)type & 0x3) | (
1388 unit << 2)) << LETTER_SPACING_SHIFT);
1389
1390 style->i.letter_spacing = length;
1391
1392 return CSS_OK;
1393}
1394#undef LETTER_SPACING_INDEX
1395#undef LETTER_SPACING_SHIFT
1396#undef LETTER_SPACING_MASK
1397
1398#define LINE_HEIGHT_INDEX 6
1399#define LINE_HEIGHT_SHIFT 4
1400#define LINE_HEIGHT_MASK 0x7f0
1401
1402static inline css_error set_line_height(css_computed_style *style, uint8_t
1403 type, css_fixed length, css_unit unit)
1404{
1405 uint32_t *bits = &style->i.bits[LINE_HEIGHT_INDEX];
1406
1407 /* 7bits: uuuuutt : unit | type */
1408 *bits = (*bits & ~LINE_HEIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit
1409 << 2)) << LINE_HEIGHT_SHIFT);
1410
1411 style->i.line_height = length;
1412
1413 return CSS_OK;
1414}
1415#undef LINE_HEIGHT_INDEX
1416#undef LINE_HEIGHT_SHIFT
1417#undef LINE_HEIGHT_MASK
1418
1419#define LIST_STYLE_IMAGE_INDEX 14
1420#define LIST_STYLE_IMAGE_SHIFT 23
1421#define LIST_STYLE_IMAGE_MASK 0x800000
1422
1423static inline css_error set_list_style_image(css_computed_style *style, uint8_t
1424 type, lwc_string *string)
1425{
1426 uint32_t *bits = &style->i.bits[LIST_STYLE_IMAGE_INDEX];
1427
1428 /* 1bit: t : type */
1429 *bits = (*bits & ~LIST_STYLE_IMAGE_MASK) | (((uint32_t)type & 0x1) <<
1431
1432 lwc_string *old_string = style->i.list_style_image;
1433
1434 if (string != NULL) {
1435 style->i.list_style_image = lwc_string_ref(string);
1436 } else {
1437 style->i.list_style_image = NULL;
1438 }
1439
1440 if (old_string != NULL)
1441 lwc_string_unref(old_string);
1442
1443 return CSS_OK;
1444}
1445#undef LIST_STYLE_IMAGE_INDEX
1446#undef LIST_STYLE_IMAGE_SHIFT
1447#undef LIST_STYLE_IMAGE_MASK
1448
1449#define LIST_STYLE_POSITION_INDEX 10
1450#define LIST_STYLE_POSITION_SHIFT 4
1451#define LIST_STYLE_POSITION_MASK 0x30
1452
1453static inline css_error set_list_style_position(css_computed_style *style,
1454 uint8_t type)
1455{
1456 uint32_t *bits = &style->i.bits[LIST_STYLE_POSITION_INDEX];
1457
1458 /* 2bits: tt : type */
1459 *bits = (*bits & ~LIST_STYLE_POSITION_MASK) | (((uint32_t)type & 0x3)
1461
1462 return CSS_OK;
1463}
1464#undef LIST_STYLE_POSITION_INDEX
1465#undef LIST_STYLE_POSITION_SHIFT
1466#undef LIST_STYLE_POSITION_MASK
1467
1468#define LIST_STYLE_TYPE_INDEX 8
1469#define LIST_STYLE_TYPE_SHIFT 8
1470#define LIST_STYLE_TYPE_MASK 0x3f00
1471
1472static inline css_error set_list_style_type(css_computed_style *style, uint8_t
1473 type)
1474{
1475 uint32_t *bits = &style->i.bits[LIST_STYLE_TYPE_INDEX];
1476
1477 /* 6bits: tttttt : type */
1478 *bits = (*bits & ~LIST_STYLE_TYPE_MASK) | (((uint32_t)type & 0x3f) <<
1480
1481 return CSS_OK;
1482}
1483#undef LIST_STYLE_TYPE_INDEX
1484#undef LIST_STYLE_TYPE_SHIFT
1485#undef LIST_STYLE_TYPE_MASK
1486
1487#define MARGIN_BOTTOM_INDEX 6
1488#define MARGIN_BOTTOM_SHIFT 11
1489#define MARGIN_BOTTOM_MASK 0x3f800
1490
1491static inline css_error set_margin_bottom(css_computed_style *style, uint8_t
1492 type, css_fixed length, css_unit unit)
1493{
1494 uint32_t *bits = &style->i.bits[MARGIN_BOTTOM_INDEX];
1495
1496 /* 7bits: uuuuutt : unit | type */
1497 *bits = (*bits & ~MARGIN_BOTTOM_MASK) | ((((uint32_t)type & 0x3) | (
1498 unit << 2)) << MARGIN_BOTTOM_SHIFT);
1499
1500 style->i.margin_bottom = length;
1501
1502 return CSS_OK;
1503}
1504#undef MARGIN_BOTTOM_INDEX
1505#undef MARGIN_BOTTOM_SHIFT
1506#undef MARGIN_BOTTOM_MASK
1507
1508#define MARGIN_LEFT_INDEX 6
1509#define MARGIN_LEFT_SHIFT 18
1510#define MARGIN_LEFT_MASK 0x1fc0000
1511
1512static inline css_error set_margin_left(css_computed_style *style, uint8_t
1513 type, css_fixed length, css_unit unit)
1514{
1515 uint32_t *bits = &style->i.bits[MARGIN_LEFT_INDEX];
1516
1517 /* 7bits: uuuuutt : unit | type */
1518 *bits = (*bits & ~MARGIN_LEFT_MASK) | ((((uint32_t)type & 0x3) | (unit
1519 << 2)) << MARGIN_LEFT_SHIFT);
1520
1521 style->i.margin_left = length;
1522
1523 return CSS_OK;
1524}
1525#undef MARGIN_LEFT_INDEX
1526#undef MARGIN_LEFT_SHIFT
1527#undef MARGIN_LEFT_MASK
1528
1529#define MARGIN_RIGHT_INDEX 6
1530#define MARGIN_RIGHT_SHIFT 25
1531#define MARGIN_RIGHT_MASK 0xfe000000
1532
1533static inline css_error set_margin_right(css_computed_style *style, uint8_t
1534 type, css_fixed length, css_unit unit)
1535{
1536 uint32_t *bits = &style->i.bits[MARGIN_RIGHT_INDEX];
1537
1538 /* 7bits: uuuuutt : unit | type */
1539 *bits = (*bits & ~MARGIN_RIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit
1540 << 2)) << MARGIN_RIGHT_SHIFT);
1541
1542 style->i.margin_right = length;
1543
1544 return CSS_OK;
1545}
1546#undef MARGIN_RIGHT_INDEX
1547#undef MARGIN_RIGHT_SHIFT
1548#undef MARGIN_RIGHT_MASK
1549
1550#define MARGIN_TOP_INDEX 5
1551#define MARGIN_TOP_SHIFT 4
1552#define MARGIN_TOP_MASK 0x7f0
1553
1554static inline css_error set_margin_top(css_computed_style *style, uint8_t type,
1555 css_fixed length, css_unit unit)
1556{
1557 uint32_t *bits = &style->i.bits[MARGIN_TOP_INDEX];
1558
1559 /* 7bits: uuuuutt : unit | type */
1560 *bits = (*bits & ~MARGIN_TOP_MASK) | ((((uint32_t)type & 0x3) | (unit
1561 << 2)) << MARGIN_TOP_SHIFT);
1562
1563 style->i.margin_top = length;
1564
1565 return CSS_OK;
1566}
1567#undef MARGIN_TOP_INDEX
1568#undef MARGIN_TOP_SHIFT
1569#undef MARGIN_TOP_MASK
1570
1571#define MAX_HEIGHT_INDEX 5
1572#define MAX_HEIGHT_SHIFT 11
1573#define MAX_HEIGHT_MASK 0x3f800
1574
1575static inline css_error set_max_height(css_computed_style *style, uint8_t type,
1576 css_fixed length, css_unit unit)
1577{
1578 uint32_t *bits = &style->i.bits[MAX_HEIGHT_INDEX];
1579
1580 /* 7bits: uuuuutt : unit | type */
1581 *bits = (*bits & ~MAX_HEIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit
1582 << 2)) << MAX_HEIGHT_SHIFT);
1583
1584 style->i.max_height = length;
1585
1586 return CSS_OK;
1587}
1588#undef MAX_HEIGHT_INDEX
1589#undef MAX_HEIGHT_SHIFT
1590#undef MAX_HEIGHT_MASK
1591
1592#define MAX_WIDTH_INDEX 5
1593#define MAX_WIDTH_SHIFT 18
1594#define MAX_WIDTH_MASK 0x1fc0000
1595
1596static inline css_error set_max_width(css_computed_style *style, uint8_t type,
1597 css_fixed length, css_unit unit)
1598{
1599 uint32_t *bits = &style->i.bits[MAX_WIDTH_INDEX];
1600
1601 /* 7bits: uuuuutt : unit | type */
1602 *bits = (*bits & ~MAX_WIDTH_MASK) | ((((uint32_t)type & 0x3) | (unit <<
1603 2)) << MAX_WIDTH_SHIFT);
1604
1605 style->i.max_width = length;
1606
1607 return CSS_OK;
1608}
1609#undef MAX_WIDTH_INDEX
1610#undef MAX_WIDTH_SHIFT
1611#undef MAX_WIDTH_MASK
1612
1613#define MIN_HEIGHT_INDEX 5
1614#define MIN_HEIGHT_SHIFT 25
1615#define MIN_HEIGHT_MASK 0xfe000000
1616
1617static inline css_error set_min_height(css_computed_style *style, uint8_t type,
1618 css_fixed length, css_unit unit)
1619{
1620 uint32_t *bits = &style->i.bits[MIN_HEIGHT_INDEX];
1621
1622 /* 7bits: uuuuutt : unit | type */
1623 *bits = (*bits & ~MIN_HEIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit
1624 << 2)) << MIN_HEIGHT_SHIFT);
1625
1626 style->i.min_height = length;
1627
1628 return CSS_OK;
1629}
1630#undef MIN_HEIGHT_INDEX
1631#undef MIN_HEIGHT_SHIFT
1632#undef MIN_HEIGHT_MASK
1633
1634#define MIN_WIDTH_INDEX 4
1635#define MIN_WIDTH_SHIFT 4
1636#define MIN_WIDTH_MASK 0x7f0
1637
1638static inline css_error set_min_width(css_computed_style *style, uint8_t type,
1639 css_fixed length, css_unit unit)
1640{
1641 uint32_t *bits = &style->i.bits[MIN_WIDTH_INDEX];
1642
1643 /* 7bits: uuuuutt : unit | type */
1644 *bits = (*bits & ~MIN_WIDTH_MASK) | ((((uint32_t)type & 0x3) | (unit <<
1645 2)) << MIN_WIDTH_SHIFT);
1646
1647 style->i.min_width = length;
1648
1649 return CSS_OK;
1650}
1651#undef MIN_WIDTH_INDEX
1652#undef MIN_WIDTH_SHIFT
1653#undef MIN_WIDTH_MASK
1654
1655#define OPACITY_INDEX 14
1656#define OPACITY_SHIFT 24
1657#define OPACITY_MASK 0x1000000
1658
1659static inline css_error set_opacity(css_computed_style *style, uint8_t type,
1660 css_fixed fixed)
1661{
1662 uint32_t *bits = &style->i.bits[OPACITY_INDEX];
1663
1664 /* 1bit: t : type */
1665 *bits = (*bits & ~OPACITY_MASK) | (((uint32_t)type & 0x1) <<
1667
1668 style->i.opacity = fixed;
1669
1670 return CSS_OK;
1671}
1672#undef OPACITY_INDEX
1673#undef OPACITY_SHIFT
1674#undef OPACITY_MASK
1675
1676#define ORDER_INDEX 14
1677#define ORDER_SHIFT 25
1678#define ORDER_MASK 0x2000000
1679
1680static inline css_error set_order(css_computed_style *style, uint8_t type,
1681 int32_t integer)
1682{
1683 uint32_t *bits = &style->i.bits[ORDER_INDEX];
1684
1685 /* 1bit: t : type */
1686 *bits = (*bits & ~ORDER_MASK) | (((uint32_t)type & 0x1) << ORDER_SHIFT);
1687
1688 style->i.order = integer;
1689
1690 return CSS_OK;
1691}
1692#undef ORDER_INDEX
1693#undef ORDER_SHIFT
1694#undef ORDER_MASK
1695
1696#define ORPHANS_INDEX 14
1697#define ORPHANS_SHIFT 26
1698#define ORPHANS_MASK 0x4000000
1699
1700static inline css_error set_orphans(css_computed_style *style, uint8_t type,
1701 int32_t integer)
1702{
1703 uint32_t *bits = &style->i.bits[ORPHANS_INDEX];
1704
1705 /* 1bit: t : type */
1706 *bits = (*bits & ~ORPHANS_MASK) | (((uint32_t)type & 0x1) <<
1708
1709 style->i.orphans = integer;
1710
1711 return CSS_OK;
1712}
1713#undef ORPHANS_INDEX
1714#undef ORPHANS_SHIFT
1715#undef ORPHANS_MASK
1716
1717#define OUTLINE_COLOR_INDEX 10
1718#define OUTLINE_COLOR_SHIFT 6
1719#define OUTLINE_COLOR_MASK 0xc0
1720
1721static inline css_error set_outline_color(css_computed_style *style, uint8_t
1722 type, css_color color)
1723{
1724 uint32_t *bits = &style->i.bits[OUTLINE_COLOR_INDEX];
1725
1726 /* 2bits: tt : type */
1727 *bits = (*bits & ~OUTLINE_COLOR_MASK) | (((uint32_t)type & 0x3) <<
1729
1730 style->i.outline_color = color;
1731
1732 return CSS_OK;
1733}
1734#undef OUTLINE_COLOR_INDEX
1735#undef OUTLINE_COLOR_SHIFT
1736#undef OUTLINE_COLOR_MASK
1737
1738#define OUTLINE_STYLE_INDEX 5
1739#define OUTLINE_STYLE_SHIFT 0
1740#define OUTLINE_STYLE_MASK 0xf
1741
1742static inline css_error set_outline_style(css_computed_style *style, uint8_t
1743 type)
1744{
1745 uint32_t *bits = &style->i.bits[OUTLINE_STYLE_INDEX];
1746
1747 /* 4bits: tttt : type */
1748 *bits = (*bits & ~OUTLINE_STYLE_MASK) | (((uint32_t)type & 0xf) <<
1750
1751 return CSS_OK;
1752}
1753#undef OUTLINE_STYLE_INDEX
1754#undef OUTLINE_STYLE_SHIFT
1755#undef OUTLINE_STYLE_MASK
1756
1757#define OUTLINE_WIDTH_INDEX 1
1758#define OUTLINE_WIDTH_SHIFT 15
1759#define OUTLINE_WIDTH_MASK 0x7f8000
1760
1761static inline css_error set_outline_width(css_computed_style *style, uint8_t
1762 type, css_fixed length, css_unit unit)
1763{
1764 uint32_t *bits = &style->i.bits[OUTLINE_WIDTH_INDEX];
1765
1766 /* 8bits: uuuuuttt : unit | type */
1767 *bits = (*bits & ~OUTLINE_WIDTH_MASK) | ((((uint32_t)type & 0x7) | (
1768 unit << 3)) << OUTLINE_WIDTH_SHIFT);
1769
1770 style->i.outline_width = length;
1771
1772 return CSS_OK;
1773}
1774#undef OUTLINE_WIDTH_INDEX
1775#undef OUTLINE_WIDTH_SHIFT
1776#undef OUTLINE_WIDTH_MASK
1777
1778#define OVERFLOW_X_INDEX 13
1779#define OVERFLOW_X_SHIFT 13
1780#define OVERFLOW_X_MASK 0xe000
1781
1782static inline css_error set_overflow_x(css_computed_style *style, uint8_t type)
1783{
1784 uint32_t *bits = &style->i.bits[OVERFLOW_X_INDEX];
1785
1786 /* 3bits: ttt : type */
1787 *bits = (*bits & ~OVERFLOW_X_MASK) | (((uint32_t)type & 0x7) <<
1789
1790 return CSS_OK;
1791}
1792#undef OVERFLOW_X_INDEX
1793#undef OVERFLOW_X_SHIFT
1794#undef OVERFLOW_X_MASK
1795
1796#define OVERFLOW_Y_INDEX 13
1797#define OVERFLOW_Y_SHIFT 16
1798#define OVERFLOW_Y_MASK 0x70000
1799
1800static inline css_error set_overflow_y(css_computed_style *style, uint8_t type)
1801{
1802 uint32_t *bits = &style->i.bits[OVERFLOW_Y_INDEX];
1803
1804 /* 3bits: ttt : type */
1805 *bits = (*bits & ~OVERFLOW_Y_MASK) | (((uint32_t)type & 0x7) <<
1807
1808 return CSS_OK;
1809}
1810#undef OVERFLOW_Y_INDEX
1811#undef OVERFLOW_Y_SHIFT
1812#undef OVERFLOW_Y_MASK
1813
1814#define PADDING_BOTTOM_INDEX 8
1815#define PADDING_BOTTOM_SHIFT 14
1816#define PADDING_BOTTOM_MASK 0xfc000
1817
1818static inline css_error set_padding_bottom(css_computed_style *style, uint8_t
1819 type, css_fixed length, css_unit unit)
1820{
1821 uint32_t *bits = &style->i.bits[PADDING_BOTTOM_INDEX];
1822
1823 /* 6bits: uuuuut : unit | type */
1824 *bits = (*bits & ~PADDING_BOTTOM_MASK) | ((((uint32_t)type & 0x1) | (
1825 unit << 1)) << PADDING_BOTTOM_SHIFT);
1826
1827 style->i.padding_bottom = length;
1828
1829 return CSS_OK;
1830}
1831#undef PADDING_BOTTOM_INDEX
1832#undef PADDING_BOTTOM_SHIFT
1833#undef PADDING_BOTTOM_MASK
1834
1835#define PADDING_LEFT_INDEX 8
1836#define PADDING_LEFT_SHIFT 20
1837#define PADDING_LEFT_MASK 0x3f00000
1838
1839static inline css_error set_padding_left(css_computed_style *style, uint8_t
1840 type, css_fixed length, css_unit unit)
1841{
1842 uint32_t *bits = &style->i.bits[PADDING_LEFT_INDEX];
1843
1844 /* 6bits: uuuuut : unit | type */
1845 *bits = (*bits & ~PADDING_LEFT_MASK) | ((((uint32_t)type & 0x1) | (unit
1846 << 1)) << PADDING_LEFT_SHIFT);
1847
1848 style->i.padding_left = length;
1849
1850 return CSS_OK;
1851}
1852#undef PADDING_LEFT_INDEX
1853#undef PADDING_LEFT_SHIFT
1854#undef PADDING_LEFT_MASK
1855
1856#define PADDING_RIGHT_INDEX 8
1857#define PADDING_RIGHT_SHIFT 26
1858#define PADDING_RIGHT_MASK 0xfc000000
1859
1860static inline css_error set_padding_right(css_computed_style *style, uint8_t
1861 type, css_fixed length, css_unit unit)
1862{
1863 uint32_t *bits = &style->i.bits[PADDING_RIGHT_INDEX];
1864
1865 /* 6bits: uuuuut : unit | type */
1866 *bits = (*bits & ~PADDING_RIGHT_MASK) | ((((uint32_t)type & 0x1) | (
1867 unit << 1)) << PADDING_RIGHT_SHIFT);
1868
1869 style->i.padding_right = length;
1870
1871 return CSS_OK;
1872}
1873#undef PADDING_RIGHT_INDEX
1874#undef PADDING_RIGHT_SHIFT
1875#undef PADDING_RIGHT_MASK
1876
1877#define PADDING_TOP_INDEX 3
1878#define PADDING_TOP_SHIFT 5
1879#define PADDING_TOP_MASK 0x7e0
1880
1881static inline css_error set_padding_top(css_computed_style *style, uint8_t
1882 type, css_fixed length, css_unit unit)
1883{
1884 uint32_t *bits = &style->i.bits[PADDING_TOP_INDEX];
1885
1886 /* 6bits: uuuuut : unit | type */
1887 *bits = (*bits & ~PADDING_TOP_MASK) | ((((uint32_t)type & 0x1) | (unit
1888 << 1)) << PADDING_TOP_SHIFT);
1889
1890 style->i.padding_top = length;
1891
1892 return CSS_OK;
1893}
1894#undef PADDING_TOP_INDEX
1895#undef PADDING_TOP_SHIFT
1896#undef PADDING_TOP_MASK
1897
1898#define PAGE_BREAK_AFTER_INDEX 13
1899#define PAGE_BREAK_AFTER_SHIFT 19
1900#define PAGE_BREAK_AFTER_MASK 0x380000
1901
1902static inline css_error set_page_break_after(css_computed_style *style, uint8_t
1903 type)
1904{
1905 uint32_t *bits = &style->i.bits[PAGE_BREAK_AFTER_INDEX];
1906
1907 /* 3bits: ttt : type */
1908 *bits = (*bits & ~PAGE_BREAK_AFTER_MASK) | (((uint32_t)type & 0x7) <<
1910
1911 return CSS_OK;
1912}
1913#undef PAGE_BREAK_AFTER_INDEX
1914#undef PAGE_BREAK_AFTER_SHIFT
1915#undef PAGE_BREAK_AFTER_MASK
1916
1917#define PAGE_BREAK_BEFORE_INDEX 13
1918#define PAGE_BREAK_BEFORE_SHIFT 22
1919#define PAGE_BREAK_BEFORE_MASK 0x1c00000
1920
1921static inline css_error set_page_break_before(css_computed_style *style,
1922 uint8_t type)
1923{
1924 uint32_t *bits = &style->i.bits[PAGE_BREAK_BEFORE_INDEX];
1925
1926 /* 3bits: ttt : type */
1927 *bits = (*bits & ~PAGE_BREAK_BEFORE_MASK) | (((uint32_t)type & 0x7) <<
1929
1930 return CSS_OK;
1931}
1932#undef PAGE_BREAK_BEFORE_INDEX
1933#undef PAGE_BREAK_BEFORE_SHIFT
1934#undef PAGE_BREAK_BEFORE_MASK
1935
1936#define PAGE_BREAK_INSIDE_INDEX 10
1937#define PAGE_BREAK_INSIDE_SHIFT 8
1938#define PAGE_BREAK_INSIDE_MASK 0x300
1939
1940static inline css_error set_page_break_inside(css_computed_style *style,
1941 uint8_t type)
1942{
1943 uint32_t *bits = &style->i.bits[PAGE_BREAK_INSIDE_INDEX];
1944
1945 /* 2bits: tt : type */
1946 *bits = (*bits & ~PAGE_BREAK_INSIDE_MASK) | (((uint32_t)type & 0x3) <<
1948
1949 return CSS_OK;
1950}
1951#undef PAGE_BREAK_INSIDE_INDEX
1952#undef PAGE_BREAK_INSIDE_SHIFT
1953#undef PAGE_BREAK_INSIDE_MASK
1954
1955#define POSITION_INDEX 13
1956#define POSITION_SHIFT 25
1957#define POSITION_MASK 0xe000000
1958
1959static inline css_error set_position(css_computed_style *style, uint8_t type)
1960{
1961 uint32_t *bits = &style->i.bits[POSITION_INDEX];
1962
1963 /* 3bits: ttt : type */
1964 *bits = (*bits & ~POSITION_MASK) | (((uint32_t)type & 0x7) <<
1966
1967 return CSS_OK;
1968}
1969#undef POSITION_INDEX
1970#undef POSITION_SHIFT
1971#undef POSITION_MASK
1972
1973#define QUOTES_INDEX 14
1974#define QUOTES_SHIFT 27
1975#define QUOTES_MASK 0x8000000
1976
1977static inline css_error set_quotes(css_computed_style *style, uint8_t type,
1978 lwc_string **string_arr)
1979{
1980 uint32_t *bits = &style->i.bits[QUOTES_INDEX];
1981
1982 /* 1bit: t : type */
1983 *bits = (*bits & ~QUOTES_MASK) | (((uint32_t)type & 0x1) <<
1984 QUOTES_SHIFT);
1985
1986 lwc_string **old_string_arr = style->quotes;
1987 lwc_string **s;
1988
1989 for (s = string_arr; s != NULL && *s != NULL; s++)
1990 *s = lwc_string_ref(*s);
1991
1992 style->quotes = string_arr;
1993
1994 /* Free existing array */
1995 if (old_string_arr != NULL) {
1996 for (s = old_string_arr; *s != NULL; s++)
1997 lwc_string_unref(*s);
1998
1999 if (old_string_arr != string_arr)
2000 free(old_string_arr);
2001 }
2002
2003 return CSS_OK;
2004}
2005#undef QUOTES_INDEX
2006#undef QUOTES_SHIFT
2007#undef QUOTES_MASK
2008
2009#define RIGHT_INDEX 4
2010#define RIGHT_SHIFT 11
2011#define RIGHT_MASK 0x3f800
2012
2013static inline css_error set_right(css_computed_style *style, uint8_t type,
2014 css_fixed length, css_unit unit)
2015{
2016 uint32_t *bits = &style->i.bits[RIGHT_INDEX];
2017
2018 /* 7bits: uuuuutt : unit | type */
2019 *bits = (*bits & ~RIGHT_MASK) | ((((uint32_t)type & 0x3) | (unit << 2))
2020 << RIGHT_SHIFT);
2021
2022 style->i.right = length;
2023
2024 return CSS_OK;
2025}
2026#undef RIGHT_INDEX
2027#undef RIGHT_SHIFT
2028#undef RIGHT_MASK
2029
2030#define STROKE_OPACITY_INDEX 13
2031#define STROKE_OPACITY_SHIFT 0
2032#define STROKE_OPACITY_MASK 0x1
2033
2034static inline css_error set_stroke_opacity(css_computed_style *style, uint8_t
2035 type, css_fixed fixed)
2036{
2037 uint32_t *bits = &style->i.bits[STROKE_OPACITY_INDEX];
2038
2039 /* 1bit: t : type */
2040 *bits = (*bits & ~STROKE_OPACITY_MASK) | (((uint32_t)type & 0x1) <<
2042
2043 style->i.stroke_opacity = fixed;
2044
2045 return CSS_OK;
2046}
2047#undef STROKE_OPACITY_INDEX
2048#undef STROKE_OPACITY_SHIFT
2049#undef STROKE_OPACITY_MASK
2050
2051#define TABLE_LAYOUT_INDEX 10
2052#define TABLE_LAYOUT_SHIFT 10
2053#define TABLE_LAYOUT_MASK 0xc00
2054
2055static inline css_error set_table_layout(css_computed_style *style, uint8_t
2056 type)
2057{
2058 uint32_t *bits = &style->i.bits[TABLE_LAYOUT_INDEX];
2059
2060 /* 2bits: tt : type */
2061 *bits = (*bits & ~TABLE_LAYOUT_MASK) | (((uint32_t)type & 0x3) <<
2063
2064 return CSS_OK;
2065}
2066#undef TABLE_LAYOUT_INDEX
2067#undef TABLE_LAYOUT_SHIFT
2068#undef TABLE_LAYOUT_MASK
2069
2070#define TEXT_ALIGN_INDEX 4
2071#define TEXT_ALIGN_SHIFT 0
2072#define TEXT_ALIGN_MASK 0xf
2073
2074static inline css_error set_text_align(css_computed_style *style, uint8_t type)
2075{
2076 uint32_t *bits = &style->i.bits[TEXT_ALIGN_INDEX];
2077
2078 /* 4bits: tttt : type */
2079 *bits = (*bits & ~TEXT_ALIGN_MASK) | (((uint32_t)type & 0xf) <<
2081
2082 return CSS_OK;
2083}
2084#undef TEXT_ALIGN_INDEX
2085#undef TEXT_ALIGN_SHIFT
2086#undef TEXT_ALIGN_MASK
2087
2088#define TEXT_DECORATION_INDEX 3
2089#define TEXT_DECORATION_SHIFT 0
2090#define TEXT_DECORATION_MASK 0x1f
2091
2092static inline css_error set_text_decoration(css_computed_style *style, uint8_t
2093 type)
2094{
2095 uint32_t *bits = &style->i.bits[TEXT_DECORATION_INDEX];
2096
2097 /* 5bits: ttttt : type */
2098 *bits = (*bits & ~TEXT_DECORATION_MASK) | (((uint32_t)type & 0x1f) <<
2100
2101 return CSS_OK;
2102}
2103#undef TEXT_DECORATION_INDEX
2104#undef TEXT_DECORATION_SHIFT
2105#undef TEXT_DECORATION_MASK
2106
2107#define TEXT_INDENT_INDEX 2
2108#define TEXT_INDENT_SHIFT 0
2109#define TEXT_INDENT_MASK 0x3f
2110
2111static inline css_error set_text_indent(css_computed_style *style, uint8_t
2112 type, css_fixed length, css_unit unit)
2113{
2114 uint32_t *bits = &style->i.bits[TEXT_INDENT_INDEX];
2115
2116 /* 6bits: uuuuut : unit | type */
2117 *bits = (*bits & ~TEXT_INDENT_MASK) | ((((uint32_t)type & 0x1) | (unit
2118 << 1)) << TEXT_INDENT_SHIFT);
2119
2120 style->i.text_indent = length;
2121
2122 return CSS_OK;
2123}
2124#undef TEXT_INDENT_INDEX
2125#undef TEXT_INDENT_SHIFT
2126#undef TEXT_INDENT_MASK
2127
2128#define TEXT_TRANSFORM_INDEX 9
2129#define TEXT_TRANSFORM_SHIFT 0
2130#define TEXT_TRANSFORM_MASK 0x7
2131
2132static inline css_error set_text_transform(css_computed_style *style, uint8_t
2133 type)
2134{
2135 uint32_t *bits = &style->i.bits[TEXT_TRANSFORM_INDEX];
2136
2137 /* 3bits: ttt : type */
2138 *bits = (*bits & ~TEXT_TRANSFORM_MASK) | (((uint32_t)type & 0x7) <<
2140
2141 return CSS_OK;
2142}
2143#undef TEXT_TRANSFORM_INDEX
2144#undef TEXT_TRANSFORM_SHIFT
2145#undef TEXT_TRANSFORM_MASK
2146
2147#define TOP_INDEX 4
2148#define TOP_SHIFT 18
2149#define TOP_MASK 0x1fc0000
2150
2151static inline css_error set_top(css_computed_style *style, uint8_t type,
2152 css_fixed length, css_unit unit)
2153{
2154 uint32_t *bits = &style->i.bits[TOP_INDEX];
2155
2156 /* 7bits: uuuuutt : unit | type */
2157 *bits = (*bits & ~TOP_MASK) | ((((uint32_t)type & 0x3) | (unit << 2))
2158 << TOP_SHIFT);
2159
2160 style->i.top = length;
2161
2162 return CSS_OK;
2163}
2164#undef TOP_INDEX
2165#undef TOP_SHIFT
2166#undef TOP_MASK
2167
2168#define UNICODE_BIDI_INDEX 10
2169#define UNICODE_BIDI_SHIFT 12
2170#define UNICODE_BIDI_MASK 0x3000
2171
2172static inline css_error set_unicode_bidi(css_computed_style *style, uint8_t
2173 type)
2174{
2175 uint32_t *bits = &style->i.bits[UNICODE_BIDI_INDEX];
2176
2177 /* 2bits: tt : type */
2178 *bits = (*bits & ~UNICODE_BIDI_MASK) | (((uint32_t)type & 0x3) <<
2180
2181 return CSS_OK;
2182}
2183#undef UNICODE_BIDI_INDEX
2184#undef UNICODE_BIDI_SHIFT
2185#undef UNICODE_BIDI_MASK
2186
2187#define VERTICAL_ALIGN_INDEX 12
2188#define VERTICAL_ALIGN_SHIFT 1
2189#define VERTICAL_ALIGN_MASK 0x3fe
2190
2191static inline css_error set_vertical_align(css_computed_style *style, uint8_t
2192 type, css_fixed length, css_unit unit)
2193{
2194 uint32_t *bits = &style->i.bits[VERTICAL_ALIGN_INDEX];
2195
2196 /* 9bits: uuuuutttt : unit | type */
2197 *bits = (*bits & ~VERTICAL_ALIGN_MASK) | ((((uint32_t)type & 0xf) | (
2198 unit << 4)) << VERTICAL_ALIGN_SHIFT);
2199
2200 style->i.vertical_align = length;
2201
2202 return CSS_OK;
2203}
2204#undef VERTICAL_ALIGN_INDEX
2205#undef VERTICAL_ALIGN_SHIFT
2206#undef VERTICAL_ALIGN_MASK
2207
2208#define VISIBILITY_INDEX 10
2209#define VISIBILITY_SHIFT 14
2210#define VISIBILITY_MASK 0xc000
2211
2212static inline css_error set_visibility(css_computed_style *style, uint8_t type)
2213{
2214 uint32_t *bits = &style->i.bits[VISIBILITY_INDEX];
2215
2216 /* 2bits: tt : type */
2217 *bits = (*bits & ~VISIBILITY_MASK) | (((uint32_t)type & 0x3) <<
2219
2220 return CSS_OK;
2221}
2222#undef VISIBILITY_INDEX
2223#undef VISIBILITY_SHIFT
2224#undef VISIBILITY_MASK
2225
2226#define WHITE_SPACE_INDEX 8
2227#define WHITE_SPACE_SHIFT 0
2228#define WHITE_SPACE_MASK 0x7
2229
2230static inline css_error set_white_space(css_computed_style *style, uint8_t type)
2231{
2232 uint32_t *bits = &style->i.bits[WHITE_SPACE_INDEX];
2233
2234 /* 3bits: ttt : type */
2235 *bits = (*bits & ~WHITE_SPACE_MASK) | (((uint32_t)type & 0x7) <<
2237
2238 return CSS_OK;
2239}
2240#undef WHITE_SPACE_INDEX
2241#undef WHITE_SPACE_SHIFT
2242#undef WHITE_SPACE_MASK
2243
2244#define WIDOWS_INDEX 12
2245#define WIDOWS_SHIFT 0
2246#define WIDOWS_MASK 0x1
2247
2248static inline css_error set_widows(css_computed_style *style, uint8_t type,
2249 int32_t integer)
2250{
2251 uint32_t *bits = &style->i.bits[WIDOWS_INDEX];
2252
2253 /* 1bit: t : type */
2254 *bits = (*bits & ~WIDOWS_MASK) | (((uint32_t)type & 0x1) <<
2255 WIDOWS_SHIFT);
2256
2257 style->i.widows = integer;
2258
2259 return CSS_OK;
2260}
2261#undef WIDOWS_INDEX
2262#undef WIDOWS_SHIFT
2263#undef WIDOWS_MASK
2264
2265#define WIDTH_INDEX 4
2266#define WIDTH_SHIFT 25
2267#define WIDTH_MASK 0xfe000000
2268
2269static inline css_error set_width(css_computed_style *style, uint8_t type,
2270 css_fixed length, css_unit unit)
2271{
2272 uint32_t *bits = &style->i.bits[WIDTH_INDEX];
2273
2274 /* 7bits: uuuuutt : unit | type */
2275 *bits = (*bits & ~WIDTH_MASK) | ((((uint32_t)type & 0x3) | (unit << 2))
2276 << WIDTH_SHIFT);
2277
2278 style->i.width = length;
2279
2280 return CSS_OK;
2281}
2282#undef WIDTH_INDEX
2283#undef WIDTH_SHIFT
2284#undef WIDTH_MASK
2285
2286#define WORD_SPACING_INDEX 1
2287#define WORD_SPACING_SHIFT 0
2288#define WORD_SPACING_MASK 0x7f
2289
2290static inline css_error set_word_spacing(css_computed_style *style, uint8_t
2291 type, css_fixed length, css_unit unit)
2292{
2293 uint32_t *bits = &style->i.bits[WORD_SPACING_INDEX];
2294
2295 /* 7bits: uuuuutt : unit | type */
2296 *bits = (*bits & ~WORD_SPACING_MASK) | ((((uint32_t)type & 0x3) | (unit
2297 << 2)) << WORD_SPACING_SHIFT);
2298
2299 style->i.word_spacing = length;
2300
2301 return CSS_OK;
2302}
2303#undef WORD_SPACING_INDEX
2304#undef WORD_SPACING_SHIFT
2305#undef WORD_SPACING_MASK
2306
2307#define WRITING_MODE_INDEX 10
2308#define WRITING_MODE_SHIFT 16
2309#define WRITING_MODE_MASK 0x30000
2310
2311static inline css_error set_writing_mode(css_computed_style *style, uint8_t
2312 type)
2313{
2314 uint32_t *bits = &style->i.bits[WRITING_MODE_INDEX];
2315
2316 /* 2bits: tt : type */
2317 *bits = (*bits & ~WRITING_MODE_MASK) | (((uint32_t)type & 0x3) <<
2319
2320 return CSS_OK;
2321}
2322#undef WRITING_MODE_INDEX
2323#undef WRITING_MODE_SHIFT
2324#undef WRITING_MODE_MASK
2325
2326#define Z_INDEX_INDEX 10
2327#define Z_INDEX_SHIFT 18
2328#define Z_INDEX_MASK 0xc0000
2329
2330static inline css_error set_z_index(css_computed_style *style, uint8_t type,
2331 int32_t integer)
2332{
2333 uint32_t *bits = &style->i.bits[Z_INDEX_INDEX];
2334
2335 /* 2bits: tt : type */
2336 *bits = (*bits & ~Z_INDEX_MASK) | (((uint32_t)type & 0x3) <<
2338
2339 style->i.z_index = integer;
2340
2341 return CSS_OK;
2342}
2343#undef Z_INDEX_INDEX
2344#undef Z_INDEX_SHIFT
2345#undef Z_INDEX_MASK
css_unit
Definition types.h:82
uint32_t css_color
Definition types.h:79
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
unsigned char uint8_t
Definition acefiex.h:161
#define NULL
Definition actypes.h:561
#define TOP_INDEX
Definition autogenerated_propset.h:2147
#define COUNTER_RESET_INDEX
Definition autogenerated_propset.h:940
#define VISIBILITY_SHIFT
Definition autogenerated_propset.h:2209
#define STROKE_OPACITY_SHIFT
Definition autogenerated_propset.h:2031
#define PADDING_TOP_SHIFT
Definition autogenerated_propset.h:1878
#define LIST_STYLE_POSITION_SHIFT
Definition autogenerated_propset.h:1450
#define TABLE_LAYOUT_SHIFT
Definition autogenerated_propset.h:2052
#define BORDER_LEFT_COLOR_SHIFT
Definition autogenerated_propset.h:261
#define BORDER_BOTTOM_STYLE_INDEX
Definition autogenerated_propset.h:201
#define MARGIN_BOTTOM_SHIFT
Definition autogenerated_propset.h:1488
#define COUNTER_INCREMENT_SHIFT
Definition autogenerated_propset.h:905
#define LEFT_INDEX
Definition autogenerated_propset.h:1356
#define COLOR_INDEX
Definition autogenerated_propset.h:641
#define OUTLINE_WIDTH_INDEX
Definition autogenerated_propset.h:1757
#define FLEX_SHRINK_INDEX
Definition autogenerated_propset.h:1148
#define PADDING_TOP_INDEX
Definition autogenerated_propset.h:1877
#define WORD_SPACING_SHIFT
Definition autogenerated_propset.h:2287
#define BOX_SIZING_INDEX
Definition autogenerated_propset.h:488
#define TOP_SHIFT
Definition autogenerated_propset.h:2148
#define DISPLAY_INDEX
Definition autogenerated_propset.h:1030
#define BREAK_BEFORE_INDEX
Definition autogenerated_propset.h:524
#define OVERFLOW_X_SHIFT
Definition autogenerated_propset.h:1779
#define BORDER_COLLAPSE_SHIFT
Definition autogenerated_propset.h:242
#define WORD_SPACING_INDEX
Definition autogenerated_propset.h:2286
#define MIN_HEIGHT_INDEX
Definition autogenerated_propset.h:1613
#define COLUMN_WIDTH_INDEX
Definition autogenerated_propset.h:800
#define CONTENT_SHIFT
Definition autogenerated_propset.h:822
#define LIST_STYLE_IMAGE_INDEX
Definition autogenerated_propset.h:1419
#define BORDER_LEFT_WIDTH_INDEX
Definition autogenerated_propset.h:300
#define PADDING_BOTTOM_INDEX
Definition autogenerated_propset.h:1814
#define PADDING_LEFT_SHIFT
Definition autogenerated_propset.h:1836
#define BORDER_BOTTOM_WIDTH_SHIFT
Definition autogenerated_propset.h:221
#define MAX_HEIGHT_SHIFT
Definition autogenerated_propset.h:1572
#define EMPTY_CELLS_SHIFT
Definition autogenerated_propset.h:1049
#define LEFT_SHIFT
Definition autogenerated_propset.h:1357
#define BACKGROUND_REPEAT_INDEX
Definition autogenerated_propset.h:161
#define MARGIN_LEFT_SHIFT
Definition autogenerated_propset.h:1509
#define DISPLAY_SHIFT
Definition autogenerated_propset.h:1031
#define FONT_SIZE_INDEX
Definition autogenerated_propset.h:1240
#define BACKGROUND_REPEAT_SHIFT
Definition autogenerated_propset.h:162
#define WIDTH_SHIFT
Definition autogenerated_propset.h:2266
#define TEXT_ALIGN_SHIFT
Definition autogenerated_propset.h:2071
#define OVERFLOW_Y_SHIFT
Definition autogenerated_propset.h:1797
#define ALIGN_CONTENT_INDEX
Definition autogenerated_propset.h:11
#define VERTICAL_ALIGN_SHIFT
Definition autogenerated_propset.h:2188
#define WIDTH_INDEX
Definition autogenerated_propset.h:2265
#define COLUMN_SPAN_INDEX
Definition autogenerated_propset.h:782
#define WRITING_MODE_SHIFT
Definition autogenerated_propset.h:2308
#define CLEAR_SHIFT
Definition autogenerated_propset.h:582
#define FLOAT_INDEX
Definition autogenerated_propset.h:1187
#define FONT_WEIGHT_SHIFT
Definition autogenerated_propset.h:1299
#define COLUMN_RULE_COLOR_INDEX
Definition autogenerated_propset.h:721
#define MAX_WIDTH_INDEX
Definition autogenerated_propset.h:1592
#define MARGIN_BOTTOM_INDEX
Definition autogenerated_propset.h:1487
#define ALIGN_SELF_SHIFT
Definition autogenerated_propset.h:49
#define ALIGN_CONTENT_SHIFT
Definition autogenerated_propset.h:12
#define FONT_WEIGHT_INDEX
Definition autogenerated_propset.h:1298
#define UNICODE_BIDI_INDEX
Definition autogenerated_propset.h:2168
#define COLUMN_COUNT_INDEX
Definition autogenerated_propset.h:661
#define STROKE_OPACITY_INDEX
Definition autogenerated_propset.h:2030
#define BORDER_RIGHT_COLOR_INDEX
Definition autogenerated_propset.h:321
#define BORDER_RIGHT_STYLE_INDEX
Definition autogenerated_propset.h:342
#define MARGIN_LEFT_INDEX
Definition autogenerated_propset.h:1508
#define BORDER_TOP_WIDTH_INDEX
Definition autogenerated_propset.h:446
#define BORDER_SPACING_INDEX
Definition autogenerated_propset.h:382
#define DIRECTION_SHIFT
Definition autogenerated_propset.h:1013
#define PADDING_RIGHT_SHIFT
Definition autogenerated_propset.h:1857
#define FONT_STYLE_SHIFT
Definition autogenerated_propset.h:1262
#define RIGHT_SHIFT
Definition autogenerated_propset.h:2010
#define RIGHT_INDEX
Definition autogenerated_propset.h:2009
#define OUTLINE_STYLE_INDEX
Definition autogenerated_propset.h:1738
#define BORDER_TOP_WIDTH_SHIFT
Definition autogenerated_propset.h:447
#define BORDER_RIGHT_WIDTH_INDEX
Definition autogenerated_propset.h:361
#define BACKGROUND_POSITION_INDEX
Definition autogenerated_propset.h:136
#define COLUMN_RULE_STYLE_SHIFT
Definition autogenerated_propset.h:743
#define FLEX_GROW_SHIFT
Definition autogenerated_propset.h:1128
#define LINE_HEIGHT_SHIFT
Definition autogenerated_propset.h:1399
#define MARGIN_RIGHT_INDEX
Definition autogenerated_propset.h:1529
#define COLUMN_GAP_SHIFT
Definition autogenerated_propset.h:701
#define FLEX_GROW_INDEX
Definition autogenerated_propset.h:1127
#define TABLE_LAYOUT_INDEX
Definition autogenerated_propset.h:2051
#define PAGE_BREAK_INSIDE_SHIFT
Definition autogenerated_propset.h:1937
#define JUSTIFY_CONTENT_INDEX
Definition autogenerated_propset.h:1337
#define WHITE_SPACE_INDEX
Definition autogenerated_propset.h:2226
#define COUNTER_RESET_SHIFT
Definition autogenerated_propset.h:941
#define MIN_WIDTH_INDEX
Definition autogenerated_propset.h:1634
#define Z_INDEX_SHIFT
Definition autogenerated_propset.h:2327
#define BORDER_SPACING_SHIFT
Definition autogenerated_propset.h:383
#define BORDER_BOTTOM_COLOR_SHIFT
Definition autogenerated_propset.h:181
#define OUTLINE_STYLE_SHIFT
Definition autogenerated_propset.h:1739
#define PAGE_BREAK_BEFORE_INDEX
Definition autogenerated_propset.h:1917
#define WHITE_SPACE_SHIFT
Definition autogenerated_propset.h:2227
#define MARGIN_TOP_INDEX
Definition autogenerated_propset.h:1550
#define FILL_OPACITY_INDEX
Definition autogenerated_propset.h:1066
#define COLUMN_FILL_SHIFT
Definition autogenerated_propset.h:683
#define BOTTOM_SHIFT
Definition autogenerated_propset.h:468
#define BOX_SIZING_SHIFT
Definition autogenerated_propset.h:489
#define FONT_STYLE_INDEX
Definition autogenerated_propset.h:1261
#define BACKGROUND_ATTACHMENT_SHIFT
Definition autogenerated_propset.h:67
#define ORDER_INDEX
Definition autogenerated_propset.h:1676
#define ALIGN_SELF_INDEX
Definition autogenerated_propset.h:48
#define TEXT_TRANSFORM_INDEX
Definition autogenerated_propset.h:2128
#define ORPHANS_SHIFT
Definition autogenerated_propset.h:1697
#define CAPTION_SIDE_INDEX
Definition autogenerated_propset.h:562
#define LIST_STYLE_TYPE_INDEX
Definition autogenerated_propset.h:1468
#define CLIP_SHIFT
Definition autogenerated_propset.h:599
#define FLEX_BASIS_SHIFT
Definition autogenerated_propset.h:1088
#define COLUMN_RULE_STYLE_INDEX
Definition autogenerated_propset.h:742
#define COLUMN_RULE_WIDTH_INDEX
Definition autogenerated_propset.h:761
#define CONTENT_INDEX
Definition autogenerated_propset.h:821
#define PAGE_BREAK_AFTER_SHIFT
Definition autogenerated_propset.h:1899
#define PAGE_BREAK_BEFORE_SHIFT
Definition autogenerated_propset.h:1918
#define UNICODE_BIDI_SHIFT
Definition autogenerated_propset.h:2169
#define COLOR_SHIFT
Definition autogenerated_propset.h:642
#define OPACITY_INDEX
Definition autogenerated_propset.h:1655
#define FLEX_BASIS_INDEX
Definition autogenerated_propset.h:1087
#define BORDER_BOTTOM_COLOR_INDEX
Definition autogenerated_propset.h:180
#define BORDER_TOP_STYLE_SHIFT
Definition autogenerated_propset.h:428
#define CURSOR_INDEX
Definition autogenerated_propset.h:976
#define VISIBILITY_INDEX
Definition autogenerated_propset.h:2208
#define MARGIN_TOP_SHIFT
Definition autogenerated_propset.h:1551
#define LIST_STYLE_IMAGE_SHIFT
Definition autogenerated_propset.h:1420
#define WIDOWS_INDEX
Definition autogenerated_propset.h:2244
#define CLEAR_INDEX
Definition autogenerated_propset.h:581
#define TEXT_INDENT_SHIFT
Definition autogenerated_propset.h:2108
#define LETTER_SPACING_INDEX
Definition autogenerated_propset.h:1377
#define FONT_SIZE_SHIFT
Definition autogenerated_propset.h:1241
#define TEXT_ALIGN_INDEX
Definition autogenerated_propset.h:2070
#define CURSOR_SHIFT
Definition autogenerated_propset.h:977
#define COUNTER_INCREMENT_INDEX
Definition autogenerated_propset.h:904
#define OPACITY_SHIFT
Definition autogenerated_propset.h:1656
#define DIRECTION_INDEX
Definition autogenerated_propset.h:1012
#define PADDING_BOTTOM_SHIFT
Definition autogenerated_propset.h:1815
#define LIST_STYLE_TYPE_SHIFT
Definition autogenerated_propset.h:1469
#define COLUMN_SPAN_SHIFT
Definition autogenerated_propset.h:783
#define POSITION_SHIFT
Definition autogenerated_propset.h:1956
#define FLEX_WRAP_SHIFT
Definition autogenerated_propset.h:1170
#define MAX_HEIGHT_INDEX
Definition autogenerated_propset.h:1571
#define BACKGROUND_IMAGE_INDEX
Definition autogenerated_propset.h:106
#define OUTLINE_COLOR_INDEX
Definition autogenerated_propset.h:1717
#define BREAK_INSIDE_SHIFT
Definition autogenerated_propset.h:544
#define JUSTIFY_CONTENT_SHIFT
Definition autogenerated_propset.h:1338
#define COLUMN_GAP_INDEX
Definition autogenerated_propset.h:700
#define FONT_VARIANT_SHIFT
Definition autogenerated_propset.h:1280
#define FONT_VARIANT_INDEX
Definition autogenerated_propset.h:1279
#define ALIGN_ITEMS_INDEX
Definition autogenerated_propset.h:30
#define OVERFLOW_X_INDEX
Definition autogenerated_propset.h:1778
#define BREAK_AFTER_INDEX
Definition autogenerated_propset.h:506
#define BORDER_LEFT_STYLE_SHIFT
Definition autogenerated_propset.h:282
#define OVERFLOW_Y_INDEX
Definition autogenerated_propset.h:1796
#define BORDER_BOTTOM_STYLE_SHIFT
Definition autogenerated_propset.h:202
#define VERTICAL_ALIGN_INDEX
Definition autogenerated_propset.h:2187
#define COLUMN_WIDTH_SHIFT
Definition autogenerated_propset.h:801
#define FONT_FAMILY_SHIFT
Definition autogenerated_propset.h:1205
#define BORDER_RIGHT_STYLE_SHIFT
Definition autogenerated_propset.h:343
#define WIDOWS_SHIFT
Definition autogenerated_propset.h:2245
#define OUTLINE_WIDTH_SHIFT
Definition autogenerated_propset.h:1758
#define FLEX_DIRECTION_SHIFT
Definition autogenerated_propset.h:1109
#define MIN_WIDTH_SHIFT
Definition autogenerated_propset.h:1635
#define MIN_HEIGHT_SHIFT
Definition autogenerated_propset.h:1614
#define FLOAT_SHIFT
Definition autogenerated_propset.h:1188
#define OUTLINE_COLOR_SHIFT
Definition autogenerated_propset.h:1718
#define BORDER_LEFT_COLOR_INDEX
Definition autogenerated_propset.h:260
#define BORDER_LEFT_STYLE_INDEX
Definition autogenerated_propset.h:281
#define ALIGN_ITEMS_SHIFT
Definition autogenerated_propset.h:31
#define BORDER_LEFT_WIDTH_SHIFT
Definition autogenerated_propset.h:301
#define LETTER_SPACING_SHIFT
Definition autogenerated_propset.h:1378
#define BORDER_RIGHT_COLOR_SHIFT
Definition autogenerated_propset.h:322
#define PAGE_BREAK_INSIDE_INDEX
Definition autogenerated_propset.h:1936
#define BORDER_TOP_COLOR_INDEX
Definition autogenerated_propset.h:406
#define BORDER_BOTTOM_WIDTH_INDEX
Definition autogenerated_propset.h:220
#define BREAK_INSIDE_INDEX
Definition autogenerated_propset.h:543
#define FLEX_WRAP_INDEX
Definition autogenerated_propset.h:1169
#define EMPTY_CELLS_INDEX
Definition autogenerated_propset.h:1048
#define MARGIN_RIGHT_SHIFT
Definition autogenerated_propset.h:1530
#define WRITING_MODE_INDEX
Definition autogenerated_propset.h:2307
#define LINE_HEIGHT_INDEX
Definition autogenerated_propset.h:1398
#define PADDING_RIGHT_INDEX
Definition autogenerated_propset.h:1856
#define BORDER_TOP_COLOR_SHIFT
Definition autogenerated_propset.h:407
#define COLUMN_RULE_WIDTH_SHIFT
Definition autogenerated_propset.h:762
#define BORDER_RIGHT_WIDTH_SHIFT
Definition autogenerated_propset.h:362
#define BREAK_BEFORE_SHIFT
Definition autogenerated_propset.h:525
#define FLEX_DIRECTION_INDEX
Definition autogenerated_propset.h:1108
#define FLEX_SHRINK_SHIFT
Definition autogenerated_propset.h:1149
#define TEXT_DECORATION_INDEX
Definition autogenerated_propset.h:2088
#define BORDER_TOP_STYLE_INDEX
Definition autogenerated_propset.h:427
#define ORDER_SHIFT
Definition autogenerated_propset.h:1677
#define BACKGROUND_COLOR_SHIFT
Definition autogenerated_propset.h:86
#define Z_INDEX_INDEX
Definition autogenerated_propset.h:2326
#define COLUMN_RULE_COLOR_SHIFT
Definition autogenerated_propset.h:722
#define QUOTES_INDEX
Definition autogenerated_propset.h:1973
#define QUOTES_SHIFT
Definition autogenerated_propset.h:1974
#define CAPTION_SIDE_SHIFT
Definition autogenerated_propset.h:563
#define BACKGROUND_COLOR_INDEX
Definition autogenerated_propset.h:85
#define PADDING_LEFT_INDEX
Definition autogenerated_propset.h:1835
#define HEIGHT_INDEX
Definition autogenerated_propset.h:1316
#define MAX_WIDTH_SHIFT
Definition autogenerated_propset.h:1593
#define FONT_FAMILY_INDEX
Definition autogenerated_propset.h:1204
#define ORPHANS_INDEX
Definition autogenerated_propset.h:1696
#define TEXT_DECORATION_SHIFT
Definition autogenerated_propset.h:2089
#define BOTTOM_INDEX
Definition autogenerated_propset.h:467
#define PAGE_BREAK_AFTER_INDEX
Definition autogenerated_propset.h:1898
#define TEXT_TRANSFORM_SHIFT
Definition autogenerated_propset.h:2129
#define CLIP_INDEX
Definition autogenerated_propset.h:598
#define FILL_OPACITY_SHIFT
Definition autogenerated_propset.h:1067
#define BACKGROUND_POSITION_SHIFT
Definition autogenerated_propset.h:137
#define COLUMN_COUNT_SHIFT
Definition autogenerated_propset.h:662
#define TEXT_INDENT_INDEX
Definition autogenerated_propset.h:2107
#define BREAK_AFTER_SHIFT
Definition autogenerated_propset.h:507
#define BACKGROUND_IMAGE_SHIFT
Definition autogenerated_propset.h:107
#define BORDER_COLLAPSE_INDEX
Definition autogenerated_propset.h:241
#define LIST_STYLE_POSITION_INDEX
Definition autogenerated_propset.h:1449
#define HEIGHT_SHIFT
Definition autogenerated_propset.h:1317
#define BACKGROUND_ATTACHMENT_INDEX
Definition autogenerated_propset.h:66
#define COLUMN_FILL_INDEX
Definition autogenerated_propset.h:682
#define POSITION_INDEX
Definition autogenerated_propset.h:1955
unit
Definition bytecode.h:38
int32_t css_fixed
Definition fpmath.h:23
@ CSS_COMPUTED_CONTENT_NONE
Definition computed.h:50
@ CSS_COMPUTED_CONTENT_STRING
Definition computed.h:51
@ CSS_COMPUTED_CONTENT_COUNTERS
Definition computed.h:54
@ CSS_COMPUTED_CONTENT_COUNTER
Definition computed.h:53
@ CSS_COMPUTED_CONTENT_URI
Definition computed.h:52
@ CSS_COMPUTED_CONTENT_ATTR
Definition computed.h:55
@ CSS_CLIP_RECT
Definition properties.h:311
css_error
Definition errors.h:18
@ CSS_OK
Definition errors.h:19
#define lwc_string_unref(str)
Definition libwapcaplet.h:159
#define free(p)
Definition quickjs.c:2291
Definition i_video.h:141
Definition computed.h:32
css_unit tunit
Definition computed.h:38
bool right_auto
Definition computed.h:44
css_fixed left
Definition computed.h:36
css_fixed right
Definition computed.h:34
css_fixed bottom
Definition computed.h:35
bool bottom_auto
Definition computed.h:45
bool left_auto
Definition computed.h:46
css_unit lunit
Definition computed.h:41
css_unit bunit
Definition computed.h:40
css_unit runit
Definition computed.h:39
css_fixed top
Definition computed.h:33
bool top_auto
Definition computed.h:43
Definition computed.h:62
union css_computed_content_item::@832 data
lwc_string * sep
Definition computed.h:74
lwc_string * string
Definition computed.h:65
uint8_t type
Definition computed.h:63
lwc_string * attr
Definition computed.h:67
lwc_string * uri
Definition computed.h:66
lwc_string * name
Definition computed.h:69
struct css_computed_content_item::@832::@834 counters
struct css_computed_content_item::@832::@833 counter
Definition computed.h:27
lwc_string * name
Definition computed.h:28
css_fixed border_spacing_a
Definition autogenerated_computed.h:219
css_fixed clip_d
Definition autogenerated_computed.h:227
css_fixed border_top_width
Definition autogenerated_computed.h:222
css_fixed top
Definition autogenerated_computed.h:264
css_fixed opacity
Definition autogenerated_computed.h:252
css_fixed width
Definition autogenerated_computed.h:267
css_fixed min_width
Definition autogenerated_computed.h:251
css_fixed bottom
Definition autogenerated_computed.h:223
css_color border_top_color
Definition autogenerated_computed.h:221
css_fixed border_left_width
Definition autogenerated_computed.h:216
css_fixed padding_top
Definition autogenerated_computed.h:260
css_fixed vertical_align
Definition autogenerated_computed.h:265
css_color column_rule_color
Definition autogenerated_computed.h:231
css_color outline_color
Definition autogenerated_computed.h:255
css_fixed background_position_a
Definition autogenerated_computed.h:211
css_fixed height
Definition autogenerated_computed.h:239
css_fixed margin_bottom
Definition autogenerated_computed.h:244
css_fixed max_width
Definition autogenerated_computed.h:249
css_fixed text_indent
Definition autogenerated_computed.h:263
css_fixed right
Definition autogenerated_computed.h:261
css_fixed flex_shrink
Definition autogenerated_computed.h:237
css_fixed border_right_width
Definition autogenerated_computed.h:218
int32_t orphans
Definition autogenerated_computed.h:254
css_fixed outline_width
Definition autogenerated_computed.h:256
css_fixed letter_spacing
Definition autogenerated_computed.h:241
css_fixed min_height
Definition autogenerated_computed.h:250
css_fixed background_position_b
Definition autogenerated_computed.h:212
lwc_string * background_image
Definition autogenerated_computed.h:210
css_fixed margin_left
Definition autogenerated_computed.h:245
css_fixed margin_top
Definition autogenerated_computed.h:247
int32_t z_index
Definition autogenerated_computed.h:269
css_fixed clip_a
Definition autogenerated_computed.h:224
lwc_string * list_style_image
Definition autogenerated_computed.h:243
css_fixed stroke_opacity
Definition autogenerated_computed.h:262
css_fixed margin_right
Definition autogenerated_computed.h:246
css_fixed left
Definition autogenerated_computed.h:240
css_fixed padding_right
Definition autogenerated_computed.h:259
css_fixed padding_bottom
Definition autogenerated_computed.h:257
css_fixed border_spacing_b
Definition autogenerated_computed.h:220
int32_t order
Definition autogenerated_computed.h:253
css_fixed word_spacing
Definition autogenerated_computed.h:268
css_color border_bottom_color
Definition autogenerated_computed.h:213
css_fixed font_size
Definition autogenerated_computed.h:238
css_fixed fill_opacity
Definition autogenerated_computed.h:234
css_fixed padding_left
Definition autogenerated_computed.h:258
css_fixed border_bottom_width
Definition autogenerated_computed.h:214
css_color color
Definition autogenerated_computed.h:228
css_fixed column_width
Definition autogenerated_computed.h:233
css_fixed clip_c
Definition autogenerated_computed.h:226
css_fixed column_rule_width
Definition autogenerated_computed.h:232
css_fixed column_gap
Definition autogenerated_computed.h:230
int32_t widows
Definition autogenerated_computed.h:266
css_fixed flex_basis
Definition autogenerated_computed.h:235
css_fixed flex_grow
Definition autogenerated_computed.h:236
css_color background_color
Definition autogenerated_computed.h:209
uint32_t bits[15]
Definition autogenerated_computed.h:207
css_color border_right_color
Definition autogenerated_computed.h:217
int32_t column_count
Definition autogenerated_computed.h:229
css_fixed max_height
Definition autogenerated_computed.h:248
css_color border_left_color
Definition autogenerated_computed.h:215
css_fixed line_height
Definition autogenerated_computed.h:242
css_fixed clip_b
Definition autogenerated_computed.h:225
Definition autogenerated_computed.h:272
css_computed_counter * counter_increment
Definition autogenerated_computed.h:276
lwc_string ** cursor
Definition autogenerated_computed.h:278
lwc_string ** quotes
Definition autogenerated_computed.h:280
lwc_string ** font_family
Definition autogenerated_computed.h:279
css_computed_counter * counter_reset
Definition autogenerated_computed.h:277
struct css_computed_style_i i
Definition autogenerated_computed.h:273
css_computed_content_item * content
Definition autogenerated_computed.h:275
Definition libwapcaplet.h:41