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