diff options
77 files changed, 1331 insertions, 378 deletions
@@ -6,7 +6,7 @@ # Component settings COMPONENT := css -COMPONENT_VERSION := 0.9.1 +COMPONENT_VERSION := 0.9.2 # Default to a static library COMPONENT_TYPE ?= lib-static diff --git a/build/mkprops.pl b/build/mkprops.pl index 33fb0f8..6e38007 100755 --- a/build/mkprops.pl +++ b/build/mkprops.pl @@ -24,7 +24,7 @@ EOF foreach my $prop (@PROPS) { print <<EOF static css_error parse_$prop(css_css21 *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style **result); EOF } @@ -35,7 +35,7 @@ print <<EOF * Type of property handler function */ typedef css_error (*css_prop_handler)(css_css21 *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style **result); /** @@ -56,7 +56,7 @@ foreach my $prop (@PROPS) { print <<EOF css_error parse_$prop(css_css21 *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style **result) { UNUSED(c); diff --git a/docs/Bytecode b/docs/Bytecode index 67450cd..272fd07 100644 --- a/docs/Bytecode +++ b/docs/Bytecode @@ -1383,4 +1383,22 @@ Opcodes bit 7 clear => Reserved for future expansion bits 0-6: MBZ -7c-3ff - Reserved for future expansion. +7c - fill-opacity + <value> (14bits) : + bits 8-13: MBZ + bits 0-7 : + bit 7 set => number follows + bits 0-6: MBZ + bit 7 clear => Reserved for future expansion + bits 0-6: MBZ + +7d - stroke-opacity + <value> (14bits) : + bits 8-13: MBZ + bits 0-7 : + bit 7 set => number follows + bits 0-6: MBZ + bit 7 clear => Reserved for future expansion + bits 0-6: MBZ + +7e-3ff - Reserved for future expansion. diff --git a/include/libcss/computed.h b/include/libcss/computed.h index 30e369b..5d9cc7e 100644 --- a/include/libcss/computed.h +++ b/include/libcss/computed.h @@ -338,6 +338,14 @@ uint8_t css_computed_opacity( const css_computed_style *style, css_fixed *opacity); +uint8_t css_computed_fill_opacity( + const css_computed_style *style, + css_fixed *fill_opacity); + +uint8_t css_computed_stroke_opacity( + const css_computed_style *style, + css_fixed *stroke_opacity); + uint8_t css_computed_text_transform( const css_computed_style *style); diff --git a/include/libcss/fpmath.h b/include/libcss/fpmath.h index d7cac4d..eec40b3 100644 --- a/include/libcss/fpmath.h +++ b/include/libcss/fpmath.h @@ -130,6 +130,8 @@ css_float_to_fixed(const float a) { /* truncate a fixed point value */ #define TRUNCATEFIX(a) (a & ~((1 << CSS_RADIX_POINT)- 1 )) +/* get fractional component of a fixed point value */ +#define FIXFRAC(a) (a & ((1 << CSS_RADIX_POINT)- 1 )) /* Useful values */ #define F_PI_2 0x00000648 /* 1.5708 (PI/2) */ diff --git a/include/libcss/properties.h b/include/libcss/properties.h index af0a1f5..cb1f0ff 100644 --- a/include/libcss/properties.h +++ b/include/libcss/properties.h @@ -138,6 +138,8 @@ enum css_properties_e { CSS_PROP_FLEX_WRAP = 0x079, CSS_PROP_JUSTIFY_CONTENT = 0x07a, CSS_PROP_ORDER = 0x07b, + CSS_PROP_FILL_OPACITY = 0x07c, + CSS_PROP_STROKE_OPACITY = 0x07d, CSS_N_PROPERTIES }; @@ -451,6 +453,11 @@ enum css_empty_cells_e { CSS_EMPTY_CELLS_HIDE = 0x2 }; +enum css_fill_opacity_e { + CSS_FILL_OPACITY_INHERIT = 0x0, + CSS_FILL_OPACITY_SET = 0x1 +}; + enum css_flex_basis_e { CSS_FLEX_BASIS_INHERIT = 0x0, CSS_FLEX_BASIS_SET = 0x1, @@ -780,6 +787,11 @@ enum css_right_e { CSS_RIGHT_AUTO = 0x2 }; +enum css_stroke_opacity_e { + CSS_STROKE_OPACITY_INHERIT = 0x0, + CSS_STROKE_OPACITY_SET = 0x1 +}; + enum css_table_layout_e { CSS_TABLE_LAYOUT_INHERIT = 0x0, CSS_TABLE_LAYOUT_AUTO = 0x1, diff --git a/src/bytecode/opcodes.h b/src/bytecode/opcodes.h index 8bc05b4..7a1377b 100644 --- a/src/bytecode/opcodes.h +++ b/src/bytecode/opcodes.h @@ -351,6 +351,11 @@ enum op_empty_cells { EMPTY_CELLS_HIDE = 0x0001 }; +enum op_fill_opacity { + FILL_OPACITY_SET = 0x0080 +}; + + enum op_flex_basis { FLEX_BASIS_AUTO = 0x0000, FLEX_BASIS_CONTENT = 0x0001, @@ -721,6 +726,10 @@ enum op_stress { STRESS_SET = 0x0080 }; +enum op_stroke_opacity { + STROKE_OPACITY_SET = 0x0080 +}; + enum op_table_layout { TABLE_LAYOUT_AUTO = 0x0000, TABLE_LAYOUT_FIXED = 0x0001 diff --git a/src/parse/font_face.c b/src/parse/font_face.c index f17d50e..055a118 100644 --- a/src/parse/font_face.c +++ b/src/parse/font_face.c @@ -41,7 +41,7 @@ static bool font_rule_font_family_reserved(css_language *c, } static css_error font_face_parse_font_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_font_face *font_face) { css_error error; @@ -60,7 +60,7 @@ static css_error font_face_parse_font_family(css_language *c, } static css_error font_face_src_parse_format(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_font_face_format *format) { bool match; @@ -120,7 +120,7 @@ static css_error font_face_src_parse_format(css_language *c, } static css_error font_face_src_parse_spec_or_name(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, lwc_string **location, css_font_face_location_type *location_type, css_font_face_format *format) @@ -194,10 +194,10 @@ static css_error font_face_src_parse_spec_or_name(css_language *c, } static css_error font_face_parse_src(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_font_face *font_face) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_OK; const css_token *token; css_font_face_src *srcs = NULL, *new_srcs = NULL; @@ -258,10 +258,10 @@ cleanup: } static css_error font_face_parse_font_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_font_face *font_face) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_OK; const css_token *token; enum css_font_style_e style = 0; @@ -299,10 +299,10 @@ static css_error font_face_parse_font_style(css_language *c, } static css_error font_face_parse_font_weight(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_font_face *font_face) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_OK; const css_token *token; enum css_font_weight_e weight = 0; @@ -374,7 +374,7 @@ static css_error font_face_parse_font_weight(css_language *c, */ css_error css__parse_font_descriptor(css_language *c, const css_token *descriptor, const parserutils_vector *vector, - int *ctx, css_rule_font_face *rule) + int32_t *ctx, css_rule_font_face *rule) { css_font_face *font_face = rule->font_face; css_error error; diff --git a/src/parse/font_face.h b/src/parse/font_face.h index 435380e..dc00ef1 100644 --- a/src/parse/font_face.h +++ b/src/parse/font_face.h @@ -17,6 +17,6 @@ css_error css__parse_font_descriptor(css_language *c, const css_token *descriptor, const parserutils_vector *vector, - int *ctx, struct css_rule_font_face *rule); + int32_t *ctx, struct css_rule_font_face *rule); #endif diff --git a/src/parse/important.c b/src/parse/important.c index 1066d90..02aafc4 100644 --- a/src/parse/important.c +++ b/src/parse/important.c @@ -25,10 +25,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_important(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint8_t *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; bool match = false; const css_token *token; @@ -346,6 +346,16 @@ void css__make_style_important(css_style *style) offset++; /* value */ break; + case CSS_PROP_FILL_OPACITY: + if (value == FILL_OPACITY_SET) + offset++; /* value */ + break; + + case CSS_PROP_STROKE_OPACITY: + if (value == STROKE_OPACITY_SET) + offset++; /* value */ + break; + case CSS_PROP_ORDER: if (value == ORDER_SET) offset++; /* value */ diff --git a/src/parse/important.h b/src/parse/important.h index ba5e118..e939c4b 100644 --- a/src/parse/important.h +++ b/src/parse/important.h @@ -12,7 +12,7 @@ #include "parse/language.h" css_error css__parse_important(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint8_t *result); void css__make_style_important(css_style *style); diff --git a/src/parse/language.c b/src/parse/language.c index c2d02d7..936ab3d 100644 --- a/src/parse/language.c +++ b/src/parse/language.c @@ -63,37 +63,37 @@ static css_error lookupNamespace(css_language *c, /* Selector list parsing */ static css_error parseClass(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector_detail *specific); static css_error parseAttrib(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector_detail *specific); static css_error parseNth(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector_detail_value *value); static css_error parsePseudo(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool in_not, css_selector_detail *specific); static css_error parseSpecific(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool in_not, css_selector_detail *specific); static css_error parseAppendSpecific(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **parent); static css_error parseSelectorSpecifics(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **parent); static css_error parseTypeSelector(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_qname *qname); static css_error parseSimpleSelector(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **result); static css_error parseCombinator(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_combinator *result); static css_error parseSelector(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **result); static css_error parseSelectorList(css_language *c, const parserutils_vector *vector, css_rule *rule); @@ -101,7 +101,7 @@ static css_error parseSelectorList(css_language *c, /* Declaration parsing */ static css_error parseProperty(css_language *c, const css_token *property, const parserutils_vector *vector, - int *ctx, css_rule *rule); + int32_t *ctx, css_rule *rule); /** * Create a CSS language parser @@ -790,7 +790,7 @@ css_error handleDeclaration(css_language *c, const parserutils_vector *vector) { css_error error; const css_token *token, *ident; - int ctx = 0; + int32_t ctx = 0; context_entry *entry; css_rule *rule; @@ -945,7 +945,7 @@ css_error lookupNamespace(css_language *c, lwc_string *prefix, lwc_string **uri) ******************************************************************************/ css_error parseClass(css_language *c, const parserutils_vector *vector, - int *ctx, css_selector_detail *specific) + int32_t *ctx, css_selector_detail *specific) { css_qname qname; css_selector_detail_value detail_value; @@ -976,7 +976,7 @@ css_error parseClass(css_language *c, const parserutils_vector *vector, } css_error parseAttrib(css_language *c, const parserutils_vector *vector, - int *ctx, css_selector_detail *specific) + int32_t *ctx, css_selector_detail *specific) { css_qname qname; css_selector_detail_value detail_value; @@ -1078,7 +1078,7 @@ css_error parseAttrib(css_language *c, const parserutils_vector *vector, } css_error parseNth(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector_detail_value *value) { const css_token *token; @@ -1279,7 +1279,7 @@ css_error parseNth(css_language *c, } css_error parsePseudo(css_language *c, const parserutils_vector *vector, - int *ctx, bool in_not, css_selector_detail *specific) + int32_t *ctx, bool in_not, css_selector_detail *specific) { static const struct { @@ -1459,7 +1459,7 @@ css_error parsePseudo(css_language *c, const parserutils_vector *vector, } css_error parseSpecific(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool in_not, css_selector_detail *specific) { css_error error; @@ -1514,7 +1514,7 @@ css_error parseSpecific(css_language *c, } css_error parseAppendSpecific(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **parent) { css_error error; @@ -1529,7 +1529,7 @@ css_error parseAppendSpecific(css_language *c, } css_error parseSelectorSpecifics(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **parent) { css_error error; @@ -1551,7 +1551,7 @@ css_error parseSelectorSpecifics(css_language *c, } css_error parseTypeSelector(css_language *c, const parserutils_vector *vector, - int *ctx, css_qname *qname) + int32_t *ctx, css_qname *qname) { const css_token *token; css_error error; @@ -1612,10 +1612,10 @@ css_error parseTypeSelector(css_language *c, const parserutils_vector *vector, } css_error parseSimpleSelector(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_selector **result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; css_selector *selector; @@ -1678,7 +1678,7 @@ css_error parseSimpleSelector(css_language *c, } css_error parseCombinator(css_language *c, const parserutils_vector *vector, - int *ctx, css_combinator *result) + int32_t *ctx, css_combinator *result) { const css_token *token; css_combinator comb = CSS_COMBINATOR_NONE; @@ -1719,7 +1719,7 @@ css_error parseCombinator(css_language *c, const parserutils_vector *vector, } css_error parseSelector(css_language *c, const parserutils_vector *vector, - int *ctx, css_selector **result) + int32_t *ctx, css_selector **result) { css_error error; const css_token *token = NULL; @@ -1785,7 +1785,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector, css_error error; const css_token *token = NULL; css_selector *selector = NULL; - int ctx = 0; + int32_t ctx = 0; /* Strip any leading whitespace (can happen if in nested block) */ consumeWhitespace(vector, &ctx); @@ -1843,7 +1843,7 @@ css_error parseSelectorList(css_language *c, const parserutils_vector *vector, ******************************************************************************/ css_error parseProperty(css_language *c, const css_token *property, - const parserutils_vector *vector, int *ctx, css_rule *rule) + const parserutils_vector *vector, int32_t *ctx, css_rule *rule) { css_error error; css_prop_handler handler = NULL; diff --git a/src/parse/language.h b/src/parse/language.h index 2ab4987..81a096a 100644 --- a/src/parse/language.h +++ b/src/parse/language.h @@ -64,7 +64,7 @@ css_error css__language_destroy(css_language *language); * \param vector The vector to consume from * \param ctx The vector's context */ -static inline void consumeWhitespace(const parserutils_vector *vector, int *ctx) +static inline void consumeWhitespace(const parserutils_vector *vector, int32_t *ctx) { const css_token *token = NULL; diff --git a/src/parse/mq.c b/src/parse/mq.c index b5478a1..5031e34 100644 --- a/src/parse/mq.c +++ b/src/parse/mq.c @@ -79,11 +79,11 @@ void css__mq_query_destroy(css_mq_query *media) } static css_error mq_parse_condition(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool permit_or, css_mq_cond **cond); static css_error mq_parse_ratio( - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, const css_token *numerator, css_fixed *ratio) { const css_token *token; @@ -260,7 +260,7 @@ static css_error mq_parse_range__convert_to_level_4( } static css_error mq_parse_range(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, const css_token *name_or_value, css_mq_feature **feature) { @@ -443,7 +443,7 @@ static css_error mq_parse_range(lwc_string **strings, } static css_error mq_parse_media_feature(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_mq_feature **feature) { const css_token *name_or_value, *token; @@ -565,7 +565,7 @@ static css_error mq_parse_media_feature(lwc_string **strings, * CSS Syntax Module Level 3: 8.2 */ static css_error mq_parse_consume_any_value(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool until, const char until_char) { const css_token *token; @@ -627,7 +627,7 @@ static css_error mq_parse_consume_any_value(lwc_string **strings, } static css_error mq_parse_general_enclosed(lwc_string **strings, - const parserutils_vector *vector, int *ctx) + const parserutils_vector *vector, int32_t *ctx) { const css_token *token; css_error error; @@ -671,7 +671,7 @@ static css_error mq_parse_general_enclosed(lwc_string **strings, } static css_error mq_parse_media_in_parens(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_mq_cond_or_feature **cond_or_feature) { const css_token *token; @@ -754,7 +754,7 @@ static css_error mq_parse_media_in_parens(lwc_string **strings, } static css_error mq_parse_condition(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool permit_or, css_mq_cond **cond) { const css_token *token; @@ -959,7 +959,7 @@ static css_error mq_parse_type(lwc_string **strings, lwc_string *type, } static css_error mq_parse_media_query(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_mq_query **query) { const css_token *token; @@ -984,7 +984,7 @@ static css_error mq_parse_media_query(lwc_string **strings, lwc_string_caseless_isequal(token->idata, strings[NOT], &match) == lwc_error_ok && match) { - int old_ctx = *ctx; + int32_t old_ctx = *ctx; parserutils_vector_iterate(vector, ctx); consumeWhitespace(vector, ctx); @@ -1100,7 +1100,7 @@ static css_error css__mq_parse__create_not_all( } css_error css__mq_parse_media_list(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_mq_query **media) { css_mq_query *result = NULL, *last = NULL; @@ -1162,7 +1162,7 @@ static css_error css_parse_media_query_handle_event( const parserutils_vector *tokens, void *pw) { - int idx = 0; + int32_t idx = 0; css_error err; css_mq_query *media; const css_token *tok; diff --git a/src/parse/mq.h b/src/parse/mq.h index 7a51578..ec19419 100644 --- a/src/parse/mq.h +++ b/src/parse/mq.h @@ -88,7 +88,7 @@ css_error css_parse_media_query(lwc_string **strings, css_mq_query **media_out); css_error css__mq_parse_media_list(lwc_string **strings, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_mq_query **media); void css__mq_query_destroy(css_mq_query *media); diff --git a/src/parse/properties/Makefile b/src/parse/properties/Makefile index 6461dda..df84d49 100644 --- a/src/parse/properties/Makefile +++ b/src/parse/properties/Makefile @@ -45,6 +45,7 @@ DIR_SOURCES := \ cue.c \ cursor.c \ elevation.c \ + fill_opacity.c \ flex.c \ flex_flow.c \ font.c \ @@ -61,6 +62,7 @@ DIR_SOURCES := \ play_during.c \ properties.c \ quotes.c \ + stroke_opacity.c \ text_decoration.c \ utils.c \ voice_family.c diff --git a/src/parse/properties/azimuth.c b/src/parse/properties/azimuth.c index c1ff9ae..a9265d1 100644 --- a/src/parse/properties/azimuth.c +++ b/src/parse/properties/azimuth.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_azimuth(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; uint8_t flags = 0; diff --git a/src/parse/properties/background.c b/src/parse/properties/background.c index e11fcc9..20aeb30 100644 --- a/src/parse/properties/background.c +++ b/src/parse/properties/background.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_background(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error = CSS_OK; diff --git a/src/parse/properties/background_position.c b/src/parse/properties/background_position.c index 534950c..1d87e6a 100644 --- a/src/parse/properties/background_position.c +++ b/src/parse/properties/background_position.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_background_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; uint8_t flags = 0; diff --git a/src/parse/properties/border.c b/src/parse/properties/border.c index 26cdbcd..be269ab 100644 --- a/src/parse/properties/border.c +++ b/src/parse/properties/border.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; error = css__parse_border_side(c, vector, ctx, result, BORDER_SIDE_TOP); diff --git a/src/parse/properties/border_color.c b/src/parse/properties/border_color.c index 41dbc2a..60b401e 100644 --- a/src/parse/properties/border_color.c +++ b/src/parse/properties/border_color.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; uint16_t side_val[4]; diff --git a/src/parse/properties/border_spacing.c b/src/parse/properties/border_spacing.c index b931eda..e00fb27 100644 --- a/src/parse/properties/border_spacing.c +++ b/src/parse/properties/border_spacing.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; css_fixed length[2] = { 0 }; diff --git a/src/parse/properties/border_style.c b/src/parse/properties/border_style.c index 7be1f8d..4d54900 100644 --- a/src/parse/properties/border_style.c +++ b/src/parse/properties/border_style.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; uint16_t side_val[4]; diff --git a/src/parse/properties/border_width.c b/src/parse/properties/border_width.c index 90bd4cc..b11ca05 100644 --- a/src/parse/properties/border_width.c +++ b/src/parse/properties/border_width.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; uint16_t side_val[4]; diff --git a/src/parse/properties/clip.c b/src/parse/properties/clip.c index 76fa364..4bf653d 100644 --- a/src/parse/properties/clip.c +++ b/src/parse/properties/clip.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_clip(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; int num_lengths = 0; diff --git a/src/parse/properties/column_rule.c b/src/parse/properties/column_rule.c index 146783c..7bfcad5 100644 --- a/src/parse/properties/column_rule.c +++ b/src/parse/properties/column_rule.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_column_rule(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error; diff --git a/src/parse/properties/columns.c b/src/parse/properties/columns.c index edc7ee6..277a305 100644 --- a/src/parse/properties/columns.c +++ b/src/parse/properties/columns.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_columns(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error = CSS_OK; diff --git a/src/parse/properties/content.c b/src/parse/properties/content.c index 186abcc..b32de22 100644 --- a/src/parse/properties/content.c +++ b/src/parse/properties/content.c @@ -29,10 +29,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_content(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/css_property_parser_gen.c b/src/parse/properties/css_property_parser_gen.c index 1e8b007..3e1d997 100644 --- a/src/parse/properties/css_property_parser_gen.c +++ b/src/parse/properties/css_property_parser_gen.c @@ -106,7 +106,7 @@ void output_header(FILE *outputf, const char *descriptor, struct keyval *parser_ " * If the input is invalid, then \\a *ctx remains unchanged.\n" " */\n" "css_error css__parse_%s(css_language *c,\n" - " const parserutils_vector *vector, int *ctx,\n" + " const parserutils_vector *vector, int32_t *ctx,\n" " css_style *result%s)\n" "{\n", descriptor, @@ -120,7 +120,7 @@ void output_header(FILE *outputf, const char *descriptor, struct keyval *parser_ void output_token_type_check(FILE *outputf, bool do_token_check, struct keyval_list *IDENT, struct keyval_list *URI, struct keyval_list *NUMBER) { fprintf(outputf, - " int orig_ctx = *ctx;\n" + " int32_t orig_ctx = *ctx;\n" " css_error error;\n" " const css_token *token;\n" " bool match;\n\n" diff --git a/src/parse/properties/cue.c b/src/parse/properties/cue.c index 98844bd..db64412 100644 --- a/src/parse/properties/cue.c +++ b/src/parse/properties/cue.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_cue(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *first_token; const css_token *token; diff --git a/src/parse/properties/cursor.c b/src/parse/properties/cursor.c index ad2200c..b61d9a9 100644 --- a/src/parse/properties/cursor.c +++ b/src/parse/properties/cursor.c @@ -27,10 +27,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_cursor(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_OK; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/elevation.c b/src/parse/properties/elevation.c index 7fe5bf2..b456799 100644 --- a/src/parse/properties/elevation.c +++ b/src/parse/properties/elevation.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_elevation(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; uint8_t flags = 0; diff --git a/src/parse/properties/fill_opacity.c b/src/parse/properties/fill_opacity.c new file mode 100644 index 0000000..caed86f --- /dev/null +++ b/src/parse/properties/fill_opacity.c @@ -0,0 +1,82 @@ +/* + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + */ + +#include <assert.h> +#include <string.h> + +#include "bytecode/bytecode.h" +#include "bytecode/opcodes.h" +#include "parse/properties/properties.h" +#include "parse/properties/utils.h" + +/** + * Parse fill-opacity + * + * \param c Parsing context + * \param vector Vector of tokens to process + * \param ctx Pointer to vector iteration context + * \param result resulting style + * \return CSS_OK on success, + * CSS_NOMEM on memory exhaustion, + * CSS_INVALID if the input is not valid + * + * Post condition: \a *ctx is updated with the next token to process + * If the input is invalid, then \a *ctx remains unchanged. + */ +css_error css__parse_fill_opacity(css_language *c, + const parserutils_vector *vector, int32_t *ctx, + css_style *result) +{ + int32_t orig_ctx = *ctx; + css_error error; + const css_token *token; + enum flag_value flag_value; + + token = parserutils_vector_iterate(vector, ctx); + if ((token == NULL) || ((token->type != CSS_TOKEN_IDENT) && (token->type != CSS_TOKEN_NUMBER))) { + *ctx = orig_ctx; + return CSS_INVALID; + } + + flag_value = get_css_flag_value(c, token); + + if (flag_value != FLAG_VALUE__NONE) { + error = css_stylesheet_style_flag_value(result, flag_value, + CSS_PROP_FILL_OPACITY); + + } else if (token->type == CSS_TOKEN_NUMBER) { + css_fixed num = 0; + size_t consumed = 0; + + num = css__number_from_lwc_string(token->idata, false, &consumed); + /* Invalid if there are trailing characters */ + if (consumed != lwc_string_length(token->idata)) { + *ctx = orig_ctx; + return CSS_INVALID; + } + + /* Clamp to range [0,1] */ + if (num < 0) + num = 0; + if (num > INTTOFIX(1)) + num = INTTOFIX(1); + + error = css__stylesheet_style_appendOPV(result, CSS_PROP_FILL_OPACITY, 0, FILL_OPACITY_SET); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } + + error = css__stylesheet_style_append(result, num); + } else { + error = CSS_INVALID; + } + + if (error != CSS_OK) + *ctx = orig_ctx; + + return error; +} + diff --git a/src/parse/properties/flex.c b/src/parse/properties/flex.c index d8f3848..a29309b 100644 --- a/src/parse/properties/flex.c +++ b/src/parse/properties/flex.c @@ -29,10 +29,10 @@ */ css_error css__parse_flex(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error; diff --git a/src/parse/properties/flex_flow.c b/src/parse/properties/flex_flow.c index 2d9c60a..a5e2926 100644 --- a/src/parse/properties/flex_flow.c +++ b/src/parse/properties/flex_flow.c @@ -29,10 +29,10 @@ */ css_error css__parse_flex_flow(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error; diff --git a/src/parse/properties/font.c b/src/parse/properties/font.c index 7ce9701..16a6cc4 100644 --- a/src/parse/properties/font.c +++ b/src/parse/properties/font.c @@ -224,12 +224,12 @@ static css_error parse_system_font(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_font(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { const css_token *token; css_error error; - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; css_system_font system_font; diff --git a/src/parse/properties/font_family.c b/src/parse/properties/font_family.c index b309f45..2f8782e 100644 --- a/src/parse/properties/font_family.c +++ b/src/parse/properties/font_family.c @@ -99,10 +99,10 @@ static css_code_t font_family_value(css_language *c, const css_token *token, boo * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_font_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; bool match; diff --git a/src/parse/properties/font_weight.c b/src/parse/properties/font_weight.c index abe0b78..77ec9a1 100644 --- a/src/parse/properties/font_weight.c +++ b/src/parse/properties/font_weight.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_font_weight(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; uint8_t flags = 0; diff --git a/src/parse/properties/list_style.c b/src/parse/properties/list_style.c index e6e8eae..1cb373a 100644 --- a/src/parse/properties/list_style.c +++ b/src/parse/properties/list_style.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_list_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error; diff --git a/src/parse/properties/list_style_type.c b/src/parse/properties/list_style_type.c index fe66bcb..eb7f363 100644 --- a/src/parse/properties/list_style_type.c +++ b/src/parse/properties/list_style_type.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_list_style_type(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *ident; uint8_t flags = 0; diff --git a/src/parse/properties/margin.c b/src/parse/properties/margin.c index 63adddc..1ee56f7 100644 --- a/src/parse/properties/margin.c +++ b/src/parse/properties/margin.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_margin(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; uint16_t side_val[4]; diff --git a/src/parse/properties/opacity.c b/src/parse/properties/opacity.c index 5d7b176..22acd76 100644 --- a/src/parse/properties/opacity.c +++ b/src/parse/properties/opacity.c @@ -27,10 +27,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_opacity(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/outline.c b/src/parse/properties/outline.c index 8ceac8a..ac91ffd 100644 --- a/src/parse/properties/outline.c +++ b/src/parse/properties/outline.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_outline(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error; diff --git a/src/parse/properties/overflow.c b/src/parse/properties/overflow.c index 7bc1938..dbb373a 100644 --- a/src/parse/properties/overflow.c +++ b/src/parse/properties/overflow.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_overflow(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error1, error2 = CSS_OK; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/padding.c b/src/parse/properties/padding.c index bef3607..a87ffa5 100644 --- a/src/parse/properties/padding.c +++ b/src/parse/properties/padding.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_padding(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_fixed side_length[4]; diff --git a/src/parse/properties/pause.c b/src/parse/properties/pause.c index b238d20..e558337 100644 --- a/src/parse/properties/pause.c +++ b/src/parse/properties/pause.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_pause(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *first_token; const css_token *token; diff --git a/src/parse/properties/play_during.c b/src/parse/properties/play_during.c index 54e048f..da7f236 100644 --- a/src/parse/properties/play_during.c +++ b/src/parse/properties/play_during.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_play_during(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; uint8_t flags = 0; diff --git a/src/parse/properties/properties.c b/src/parse/properties/properties.c index 06524da..2cc849c 100644 --- a/src/parse/properties/properties.c +++ b/src/parse/properties/properties.c @@ -74,6 +74,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] = css__parse_display, css__parse_elevation, css__parse_empty_cells, + css__parse_fill_opacity, css__parse_flex, css__parse_flex_basis, css__parse_flex_direction, @@ -140,6 +141,7 @@ const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP] = css__parse_speak, css__parse_speech_rate, css__parse_stress, + css__parse_stroke_opacity, css__parse_table_layout, css__parse_text_align, css__parse_text_decoration, @@ -261,6 +263,8 @@ const uint32_t property_unit_mask[CSS_N_PROPERTIES] = { [CSS_PROP_WORD_SPACING] = UNIT_MASK_WORD_SPACING, [CSS_PROP_Z_INDEX] = UNIT_MASK_Z_INDEX, [CSS_PROP_OPACITY] = UNIT_MASK_OPACITY, + [CSS_PROP_FILL_OPACITY] = UNIT_MASK_FILL_OPACITY, + [CSS_PROP_STROKE_OPACITY] = UNIT_MASK_STROKE_OPACITY, [CSS_PROP_BREAK_AFTER] = UNIT_MASK_BREAK_AFTER, [CSS_PROP_BREAK_BEFORE] = UNIT_MASK_BREAK_BEFORE, [CSS_PROP_BREAK_INSIDE] = UNIT_MASK_BREAK_INSIDE, diff --git a/src/parse/properties/properties.h b/src/parse/properties/properties.h index 1e7f821..17b7f41 100644 --- a/src/parse/properties/properties.h +++ b/src/parse/properties/properties.h @@ -17,445 +17,451 @@ * Type of property handler function */ typedef css_error (*css_prop_handler)(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); extern const css_prop_handler property_handlers[LAST_PROP + 1 - FIRST_PROP]; css_error css__parse_align_content(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_align_items(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_align_self(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_azimuth(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background_attachment(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background_image(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_background_repeat(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_bottom_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_bottom_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_bottom_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_collapse(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_left_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_left_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_left_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_right_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_right_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_right_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_top_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_top_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_top_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_border_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_box_sizing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_break_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_break_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_break_inside(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_caption_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_clear(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_clip(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_columns(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_count(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_fill(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_gap(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_rule(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_rule_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_rule_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_rule_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_span(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_column_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_content(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_counter_increment(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_counter_reset(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_cue(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_cue_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_cue_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_cursor(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_direction(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_display(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_elevation(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_empty_cells(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, + css_style *result); +css_error css__parse_fill_opacity(css_language *c, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_basis(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_direction(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_flow(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_grow(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_shrink(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_flex_wrap(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_float(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font_size(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font_variant(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_font_weight(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_justify_content(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_letter_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_line_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_list_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_list_style_image(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_list_style_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_list_style_type(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_margin(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_margin_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_margin_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_margin_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_margin_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_max_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_max_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_min_height(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_min_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_opacity(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_order(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_orphans(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_outline(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_outline_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_outline_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_outline_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_overflow(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_overflow_x(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_overflow_y(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_padding(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_padding_bottom(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_padding_left(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_padding_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_padding_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_page_break_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_page_break_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_page_break_inside(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_pause(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_pause_after(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_pause_before(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_pitch_range(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_pitch(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_play_during(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_position(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_quotes(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_richness(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_right(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_speak_header(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_speak_numeral(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_speak_punctuation(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_speak(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_speech_rate(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_stress(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, + css_style *result); +css_error css__parse_stroke_opacity(css_language *c, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_table_layout(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_text_align(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_text_decoration(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_text_indent(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_text_transform(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_top(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_unicode_bidi(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_vertical_align(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_visibility(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_voice_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_volume(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_white_space(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_widows(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_word_spacing(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_writing_mode(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); css_error css__parse_z_index(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result); /** Mapping from property bytecode index to bytecode unit class mask. */ @@ -546,6 +552,8 @@ extern const uint32_t property_unit_mask[CSS_N_PROPERTIES]; #define UNIT_MASK_WORD_SPACING (UNIT_LENGTH) #define UNIT_MASK_Z_INDEX (0) #define UNIT_MASK_OPACITY (0) +#define UNIT_MASK_FILL_OPACITY (0) +#define UNIT_MASK_STROKE_OPACITY (0) #define UNIT_MASK_BREAK_AFTER (0) #define UNIT_MASK_BREAK_BEFORE (0) #define UNIT_MASK_BREAK_INSIDE (0) diff --git a/src/parse/properties/quotes.c b/src/parse/properties/quotes.c index b71158f..f5360a4 100644 --- a/src/parse/properties/quotes.c +++ b/src/parse/properties/quotes.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_quotes(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_INVALID; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/stroke_opacity.c b/src/parse/properties/stroke_opacity.c new file mode 100644 index 0000000..7c10998 --- /dev/null +++ b/src/parse/properties/stroke_opacity.c @@ -0,0 +1,82 @@ +/* + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + */ + +#include <assert.h> +#include <string.h> + +#include "bytecode/bytecode.h" +#include "bytecode/opcodes.h" +#include "parse/properties/properties.h" +#include "parse/properties/utils.h" + +/** + * Parse stroke-opacity + * + * \param c Parsing context + * \param vector Vector of tokens to process + * \param ctx Pointer to vector iteration context + * \param result resulting style + * \return CSS_OK on success, + * CSS_NOMEM on memory exhaustion, + * CSS_INVALID if the input is not valid + * + * Post condition: \a *ctx is updated with the next token to process + * If the input is invalid, then \a *ctx remains unchanged. + */ +css_error css__parse_stroke_opacity(css_language *c, + const parserutils_vector *vector, int32_t *ctx, + css_style *result) +{ + int32_t orig_ctx = *ctx; + css_error error; + const css_token *token; + enum flag_value flag_value; + + token = parserutils_vector_iterate(vector, ctx); + if ((token == NULL) || ((token->type != CSS_TOKEN_IDENT) && (token->type != CSS_TOKEN_NUMBER))) { + *ctx = orig_ctx; + return CSS_INVALID; + } + + flag_value = get_css_flag_value(c, token); + + if (flag_value != FLAG_VALUE__NONE) { + error = css_stylesheet_style_flag_value(result, flag_value, + CSS_PROP_STROKE_OPACITY); + + } else if (token->type == CSS_TOKEN_NUMBER) { + css_fixed num = 0; + size_t consumed = 0; + + num = css__number_from_lwc_string(token->idata, false, &consumed); + /* Invalid if there are trailing characters */ + if (consumed != lwc_string_length(token->idata)) { + *ctx = orig_ctx; + return CSS_INVALID; + } + + /* Clamp to range [0,1] */ + if (num < 0) + num = 0; + if (num > INTTOFIX(1)) + num = INTTOFIX(1); + + error = css__stylesheet_style_appendOPV(result, CSS_PROP_STROKE_OPACITY, 0, STROKE_OPACITY_SET); + if (error != CSS_OK) { + *ctx = orig_ctx; + return error; + } + + error = css__stylesheet_style_append(result, num); + } else { + error = CSS_INVALID; + } + + if (error != CSS_OK) + *ctx = orig_ctx; + + return error; +} + diff --git a/src/parse/properties/text_decoration.c b/src/parse/properties/text_decoration.c index 1345b8e..4849a12 100644 --- a/src/parse/properties/text_decoration.c +++ b/src/parse/properties/text_decoration.c @@ -28,10 +28,10 @@ * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_text_decoration(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error = CSS_INVALID; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/properties/utils.c b/src/parse/properties/utils.c index 1e184f8..e6ab872 100644 --- a/src/parse/properties/utils.c +++ b/src/parse/properties/utils.c @@ -126,10 +126,10 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *ide * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum border_side_e side) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx; const css_token *token; css_error error = CSS_OK; @@ -366,10 +366,10 @@ static void HSL_to_RGB(css_fixed hue, css_fixed sat, css_fixed lit, uint8_t *r, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_colour_specifier(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint16_t *value, uint32_t *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; const css_token *token; bool match; css_error error; @@ -913,11 +913,11 @@ css_error css__parse_hash_colour(lwc_string *data, uint32_t *result) * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_unit_specifier(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint32_t default_unit, css_fixed *length, uint32_t *unit) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; const css_token *token; css_fixed num; size_t consumed = 0; @@ -938,7 +938,7 @@ css_error css__parse_unit_specifier(css_language *c, if (token->type == CSS_TOKEN_DIMENSION) { size_t len = lwc_string_length(token->idata); const char *data = lwc_string_data(token->idata); - css_unit temp_unit = CSS_UNIT_PX; + uint32_t temp_unit = CSS_UNIT_PX; error = css__parse_unit_keyword(data + consumed, len - consumed, &temp_unit); @@ -947,7 +947,7 @@ css_error css__parse_unit_specifier(css_language *c, return error; } - *unit = (uint32_t) temp_unit; + *unit = temp_unit; } else if (token->type == CSS_TOKEN_NUMBER) { /* Non-zero values are permitted in quirks mode */ if (num != 0) { @@ -966,8 +966,8 @@ css_error css__parse_unit_specifier(css_language *c, * dimensions separated from their units by whitespace * (e.g. "0 px") */ - int temp_ctx = *ctx; - css_unit temp_unit; + int32_t temp_ctx = *ctx; + uint32_t temp_unit; consumeWhitespace(vector, &temp_ctx); @@ -981,7 +981,7 @@ css_error css__parse_unit_specifier(css_language *c, if (error == CSS_OK) { c->sheet->quirks_used = true; *ctx = temp_ctx; - *unit = (uint32_t) temp_unit; + *unit = temp_unit; } } } @@ -1103,7 +1103,7 @@ css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit) * The resulting string's reference is passed to the caller */ css_error css__ident_list_or_string_to_string(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), lwc_string **result) { @@ -1141,11 +1141,11 @@ css_error css__ident_list_or_string_to_string(css_language *c, * The resulting string's reference is passed to the caller */ css_error css__ident_list_to_string(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), lwc_string **result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; const css_token *token; css_error error = CSS_OK; parserutils_buffer *buffer; @@ -1229,12 +1229,12 @@ cleanup: * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__comma_list_to_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), css_code_t (*get_value)(css_language *c, const css_token *token, bool first), css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; int prev_ctx = orig_ctx; const css_token *token; bool first = true; diff --git a/src/parse/properties/utils.h b/src/parse/properties/utils.h index 54a3fd1..aab14e8 100644 --- a/src/parse/properties/utils.h +++ b/src/parse/properties/utils.h @@ -66,7 +66,7 @@ enum border_side_e { BORDER_SIDE_TOP = 0, BORDER_SIDE_RIGHT = 1, BORDER_SIDE_BOT * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum border_side_e side); /** @@ -85,7 +85,7 @@ css_error css__parse_border_side(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_side_color(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); /** @@ -104,7 +104,7 @@ css_error css__parse_border_side_color(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_side_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); @@ -124,7 +124,7 @@ css_error css__parse_border_side_style(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_border_side_width(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); @@ -144,7 +144,7 @@ css_error css__parse_border_side_width(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); @@ -163,7 +163,7 @@ css_error css__parse_side(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_margin_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); /** @@ -181,7 +181,7 @@ css_error css__parse_margin_side(css_language *c, * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_padding_side(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result, enum css_properties_e op); @@ -194,7 +194,7 @@ css_error css__parse_list_style_type_value(css_language *c, const css_token *token, uint16_t *value); css_error css__parse_colour_specifier(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint16_t *value, uint32_t *result); css_error css__parse_named_colour(css_language *c, lwc_string *data, @@ -203,7 +203,7 @@ css_error css__parse_named_colour(css_language *c, lwc_string *data, css_error css__parse_hash_colour(lwc_string *data, uint32_t *result); css_error css__parse_unit_specifier(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, uint32_t default_unit, css_fixed *length, uint32_t *unit); @@ -211,17 +211,17 @@ css_error css__parse_unit_keyword(const char *ptr, size_t len, uint32_t *unit); css_error css__ident_list_or_string_to_string(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), lwc_string **result); css_error css__ident_list_to_string(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), lwc_string **result); css_error css__comma_list_to_style(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, bool (*reserved)(css_language *c, const css_token *ident), css_code_t (*get_value)(css_language *c, const css_token *token, diff --git a/src/parse/properties/voice_family.c b/src/parse/properties/voice_family.c index f62ba15..45d63f1 100644 --- a/src/parse/properties/voice_family.c +++ b/src/parse/properties/voice_family.c @@ -84,10 +84,10 @@ static css_code_t voice_family_value(css_language *c, const css_token *token, bo * If the input is invalid, then \a *ctx remains unchanged. */ css_error css__parse_voice_family(css_language *c, - const parserutils_vector *vector, int *ctx, + const parserutils_vector *vector, int32_t *ctx, css_style *result) { - int orig_ctx = *ctx; + int32_t orig_ctx = *ctx; css_error error; const css_token *token; enum flag_value flag_value; diff --git a/src/parse/propstrings.c b/src/parse/propstrings.c index 786a3b7..c57bc1b 100644 --- a/src/parse/propstrings.c +++ b/src/parse/propstrings.c @@ -148,6 +148,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = { SMAP("display"), SMAP("elevation"), SMAP("empty-cells"), + SMAP("fill-opacity"), SMAP("flex"), SMAP("flex-basis"), SMAP("flex-direction"), @@ -214,6 +215,7 @@ const stringmap_entry stringmap[LAST_KNOWN] = { SMAP("speak"), SMAP("speech-rate"), SMAP("stress"), + SMAP("stroke-opacity"), SMAP("table-layout"), SMAP("text-align"), SMAP("text-decoration"), diff --git a/src/parse/propstrings.h b/src/parse/propstrings.h index 6d6dd49..8491e72 100644 --- a/src/parse/propstrings.h +++ b/src/parse/propstrings.h @@ -51,22 +51,23 @@ enum { COLUMN_COUNT, COLUMN_FILL, COLUMN_GAP, COLUMN_RULE, COLUMN_RULE_COLOR, COLUMN_RULE_STYLE, COLUMN_RULE_WIDTH, COLUMN_SPAN, COLUMN_WIDTH, CONTENT, COUNTER_INCREMENT, COUNTER_RESET, CUE, CUE_AFTER, CUE_BEFORE, - CURSOR, DIRECTION, DISPLAY, ELEVATION, EMPTY_CELLS, FLEX, FLEX_BASIS, - FLEX_DIRECTION, FLEX_FLOW, FLEX_GROW, FLEX_SHRINK, FLEX_WRAP, - LIBCSS_FLOAT, FONT, FONT_FAMILY, FONT_SIZE, FONT_STYLE, FONT_VARIANT, - FONT_WEIGHT, HEIGHT, JUSTIFY_CONTENT, LEFT, LETTER_SPACING, LINE_HEIGHT, - LIST_STYLE, LIST_STYLE_IMAGE, LIST_STYLE_POSITION, LIST_STYLE_TYPE, - MARGIN, MARGIN_BOTTOM, MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, - MAX_HEIGHT, MAX_WIDTH, MIN_HEIGHT, MIN_WIDTH, OPACITY, ORDER, ORPHANS, - OUTLINE, OUTLINE_COLOR, OUTLINE_STYLE, OUTLINE_WIDTH, OVERFLOW, - OVERFLOW_X, OVERFLOW_Y, PADDING, PADDING_BOTTOM, PADDING_LEFT, - PADDING_RIGHT, PADDING_TOP, PAGE_BREAK_AFTER, PAGE_BREAK_BEFORE, - PAGE_BREAK_INSIDE, PAUSE, PAUSE_AFTER, PAUSE_BEFORE, PITCH_RANGE, PITCH, - PLAY_DURING, POSITION, QUOTES, RICHNESS, RIGHT, SPEAK_HEADER, - SPEAK_NUMERAL, SPEAK_PUNCTUATION, SPEAK, SPEECH_RATE, STRESS, - TABLE_LAYOUT, TEXT_ALIGN, TEXT_DECORATION, TEXT_INDENT, TEXT_TRANSFORM, - TOP, UNICODE_BIDI, VERTICAL_ALIGN, VISIBILITY, VOICE_FAMILY, VOLUME, - WHITE_SPACE, WIDOWS, WIDTH, WORD_SPACING, WRITING_MODE, Z_INDEX, + CURSOR, DIRECTION, DISPLAY, ELEVATION, EMPTY_CELLS, FILL_OPACITY, FLEX, + FLEX_BASIS, FLEX_DIRECTION, FLEX_FLOW, FLEX_GROW, FLEX_SHRINK, + FLEX_WRAP, LIBCSS_FLOAT, FONT, FONT_FAMILY, FONT_SIZE, FONT_STYLE, + FONT_VARIANT, FONT_WEIGHT, HEIGHT, JUSTIFY_CONTENT, LEFT, + LETTER_SPACING, LINE_HEIGHT, LIST_STYLE, LIST_STYLE_IMAGE, + LIST_STYLE_POSITION, LIST_STYLE_TYPE, MARGIN, MARGIN_BOTTOM, + MARGIN_LEFT, MARGIN_RIGHT, MARGIN_TOP, MAX_HEIGHT, MAX_WIDTH, + MIN_HEIGHT, MIN_WIDTH, OPACITY, ORDER, ORPHANS, OUTLINE, OUTLINE_COLOR, + OUTLINE_STYLE, OUTLINE_WIDTH, OVERFLOW, OVERFLOW_X, OVERFLOW_Y, PADDING, + PADDING_BOTTOM, PADDING_LEFT, PADDING_RIGHT, PADDING_TOP, + PAGE_BREAK_AFTER, PAGE_BREAK_BEFORE, PAGE_BREAK_INSIDE, PAUSE, + PAUSE_AFTER, PAUSE_BEFORE, PITCH_RANGE, PITCH, PLAY_DURING, POSITION, + QUOTES, RICHNESS, RIGHT, SPEAK_HEADER, SPEAK_NUMERAL, SPEAK_PUNCTUATION, + SPEAK, SPEECH_RATE, STRESS, STROKE_OPACITY, TABLE_LAYOUT, TEXT_ALIGN, + TEXT_DECORATION, TEXT_INDENT, TEXT_TRANSFORM, TOP, UNICODE_BIDI, + VERTICAL_ALIGN, VISIBILITY, VOICE_FAMILY, VOLUME, WHITE_SPACE, WIDOWS, + WIDTH, WORD_SPACING, WRITING_MODE, Z_INDEX, LAST_PROP = Z_INDEX, diff --git a/src/select/Makefile b/src/select/Makefile index b9e7390..e237d46 100644 --- a/src/select/Makefile +++ b/src/select/Makefile @@ -1,4 +1,5 @@ # Sources +.PHONY: select_generator select_generator: python3 src/select/select_generator.py diff --git a/src/select/autogenerated_computed.h b/src/select/autogenerated_computed.h index c65cf98..40005c1 100644 --- a/src/select/autogenerated_computed.h +++ b/src/select/autogenerated_computed.h @@ -52,6 +52,7 @@ struct css_computed_style_i { * direction 2 * display 5 * empty_cells 2 + * fill_opacity 1 4 * flex_basis 2 + 5 4 * flex_direction 3 * flex_grow 1 4 @@ -95,6 +96,7 @@ struct css_computed_style_i { * page_break_inside 2 * position 3 * right 2 + 5 4 + * stroke_opacity 1 4 * table_layout 2 * text_align 4 * text_decoration 5 @@ -140,9 +142,9 @@ struct css_computed_style_i { * quotes 1 sizeof(ptr) * * --- --- --- - * 462 bits 228 + 8sizeof(ptr) bytes + * 464 bits 236 + 8sizeof(ptr) bytes * =================== - * 286 + 8sizeof(ptr) bytes + * 294 + 8sizeof(ptr) bytes * * Bit allocations: * @@ -192,15 +194,15 @@ struct css_computed_style_i { * 12 bbbbbbbbbbbaaaaaaaaaaavvvvvvvvvw * border_spacing; background_position; vertical_align; widows * - * 13 bbbbpppaaagggooovvvjjjffflllcccq + * 13 bbbbpppaaagggooovvvjjjffflllcccs * border_bottom_style; position; page_break_before; page_break_after; * overflow_y; overflow_x; justify_content; font_family; flex_direction; clear; - * quotes + * stroke_opacity * - * 14 bbaaorplfecuCk.................. - * background_color; background_attachment; orphans; order; opacity; - * list_style_image; flex_shrink; flex_grow; counter_reset; counter_increment; - * color; background_image + * 14 bbaaqorplfeicuCk................ + * background_color; background_attachment; quotes; orphans; order; opacity; + * list_style_image; flex_shrink; flex_grow; fill_opacity; counter_reset; + * counter_increment; color; background_image */ uint32_t bits[15]; @@ -229,6 +231,7 @@ struct css_computed_style_i { css_color column_rule_color; css_fixed column_rule_width; css_fixed column_width; + css_fixed fill_opacity; css_fixed flex_basis; css_fixed flex_grow; css_fixed flex_shrink; @@ -256,6 +259,7 @@ struct css_computed_style_i { css_fixed padding_right; css_fixed padding_top; css_fixed right; + css_fixed stroke_opacity; css_fixed text_indent; css_fixed top; css_fixed vertical_align; diff --git a/src/select/autogenerated_propget.h b/src/select/autogenerated_propget.h index 6c958aa..d1f7ffb 100644 --- a/src/select/autogenerated_propget.h +++ b/src/select/autogenerated_propget.h @@ -140,8 +140,8 @@ static inline uint8_t get_background_color(const css_computed_style *style, #undef BACKGROUND_COLOR_MASK #define BACKGROUND_IMAGE_INDEX 14 -#define BACKGROUND_IMAGE_SHIFT 18 -#define BACKGROUND_IMAGE_MASK 0x40000 +#define BACKGROUND_IMAGE_SHIFT 16 +#define BACKGROUND_IMAGE_MASK 0x10000 static inline uint8_t get_background_image_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[BACKGROUND_IMAGE_INDEX]; @@ -878,8 +878,8 @@ static inline uint8_t get_clip( #undef CLIP_MASK #define COLOR_INDEX 14 -#define COLOR_SHIFT 19 -#define COLOR_MASK 0x80000 +#define COLOR_SHIFT 17 +#define COLOR_MASK 0x20000 static inline uint8_t get_color_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[COLOR_INDEX]; @@ -1166,8 +1166,8 @@ static inline uint8_t get_content(const css_computed_style *style, const #undef CONTENT_MASK #define COUNTER_INCREMENT_INDEX 14 -#define COUNTER_INCREMENT_SHIFT 20 -#define COUNTER_INCREMENT_MASK 0x100000 +#define COUNTER_INCREMENT_SHIFT 18 +#define COUNTER_INCREMENT_MASK 0x40000 static inline uint8_t get_counter_increment_bits(const css_computed_style *style) { @@ -1195,8 +1195,8 @@ static inline uint8_t get_counter_increment(const css_computed_style *style, #undef COUNTER_INCREMENT_MASK #define COUNTER_RESET_INDEX 14 -#define COUNTER_RESET_SHIFT 21 -#define COUNTER_RESET_MASK 0x200000 +#define COUNTER_RESET_SHIFT 19 +#define COUNTER_RESET_MASK 0x80000 static inline uint8_t get_counter_reset_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[COUNTER_RESET_INDEX]; @@ -1328,6 +1328,36 @@ static inline uint8_t get_empty_cells(const css_computed_style *style) #undef EMPTY_CELLS_SHIFT #undef EMPTY_CELLS_MASK +#define FILL_OPACITY_INDEX 14 +#define FILL_OPACITY_SHIFT 20 +#define FILL_OPACITY_MASK 0x100000 +static inline uint8_t get_fill_opacity_bits(const css_computed_style *style) +{ + uint32_t bits = style->i.bits[FILL_OPACITY_INDEX]; + bits &= FILL_OPACITY_MASK; + bits >>= FILL_OPACITY_SHIFT; + + /* 1bit: t : type */ + return (bits & 0x1); +} +static inline uint8_t get_fill_opacity(const css_computed_style *style, + css_fixed *fixed) +{ + uint32_t bits = style->i.bits[FILL_OPACITY_INDEX]; + bits &= FILL_OPACITY_MASK; + bits >>= FILL_OPACITY_SHIFT; + + /* 1bit: t : type */ + if ((bits & 0x1) == CSS_FILL_OPACITY_SET) { + *fixed = style->i.fill_opacity; + } + + return (bits & 0x1); +} +#undef FILL_OPACITY_INDEX +#undef FILL_OPACITY_SHIFT +#undef FILL_OPACITY_MASK + #define FLEX_BASIS_INDEX 7 #define FLEX_BASIS_SHIFT 4 #define FLEX_BASIS_MASK 0x7f0 @@ -1386,8 +1416,8 @@ static inline uint8_t get_flex_direction(const css_computed_style *style) #undef FLEX_DIRECTION_MASK #define FLEX_GROW_INDEX 14 -#define FLEX_GROW_SHIFT 22 -#define FLEX_GROW_MASK 0x400000 +#define FLEX_GROW_SHIFT 21 +#define FLEX_GROW_MASK 0x200000 static inline uint8_t get_flex_grow_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[FLEX_GROW_INDEX]; @@ -1416,8 +1446,8 @@ static inline uint8_t get_flex_grow(const css_computed_style *style, css_fixed #undef FLEX_GROW_MASK #define FLEX_SHRINK_INDEX 14 -#define FLEX_SHRINK_SHIFT 23 -#define FLEX_SHRINK_MASK 0x800000 +#define FLEX_SHRINK_SHIFT 22 +#define FLEX_SHRINK_MASK 0x400000 static inline uint8_t get_flex_shrink_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[FLEX_SHRINK_INDEX]; @@ -1790,8 +1820,8 @@ static inline uint8_t get_line_height( #undef LINE_HEIGHT_MASK #define LIST_STYLE_IMAGE_INDEX 14 -#define LIST_STYLE_IMAGE_SHIFT 24 -#define LIST_STYLE_IMAGE_MASK 0x1000000 +#define LIST_STYLE_IMAGE_SHIFT 23 +#define LIST_STYLE_IMAGE_MASK 0x800000 static inline uint8_t get_list_style_image_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[LIST_STYLE_IMAGE_INDEX]; @@ -2119,8 +2149,8 @@ static inline uint8_t get_min_width(const css_computed_style *style, css_fixed #undef MIN_WIDTH_MASK #define OPACITY_INDEX 14 -#define OPACITY_SHIFT 25 -#define OPACITY_MASK 0x2000000 +#define OPACITY_SHIFT 24 +#define OPACITY_MASK 0x1000000 static inline uint8_t get_opacity_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[OPACITY_INDEX]; @@ -2149,8 +2179,8 @@ static inline uint8_t get_opacity(const css_computed_style *style, css_fixed #undef OPACITY_MASK #define ORDER_INDEX 14 -#define ORDER_SHIFT 26 -#define ORDER_MASK 0x4000000 +#define ORDER_SHIFT 25 +#define ORDER_MASK 0x2000000 static inline uint8_t get_order_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[ORDER_INDEX]; @@ -2179,8 +2209,8 @@ static inline uint8_t get_order(const css_computed_style *style, int32_t #undef ORDER_MASK #define ORPHANS_INDEX 14 -#define ORPHANS_SHIFT 27 -#define ORPHANS_MASK 0x8000000 +#define ORPHANS_SHIFT 26 +#define ORPHANS_MASK 0x4000000 static inline uint8_t get_orphans_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[ORPHANS_INDEX]; @@ -2575,9 +2605,9 @@ static inline uint8_t get_position(const css_computed_style *style) #undef POSITION_SHIFT #undef POSITION_MASK -#define QUOTES_INDEX 13 -#define QUOTES_SHIFT 0 -#define QUOTES_MASK 0x1 +#define QUOTES_INDEX 14 +#define QUOTES_SHIFT 27 +#define QUOTES_MASK 0x8000000 static inline uint8_t get_quotes_bits(const css_computed_style *style) { uint32_t bits = style->i.bits[QUOTES_INDEX]; @@ -2634,6 +2664,36 @@ static inline uint8_t get_right(const css_computed_style *style, css_fixed #undef RIGHT_SHIFT #undef RIGHT_MASK +#define STROKE_OPACITY_INDEX 13 +#define STROKE_OPACITY_SHIFT 0 +#define STROKE_OPACITY_MASK 0x1 +static inline uint8_t get_stroke_opacity_bits(const css_computed_style *style) +{ + uint32_t bits = style->i.bits[STROKE_OPACITY_INDEX]; + bits &= STROKE_OPACITY_MASK; + bits >>= STROKE_OPACITY_SHIFT; + + /* 1bit: t : type */ + return (bits & 0x1); +} +static inline uint8_t get_stroke_opacity(const css_computed_style *style, + css_fixed *fixed) +{ + uint32_t bits = style->i.bits[STROKE_OPACITY_INDEX]; + bits &= STROKE_OPACITY_MASK; + bits >>= STROKE_OPACITY_SHIFT; + + /* 1bit: t : type */ + if ((bits & 0x1) == CSS_STROKE_OPACITY_SET) { + *fixed = style->i.stroke_opacity; + } + + return (bits & 0x1); +} +#undef STROKE_OPACITY_INDEX +#undef STROKE_OPACITY_SHIFT +#undef STROKE_OPACITY_MASK + #define TABLE_LAYOUT_INDEX 10 #define TABLE_LAYOUT_SHIFT 10 #define TABLE_LAYOUT_MASK 0xc00 diff --git a/src/select/autogenerated_propset.h b/src/select/autogenerated_propset.h index 71d1596..198bc1e 100644 --- a/src/select/autogenerated_propset.h +++ b/src/select/autogenerated_propset.h @@ -104,8 +104,8 @@ static inline css_error set_background_color(css_computed_style *style, uint8_t #undef BACKGROUND_COLOR_MASK #define BACKGROUND_IMAGE_INDEX 14 -#define BACKGROUND_IMAGE_SHIFT 18 -#define BACKGROUND_IMAGE_MASK 0x40000 +#define BACKGROUND_IMAGE_SHIFT 16 +#define BACKGROUND_IMAGE_MASK 0x10000 static inline css_error set_background_image(css_computed_style *style, uint8_t type, lwc_string *string) @@ -639,8 +639,8 @@ static inline css_error set_clip( #undef CLIP_MASK #define COLOR_INDEX 14 -#define COLOR_SHIFT 19 -#define COLOR_MASK 0x80000 +#define COLOR_SHIFT 17 +#define COLOR_MASK 0x20000 static inline css_error set_color(css_computed_style *style, uint8_t type, css_color color) @@ -902,8 +902,8 @@ static inline css_error set_content( #undef CONTENT_MASK #define COUNTER_INCREMENT_INDEX 14 -#define COUNTER_INCREMENT_SHIFT 20 -#define COUNTER_INCREMENT_MASK 0x100000 +#define COUNTER_INCREMENT_SHIFT 18 +#define COUNTER_INCREMENT_MASK 0x40000 static inline css_error set_counter_increment(css_computed_style *style, uint8_t type, css_computed_counter *counter_arr) @@ -938,8 +938,8 @@ static inline css_error set_counter_increment(css_computed_style *style, #undef COUNTER_INCREMENT_MASK #define COUNTER_RESET_INDEX 14 -#define COUNTER_RESET_SHIFT 21 -#define COUNTER_RESET_MASK 0x200000 +#define COUNTER_RESET_SHIFT 19 +#define COUNTER_RESET_MASK 0x80000 static inline css_error set_counter_reset(css_computed_style *style, uint8_t type, css_computed_counter *counter_arr) @@ -1063,6 +1063,27 @@ static inline css_error set_empty_cells(css_computed_style *style, uint8_t type) #undef EMPTY_CELLS_SHIFT #undef EMPTY_CELLS_MASK +#define FILL_OPACITY_INDEX 14 +#define FILL_OPACITY_SHIFT 20 +#define FILL_OPACITY_MASK 0x100000 + +static inline css_error set_fill_opacity(css_computed_style *style, uint8_t + type, css_fixed fixed) +{ + uint32_t *bits = &style->i.bits[FILL_OPACITY_INDEX]; + + /* 1bit: t : type */ + *bits = (*bits & ~FILL_OPACITY_MASK) | (((uint32_t)type & 0x1) << + FILL_OPACITY_SHIFT); + + style->i.fill_opacity = fixed; + + return CSS_OK; +} +#undef FILL_OPACITY_INDEX +#undef FILL_OPACITY_SHIFT +#undef FILL_OPACITY_MASK + #define FLEX_BASIS_INDEX 7 #define FLEX_BASIS_SHIFT 4 #define FLEX_BASIS_MASK 0x7f0 @@ -1104,8 +1125,8 @@ static inline css_error set_flex_direction(css_computed_style *style, uint8_t #undef FLEX_DIRECTION_MASK #define FLEX_GROW_INDEX 14 -#define FLEX_GROW_SHIFT 22 -#define FLEX_GROW_MASK 0x400000 +#define FLEX_GROW_SHIFT 21 +#define FLEX_GROW_MASK 0x200000 static inline css_error set_flex_grow(css_computed_style *style, uint8_t type, css_fixed fixed) @@ -1125,8 +1146,8 @@ static inline css_error set_flex_grow(css_computed_style *style, uint8_t type, #undef FLEX_GROW_MASK #define FLEX_SHRINK_INDEX 14 -#define FLEX_SHRINK_SHIFT 23 -#define FLEX_SHRINK_MASK 0x800000 +#define FLEX_SHRINK_SHIFT 22 +#define FLEX_SHRINK_MASK 0x400000 static inline css_error set_flex_shrink(css_computed_style *style, uint8_t type, css_fixed fixed) @@ -1396,8 +1417,8 @@ static inline css_error set_line_height(css_computed_style *style, uint8_t #undef LINE_HEIGHT_MASK #define LIST_STYLE_IMAGE_INDEX 14 -#define LIST_STYLE_IMAGE_SHIFT 24 -#define LIST_STYLE_IMAGE_MASK 0x1000000 +#define LIST_STYLE_IMAGE_SHIFT 23 +#define LIST_STYLE_IMAGE_MASK 0x800000 static inline css_error set_list_style_image(css_computed_style *style, uint8_t type, lwc_string *string) @@ -1632,8 +1653,8 @@ static inline css_error set_min_width(css_computed_style *style, uint8_t type, #undef MIN_WIDTH_MASK #define OPACITY_INDEX 14 -#define OPACITY_SHIFT 25 -#define OPACITY_MASK 0x2000000 +#define OPACITY_SHIFT 24 +#define OPACITY_MASK 0x1000000 static inline css_error set_opacity(css_computed_style *style, uint8_t type, css_fixed fixed) @@ -1653,8 +1674,8 @@ static inline css_error set_opacity(css_computed_style *style, uint8_t type, #undef OPACITY_MASK #define ORDER_INDEX 14 -#define ORDER_SHIFT 26 -#define ORDER_MASK 0x4000000 +#define ORDER_SHIFT 25 +#define ORDER_MASK 0x2000000 static inline css_error set_order(css_computed_style *style, uint8_t type, int32_t integer) @@ -1673,8 +1694,8 @@ static inline css_error set_order(css_computed_style *style, uint8_t type, #undef ORDER_MASK #define ORPHANS_INDEX 14 -#define ORPHANS_SHIFT 27 -#define ORPHANS_MASK 0x8000000 +#define ORPHANS_SHIFT 26 +#define ORPHANS_MASK 0x4000000 static inline css_error set_orphans(css_computed_style *style, uint8_t type, int32_t integer) @@ -1949,9 +1970,9 @@ static inline css_error set_position(css_computed_style *style, uint8_t type) #undef POSITION_SHIFT #undef POSITION_MASK -#define QUOTES_INDEX 13 -#define QUOTES_SHIFT 0 -#define QUOTES_MASK 0x1 +#define QUOTES_INDEX 14 +#define QUOTES_SHIFT 27 +#define QUOTES_MASK 0x8000000 static inline css_error set_quotes(css_computed_style *style, uint8_t type, lwc_string **string_arr) @@ -2006,6 +2027,27 @@ static inline css_error set_right(css_computed_style *style, uint8_t type, #undef RIGHT_SHIFT #undef RIGHT_MASK +#define STROKE_OPACITY_INDEX 13 +#define STROKE_OPACITY_SHIFT 0 +#define STROKE_OPACITY_MASK 0x1 + +static inline css_error set_stroke_opacity(css_computed_style *style, uint8_t + type, css_fixed fixed) +{ + uint32_t *bits = &style->i.bits[STROKE_OPACITY_INDEX]; + + /* 1bit: t : type */ + *bits = (*bits & ~STROKE_OPACITY_MASK) | (((uint32_t)type & 0x1) << + STROKE_OPACITY_SHIFT); + + style->i.stroke_opacity = fixed; + + return CSS_OK; +} +#undef STROKE_OPACITY_INDEX +#undef STROKE_OPACITY_SHIFT +#undef STROKE_OPACITY_MASK + #define TABLE_LAYOUT_INDEX 10 #define TABLE_LAYOUT_SHIFT 10 #define TABLE_LAYOUT_MASK 0xc00 diff --git a/src/select/computed.c b/src/select/computed.c index c257f17..78f3b80 100644 --- a/src/select/computed.c +++ b/src/select/computed.c @@ -810,6 +810,18 @@ uint8_t css_computed_opacity(const css_computed_style *style, return get_opacity(style, opacity); } +uint8_t css_computed_fill_opacity(const css_computed_style *style, + css_fixed *fill_opacity) +{ + return get_fill_opacity(style, fill_opacity); +} + +uint8_t css_computed_stroke_opacity(const css_computed_style *style, + css_fixed *stroke_opacity) +{ + return get_stroke_opacity(style, stroke_opacity); +} + uint8_t css_computed_text_transform(const css_computed_style *style) { return get_text_transform(style); diff --git a/src/select/dispatch.c b/src/select/dispatch.c index a6c868d..cee9335 100644 --- a/src/select/dispatch.c +++ b/src/select/dispatch.c @@ -514,5 +514,13 @@ struct prop_table prop_dispatch[CSS_N_PROPERTIES] = { { PROPERTY_FUNCS(order), 0, + }, + { + PROPERTY_FUNCS(fill_opacity), + 1, + }, + { + PROPERTY_FUNCS(stroke_opacity), + 1, } }; diff --git a/src/select/properties/Makefile b/src/select/properties/Makefile index 6c6cf84..eee6cc3 100644 --- a/src/select/properties/Makefile +++ b/src/select/properties/Makefile @@ -50,6 +50,7 @@ direction.c \ display.c \ elevation.c \ empty_cells.c \ +fill_opacity.c \ flex_basis.c \ flex_direction.c \ flex_grow.c \ @@ -107,6 +108,7 @@ speak_header.c \ speak_numeral.c \ speak_punctuation.c \ stress.c \ +stroke_opacity.c \ table_layout.c \ text_align.c \ text_decoration.c \ diff --git a/src/select/properties/fill_opacity.c b/src/select/properties/fill_opacity.c new file mode 100644 index 0000000..af0b52b --- /dev/null +++ b/src/select/properties/fill_opacity.c @@ -0,0 +1,73 @@ +/* + * This file is part of LibCSS + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + */ + +#include "bytecode/bytecode.h" +#include "bytecode/opcodes.h" +#include "select/propset.h" +#include "select/propget.h" +#include "utils/utils.h" + +#include "select/properties/properties.h" +#include "select/properties/helpers.h" + +css_error css__cascade_fill_opacity(uint32_t opv, css_style *style, + css_select_state *state) +{ + uint16_t value = CSS_FILL_OPACITY_INHERIT; + css_fixed fill_opacity = 0; + + if (hasFlagValue(opv) == false) { + value = CSS_FILL_OPACITY_SET; + + fill_opacity = *((css_fixed *) style->bytecode); + advance_bytecode(style, sizeof(fill_opacity)); + } + + if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, + getFlagValue(opv))) { + return set_fill_opacity(state->computed, value, fill_opacity); + } + + return CSS_OK; +} + +css_error css__set_fill_opacity_from_hint(const css_hint *hint, + css_computed_style *style) +{ + return set_fill_opacity(style, hint->status, hint->data.fixed); +} + +css_error css__initial_fill_opacity(css_select_state *state) +{ + return set_fill_opacity(state->computed, CSS_FILL_OPACITY_SET, INTTOFIX(1)); +} + +css_error css__copy_fill_opacity( + const css_computed_style *from, + css_computed_style *to) +{ + css_fixed fill_opacity = 0; + uint8_t type = get_fill_opacity(from, &fill_opacity); + + if (from == to) { + return CSS_OK; + } + + return set_fill_opacity(to, type, fill_opacity); +} + +css_error css__compose_fill_opacity(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + css_fixed fill_opacity = 0; + uint8_t type = get_fill_opacity(child, &fill_opacity); + + return css__copy_fill_opacity( + type == CSS_FILL_OPACITY_INHERIT ? parent : child, + result); +} + diff --git a/src/select/properties/opacity.c b/src/select/properties/opacity.c index 818af62..3e875f9 100644 --- a/src/select/properties/opacity.c +++ b/src/select/properties/opacity.c @@ -21,7 +21,7 @@ css_error css__cascade_opacity(uint32_t opv, css_style *style, css_fixed opacity = 0; if (hasFlagValue(opv) == false) { - value = CSS_Z_INDEX_SET; + value = CSS_OPACITY_SET; opacity = *((css_fixed *) style->bytecode); advance_bytecode(style, sizeof(opacity)); diff --git a/src/select/properties/properties.h b/src/select/properties/properties.h index be31d0b..cb0b213 100644 --- a/src/select/properties/properties.h +++ b/src/select/properties/properties.h @@ -72,6 +72,7 @@ PROPERTY_FUNCS(direction); PROPERTY_FUNCS(display); PROPERTY_FUNCS(elevation); PROPERTY_FUNCS(empty_cells); +PROPERTY_FUNCS(fill_opacity); PROPERTY_FUNCS(flex_basis); PROPERTY_FUNCS(flex_direction); PROPERTY_FUNCS(flex_grow); @@ -129,6 +130,7 @@ PROPERTY_FUNCS(speak_punctuation); PROPERTY_FUNCS(speak); PROPERTY_FUNCS(speech_rate); PROPERTY_FUNCS(stress); +PROPERTY_FUNCS(stroke_opacity); PROPERTY_FUNCS(table_layout); PROPERTY_FUNCS(text_align); PROPERTY_FUNCS(text_decoration); diff --git a/src/select/properties/stroke_opacity.c b/src/select/properties/stroke_opacity.c new file mode 100644 index 0000000..c27e127 --- /dev/null +++ b/src/select/properties/stroke_opacity.c @@ -0,0 +1,73 @@ +/* + * This file is part of LibCSS + * Licensed under the MIT License, + * http://www.opensource.org/licenses/mit-license.php + */ + +#include "bytecode/bytecode.h" +#include "bytecode/opcodes.h" +#include "select/propset.h" +#include "select/propget.h" +#include "utils/utils.h" + +#include "select/properties/properties.h" +#include "select/properties/helpers.h" + +css_error css__cascade_stroke_opacity(uint32_t opv, css_style *style, + css_select_state *state) +{ + uint16_t value = CSS_STROKE_OPACITY_INHERIT; + css_fixed stroke_opacity = 0; + + if (hasFlagValue(opv) == false) { + value = CSS_STROKE_OPACITY_SET; + + stroke_opacity = *((css_fixed *) style->bytecode); + advance_bytecode(style, sizeof(stroke_opacity)); + } + + if (css__outranks_existing(getOpcode(opv), isImportant(opv), state, + getFlagValue(opv))) { + return set_stroke_opacity(state->computed, value, stroke_opacity); + } + + return CSS_OK; +} + +css_error css__set_stroke_opacity_from_hint(const css_hint *hint, + css_computed_style *style) +{ + return set_stroke_opacity(style, hint->status, hint->data.fixed); +} + +css_error css__initial_stroke_opacity(css_select_state *state) +{ + return set_stroke_opacity(state->computed, CSS_STROKE_OPACITY_SET, INTTOFIX(1)); +} + +css_error css__copy_stroke_opacity( + const css_computed_style *from, + css_computed_style *to) +{ + css_fixed stroke_opacity = 0; + uint8_t type = get_stroke_opacity(from, &stroke_opacity); + + if (from == to) { + return CSS_OK; + } + + return set_stroke_opacity(to, type, stroke_opacity); +} + +css_error css__compose_stroke_opacity(const css_computed_style *parent, + const css_computed_style *child, + css_computed_style *result) +{ + css_fixed stroke_opacity = 0; + uint8_t type = get_stroke_opacity(child, &stroke_opacity); + + return css__copy_stroke_opacity( + type == CSS_STROKE_OPACITY_INHERIT ? parent : child, + result); +} + diff --git a/src/select/select_config.py b/src/select/select_config.py index fd9e765..1cfe05c 100644 --- a/src/select/select_config.py +++ b/src/select/select_config.py @@ -95,6 +95,8 @@ style = { ('min_height', 2, 'length', 'CSS_MIN_HEIGHT_SET'), ('min_width', 2, 'length', 'CSS_MIN_WIDTH_SET'), ('opacity', 1, 'fixed', 'CSS_OPACITY_SET'), + ('fill_opacity', 1, 'fixed', 'CSS_FILL_OPACITY_SET'), + ('stroke_opacity', 1, 'fixed', 'CSS_STROKE_OPACITY_SET'), ('order', 1, 'integer', 'CSS_ORDER_SET'), ('padding_top', 1, 'length', 'CSS_PADDING_SET'), ('padding_right', 1, 'length', 'CSS_PADDING_SET'), diff --git a/src/select/select_generator.py b/src/select/select_generator.py index 6906478..9e92909 100644 --- a/src/select/select_generator.py +++ b/src/select/select_generator.py @@ -322,18 +322,16 @@ class CSSProperty: """ vals = [] for v in self.values: + star = '*' if pointer else '' vt, vn = shift_star(v.type, v.name) - vn += v.suffix + vn = star + vn + v.suffix if pointer: - vn = '*' + vn if v.name == 'counter_arr' or v.name == 'content_item': vt = 'const ' + vt vals.append((vt, vn)) if v.bits is not None: - bt, bn = shift_star(v.bits['type'], v.bits['name']) - bn += v.suffix - if pointer: - bn = '*' + bn + bt = v.bits['type'] + bn = star + v.bits['name'] + v.suffix vals.append((bt, bn)) return vals diff --git a/src/stylesheet.h b/src/stylesheet.h index 070508f..673bc95 100644 --- a/src/stylesheet.h +++ b/src/stylesheet.h @@ -272,8 +272,12 @@ static inline css_error css_stylesheet_style_unset(css_style *style, static inline css_error css_stylesheet_style_flag_value(css_style *style, enum flag_value flag_value, opcode_t opcode) { + enum flag flag = flag_value << 1; + if (flag == FLAG_REVERT) { + style->sheet->uses_revert = true; + } return css__stylesheet_style_append(style, - buildOPV(opcode, flag_value << 1, 0)); + buildOPV(opcode, flag, 0)); } css_error css__stylesheet_selector_create(css_stylesheet *sheet, diff --git a/test/data/parse2/INDEX b/test/data/parse2/INDEX index e4a369c..95534f6 100644 --- a/test/data/parse2/INDEX +++ b/test/data/parse2/INDEX @@ -24,3 +24,4 @@ multicol.dat Multi-column layout property tests flexbox.dat Flexbox properties and shorthands tests units.dat Length unit tests dodgy-media-block.dat Media block with incomplete ruleset +svg.dat SVG property tests diff --git a/test/data/parse2/svg.dat b/test/data/parse2/svg.dat new file mode 100644 index 0000000..e5ee2a3 --- /dev/null +++ b/test/data/parse2/svg.dat @@ -0,0 +1,79 @@ +#data +* { fill-opacity: inherit; } +#errors +#expected +| * +| fill-opacity: inherit +#reset + +#data +* { fill-opacity: revert; } +#errors +#expected +| * +| fill-opacity: revert +#reset + +#data +* { fill-opacity: 0.867; } +#errors +#expected +| * +| fill-opacity: 0.867 +#reset + +#data +* { fill-opacity: -0.5; } +#errors +#expected +| * +| fill-opacity: 0 +#reset + +#data +* { fill-opacity: 5; } +#errors +#expected +| * +| fill-opacity: 1 +#reset + +#data +* { stroke-opacity: inherit; } +#errors +#expected +| * +| stroke-opacity: inherit +#reset + +#data +* { stroke-opacity: revert; } +#errors +#expected +| * +| stroke-opacity: revert +#reset + +#data +* { stroke-opacity: 0.00000; } +#errors +#expected +| * +| stroke-opacity: 0 +#reset + +#data +* { stroke-opacity: -0.5; } +#errors +#expected +| * +| stroke-opacity: 0 +#reset + +#data +* { stroke-opacity: 5; } +#errors +#expected +| * +| stroke-opacity: 1 +#reset diff --git a/test/data/select/defaulting.dat b/test/data/select/defaulting.dat index 4242e30..9548ae8 100644 --- a/test/data/select/defaulting.dat +++ b/test/data/select/defaulting.dat @@ -50,6 +50,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -91,6 +92,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -161,6 +163,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -202,6 +205,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -273,6 +277,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -314,6 +319,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -386,6 +392,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -427,6 +434,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -495,6 +503,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -536,6 +545,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -608,6 +618,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -649,6 +660,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -720,6 +732,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -761,6 +774,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -832,6 +846,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -873,6 +888,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -944,6 +960,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -985,6 +1002,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1053,6 +1071,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1094,6 +1113,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1165,6 +1185,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1206,6 +1227,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1279,6 +1301,7 @@ cursor: auto direction: ltr display: inline-block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1320,6 +1343,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1393,6 +1417,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1434,6 +1459,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none diff --git a/test/data/select/tests1.dat b/test/data/select/tests1.dat index 997e88e..9240ed6 100644 --- a/test/data/select/tests1.dat +++ b/test/data/select/tests1.dat @@ -52,6 +52,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -93,6 +94,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -163,6 +165,7 @@ cursor: auto direction: ltr display: inline-grid empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -204,6 +207,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -277,6 +281,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -318,6 +323,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -395,6 +401,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -436,6 +443,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -514,6 +522,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -555,6 +564,7 @@ padding-left: 0px position: absolute quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -633,6 +643,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -674,6 +685,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -752,6 +764,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -793,6 +806,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -861,6 +875,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -902,6 +917,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -971,6 +987,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1012,6 +1029,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1081,6 +1099,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1122,6 +1141,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1190,6 +1210,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1231,6 +1252,7 @@ padding-left: 0px position: static quotes: "a" "b" right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1304,6 +1326,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1345,6 +1368,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1418,6 +1442,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1459,6 +1484,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1533,6 +1559,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1574,6 +1601,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1651,6 +1679,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1692,6 +1721,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1768,6 +1798,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1809,6 +1840,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -1891,6 +1923,7 @@ cursor: auto direction: ltr display: table-row empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -1932,6 +1965,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2014,6 +2048,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2055,6 +2090,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2137,6 +2173,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2178,6 +2215,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2264,6 +2302,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2305,6 +2344,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2390,6 +2430,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2431,6 +2472,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2514,6 +2556,7 @@ cursor: auto direction: ltr display: table-cell empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2555,6 +2598,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2637,6 +2681,7 @@ cursor: auto direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2678,6 +2723,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2760,6 +2806,7 @@ cursor: auto direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2801,6 +2848,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -2883,6 +2931,7 @@ cursor: auto direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -2924,6 +2973,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3006,6 +3056,7 @@ cursor: crosshair direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3047,6 +3098,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3129,6 +3181,7 @@ cursor: default direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3170,6 +3223,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3252,6 +3306,7 @@ cursor: pointer direction: ltr display: table empty-cells: hide +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3293,6 +3348,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3375,6 +3431,7 @@ cursor: move direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3416,6 +3473,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3498,6 +3556,7 @@ cursor: e-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3539,6 +3598,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3621,6 +3681,7 @@ cursor: ne-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3662,6 +3723,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3744,6 +3806,7 @@ cursor: nw-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3785,6 +3848,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3867,6 +3931,7 @@ cursor: n-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -3908,6 +3973,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -3990,6 +4056,7 @@ cursor: se-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4031,6 +4098,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4113,6 +4181,7 @@ cursor: sw-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4154,6 +4223,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4236,6 +4306,7 @@ cursor: s-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4277,6 +4348,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4359,6 +4431,7 @@ cursor: w-resize direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4400,6 +4473,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4482,6 +4556,7 @@ cursor: text direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4523,6 +4598,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4605,6 +4681,7 @@ cursor: wait direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4646,6 +4723,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4728,6 +4806,7 @@ cursor: help direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4769,6 +4848,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4851,6 +4931,7 @@ cursor: progress direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -4892,6 +4973,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -4974,6 +5056,7 @@ cursor: url('sonic-team.png') pointer direction: ltr display: table empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5015,6 +5098,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5090,6 +5174,7 @@ cursor: auto direction: ltr display: none empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5131,6 +5216,7 @@ padding-left: 0px position: absolute quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5206,6 +5292,7 @@ cursor: auto direction: ltr display: none empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5247,6 +5334,7 @@ padding-left: 0px position: absolute quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5322,6 +5410,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5363,6 +5452,7 @@ padding-left: 0px position: absolute quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5435,6 +5525,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5476,6 +5567,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5549,6 +5641,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5590,6 +5683,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5663,6 +5757,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5704,6 +5799,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5777,6 +5873,7 @@ cursor: auto direction: ltr display: block empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5818,6 +5915,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5887,6 +5985,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -5928,6 +6027,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -5998,6 +6098,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6039,6 +6140,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6108,6 +6210,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6149,6 +6252,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6218,6 +6322,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6259,6 +6364,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6328,6 +6434,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6369,6 +6476,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6438,6 +6546,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6479,6 +6588,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6548,6 +6658,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6589,6 +6700,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6660,6 +6772,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6701,6 +6814,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6770,6 +6884,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6811,6 +6926,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6880,6 +6996,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -6921,6 +7038,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -6991,6 +7109,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -7032,6 +7151,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7101,6 +7221,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 10px flex-direction: row flex-grow: 2.000 @@ -7142,6 +7263,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7211,6 +7333,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 1.000 @@ -7252,6 +7375,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7321,6 +7445,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -7362,6 +7487,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7431,6 +7557,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 0.000 @@ -7472,6 +7599,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7541,6 +7669,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 0.000 @@ -7582,6 +7711,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7651,6 +7781,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 0.000 @@ -7692,6 +7823,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7761,6 +7893,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 3.000 @@ -7802,6 +7935,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7870,6 +8004,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 3px flex-direction: row flex-grow: 0.000 @@ -7911,6 +8046,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -7979,6 +8115,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 3em flex-direction: row flex-grow: 2.000 @@ -8020,6 +8157,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8088,6 +8226,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 20.000 @@ -8129,6 +8268,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8199,6 +8339,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 3.000 @@ -8240,6 +8381,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8310,6 +8452,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 3px flex-direction: row flex-grow: 3.000 @@ -8351,6 +8494,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8419,6 +8563,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 0px flex-direction: row flex-grow: 0.000 @@ -8460,6 +8605,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8530,6 +8676,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -8571,6 +8718,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8641,6 +8789,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 3% flex-direction: row flex-grow: 3.000 @@ -8682,6 +8831,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8752,6 +8902,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 3% flex-direction: row flex-grow: 3.000 @@ -8793,6 +8944,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8861,6 +9013,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -8902,6 +9055,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -8970,6 +9124,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -9011,6 +9166,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9079,6 +9235,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -9120,6 +9277,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9188,6 +9346,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -9229,6 +9388,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9297,6 +9457,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: column flex-grow: 0.000 @@ -9338,6 +9499,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9406,6 +9568,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row-reverse flex-grow: 0.000 @@ -9447,6 +9610,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9515,6 +9679,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: column-reverse flex-grow: 0.000 @@ -9556,6 +9721,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9624,6 +9790,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: column-reverse flex-grow: 0.000 @@ -9665,6 +9832,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9735,6 +9903,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: column flex-grow: 0.000 @@ -9776,6 +9945,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9846,6 +10016,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row-reverse flex-grow: 0.000 @@ -9887,6 +10058,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -9955,6 +10127,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 4.500em flex-direction: row flex-grow: 2.370 @@ -9996,6 +10169,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10064,6 +10238,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10105,6 +10280,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10173,6 +10349,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10214,6 +10391,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10282,6 +10460,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10323,6 +10502,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10391,6 +10571,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10432,6 +10613,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10500,6 +10682,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10541,6 +10724,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10609,6 +10793,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10650,6 +10835,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10720,6 +10906,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10761,6 +10948,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10831,6 +11019,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10872,6 +11061,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -10940,6 +11130,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -10981,6 +11172,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11049,6 +11241,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11090,6 +11283,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11158,6 +11352,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11199,6 +11394,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11269,6 +11465,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11310,6 +11507,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11378,6 +11576,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 4.500em flex-direction: column flex-grow: 2.300 @@ -11419,6 +11618,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11489,6 +11689,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: 4.500em flex-direction: column flex-grow: 2.300 @@ -11530,6 +11731,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11598,6 +11800,7 @@ cursor: auto direction: ltr display: flex empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11639,6 +11842,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11707,6 +11911,7 @@ cursor: auto direction: ltr display: inline-flex empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11748,6 +11953,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11816,6 +12022,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11857,6 +12064,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -11925,6 +12133,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -11966,6 +12175,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12034,6 +12244,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12075,6 +12286,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12143,6 +12355,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12184,6 +12397,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12252,6 +12466,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12293,6 +12508,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12361,6 +12577,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12402,6 +12619,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12470,6 +12688,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12511,6 +12730,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12579,6 +12799,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12620,6 +12841,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12688,6 +12910,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12729,6 +12952,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12797,6 +13021,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12838,6 +13063,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -12906,6 +13132,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -12947,6 +13174,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13015,6 +13243,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13056,6 +13285,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13124,6 +13354,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13165,6 +13396,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13233,6 +13465,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13274,6 +13507,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13342,6 +13576,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13383,6 +13618,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13451,6 +13687,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13492,6 +13729,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13560,6 +13798,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13601,6 +13840,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13669,6 +13909,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13710,6 +13951,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13778,6 +14020,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13819,6 +14062,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13887,6 +14131,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -13928,6 +14173,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -13996,6 +14242,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -14037,6 +14284,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -14124,6 +14372,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -14165,6 +14414,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -14233,6 +14483,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -14274,6 +14525,7 @@ padding-left: 0px position: static quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none @@ -14342,6 +14594,7 @@ cursor: auto direction: ltr display: inline empty-cells: show +fill-opacity: 1.000 flex-basis: auto flex-direction: row flex-grow: 0.000 @@ -14383,6 +14636,7 @@ padding-left: 0px position: sticky quotes: none right: auto +stroke-opacity: 1.000 table-layout: auto text-align: default text-decoration: none diff --git a/test/dump.h b/test/dump.h index f585788..09a35b0 100644 --- a/test/dump.h +++ b/test/dump.h @@ -491,6 +491,8 @@ static const char *opcode_names[] = { "flex-wrap", "justify-content", "order", + "fill-opacity", + "stroke-opacity", }; static void dump_css_fixed(css_fixed f, char **ptr) @@ -1819,6 +1821,28 @@ void dump_bytecode(css_style *style, char **ptr, uint32_t depth) break; } break; + case CSS_PROP_FILL_OPACITY: + switch (value) { + case FILL_OPACITY_SET: + { + css_fixed val = *((css_fixed *) bytecode); + ADVANCE(sizeof(val)); + dump_number(val, ptr); + } + break; + } + break; + case CSS_PROP_STROKE_OPACITY: + switch (value) { + case STROKE_OPACITY_SET: + { + css_fixed val = *((css_fixed *) bytecode); + ADVANCE(sizeof(val)); + dump_number(val, ptr); + } + break; + } + break; case CSS_PROP_FLEX_BASIS: switch (value) { case FLEX_BASIS_AUTO: diff --git a/test/dump_computed.h b/test/dump_computed.h index 2ce7849..f769075 100644 --- a/test/dump_computed.h +++ b/test/dump_computed.h @@ -1635,6 +1635,30 @@ static void dump_computed_style(const css_computed_style *style, char *buf, ptr += wrote; *len -= wrote; + /* fill-opacity */ + val = css_computed_fill_opacity(style, &len1); + switch (val) { + case CSS_FILL_OPACITY_INHERIT: + wrote = snprintf(ptr, *len, "fill-opacity: inherit\n"); + break; + case CSS_FILL_OPACITY_SET: + wrote = snprintf(ptr, *len, "fill-opacity: "); + ptr += wrote; + *len -= wrote; + + wrote = dump_css_fixed(len1, ptr, *len); + ptr += wrote; + *len -= wrote; + + wrote = snprintf(ptr, *len, "\n"); + break; + default: + wrote = 0; + break; + } + ptr += wrote; + *len -= wrote; + /* flex-basis */ val = css_computed_flex_basis(style, &len1, &unit1); switch (val) { @@ -2796,6 +2820,30 @@ static void dump_computed_style(const css_computed_style *style, char *buf, ptr += wrote; *len -= wrote; + /* stroke-opacity */ + val = css_computed_stroke_opacity(style, &len1); + switch (val) { + case CSS_STROKE_OPACITY_INHERIT: + wrote = snprintf(ptr, *len, "stroke-opacity: inherit\n"); + break; + case CSS_STROKE_OPACITY_SET: + wrote = snprintf(ptr, *len, "stroke-opacity: "); + ptr += wrote; + *len -= wrote; + + wrote = dump_css_fixed(len1, ptr, *len); + ptr += wrote; + *len -= wrote; + + wrote = snprintf(ptr, *len, "\n"); + break; + default: + wrote = 0; + break; + } + ptr += wrote; + *len -= wrote; + /* table-layout */ val = css_computed_table_layout(style); switch (val) { |