8#ifndef css_select_properties_helpers_h_
9#define css_select_properties_helpers_h_
68static inline css_error css__copy_lwc_string_array(
70 lwc_string *
const*orig,
71 lwc_string ***copy_out)
74 lwc_string **copy = NULL;
77 for (lwc_string *
const*i = orig; (*i) != NULL; i++) {
81 copy = malloc((count + 1) *
sizeof(*copy));
87 for (
size_t i = 0; i < count; i++) {
88 copy[i] = lwc_string_ref(orig[i]);
92 memcpy(copy, orig, (count + 1) *
sizeof(*copy));
101static inline css_error css__copy_computed_counter_array(
111 i->
name != NULL; i++) {
115 copy = malloc((count + 1) *
sizeof(*copy));
121 for (
size_t i = 0; i < count; i++) {
122 copy[i].
name = lwc_string_ref(orig[i].name);
125 copy[count].
name = NULL;
126 copy[count].
value = 0;
128 memcpy(copy, orig, (count + 1) *
sizeof(*copy));
137static inline css_error css__copy_computed_content_item_array(
151 copy = malloc((count + 1) *
sizeof(*copy));
157 for (
size_t i = 0; i < count; i++) {
158 switch (orig[i].type) {
161 orig[i].data.string);
164 copy[i].
data.
uri = lwc_string_ref(
173 orig[i].data.counter.name);
179 orig[i].data.counters.name);
181 orig[i].data.counters.sep);
192 memcpy(copy, orig, (count + 1) *
sizeof(*copy));
css_error
Definition errors.h:18
@ CSS_NOMEM
Definition errors.h:21
@ 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_error css__cascade_number(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed))
Definition helpers.c:394
css_error css__cascade_length(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed, css_unit))
Definition helpers.c:355
css_error css__cascade_length_normal(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed, css_unit))
Definition helpers.c:273
css_error css__cascade_border_width(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed, css_unit))
Definition helpers.c:141
css_error css__cascade_break_after_before_inside(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t))
Definition helpers.c:466
uint32_t generic_destroy_uri(void *bytecode)
css_error css__cascade_length_auto(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed, css_unit))
Definition helpers.c:188
uint32_t generic_destroy_color(void *bytecode)
css_error css__cascade_bg_border_color(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_color))
Definition helpers.c:22
css_error css__cascade_uri_none(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, lwc_string *))
Definition helpers.c:60
uint32_t generic_destroy_length(void *bytecode)
css_error css__cascade_counter_increment_reset(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_computed_counter *))
Definition helpers.c:515
css_error css__cascade_length_auto_calc(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed_or_calc, css_unit))
Definition helpers.c:229
css_error css__cascade_length_none(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t, css_fixed, css_unit))
Definition helpers.c:314
css_error css__cascade_page_break_after_before_inside(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t))
Definition helpers.c:429
css_error css__cascade_border_style(uint32_t opv, css_style *style, css_select_state *state, css_error(*fun)(css_computed_style *, uint8_t))
Definition helpers.c:90
uint32_t generic_destroy_number(void *bytecode)
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
uint8_t style
Definition computed.h:70
lwc_string * name
Definition computed.h:28
css_fixed value
Definition computed.h:29
Definition autogenerated_computed.h:282
Definition stylesheet.h:29
css_unit
Definition types.h:82
uint32_t css_color
Definition types.h:79
Definition autogenerated_computed.h:13