summaryrefslogtreecommitdiff
path: root/src/parse/properties
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse/properties')
-rw-r--r--src/parse/properties/Makefile2
-rw-r--r--src/parse/properties/azimuth.c4
-rw-r--r--src/parse/properties/background.c4
-rw-r--r--src/parse/properties/background_position.c4
-rw-r--r--src/parse/properties/border.c4
-rw-r--r--src/parse/properties/border_color.c4
-rw-r--r--src/parse/properties/border_spacing.c4
-rw-r--r--src/parse/properties/border_style.c4
-rw-r--r--src/parse/properties/border_width.c4
-rw-r--r--src/parse/properties/clip.c4
-rw-r--r--src/parse/properties/column_rule.c4
-rw-r--r--src/parse/properties/columns.c4
-rw-r--r--src/parse/properties/content.c4
-rw-r--r--src/parse/properties/css_property_parser_gen.c4
-rw-r--r--src/parse/properties/cue.c4
-rw-r--r--src/parse/properties/cursor.c4
-rw-r--r--src/parse/properties/elevation.c4
-rw-r--r--src/parse/properties/fill_opacity.c82
-rw-r--r--src/parse/properties/flex.c4
-rw-r--r--src/parse/properties/flex_flow.c4
-rw-r--r--src/parse/properties/font.c4
-rw-r--r--src/parse/properties/font_family.c4
-rw-r--r--src/parse/properties/font_weight.c4
-rw-r--r--src/parse/properties/list_style.c4
-rw-r--r--src/parse/properties/list_style_type.c4
-rw-r--r--src/parse/properties/margin.c4
-rw-r--r--src/parse/properties/opacity.c4
-rw-r--r--src/parse/properties/outline.c4
-rw-r--r--src/parse/properties/overflow.c4
-rw-r--r--src/parse/properties/padding.c4
-rw-r--r--src/parse/properties/pause.c4
-rw-r--r--src/parse/properties/play_during.c4
-rw-r--r--src/parse/properties/properties.c4
-rw-r--r--src/parse/properties/properties.gen4
-rw-r--r--src/parse/properties/properties.h300
-rw-r--r--src/parse/properties/quotes.c4
-rw-r--r--src/parse/properties/stroke_opacity.c82
-rw-r--r--src/parse/properties/text_decoration.c4
-rw-r--r--src/parse/properties/utils.c32
-rw-r--r--src/parse/properties/utils.h24
-rw-r--r--src/parse/properties/voice_family.c4
41 files changed, 420 insertions, 242 deletions
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.gen b/src/parse/properties/properties.gen
index 4fd8ba0..b0e797c 100644
--- a/src/parse/properties/properties.gen
+++ b/src/parse/properties/properties.gen
@@ -16,7 +16,7 @@ cue_before:CSS_PROP_CUE_BEFORE IDENT:( INHERIT: INITIAL: REVERT: UNSET: NONE:0,C
direction:CSS_PROP_DIRECTION IDENT:( INHERIT: INITIAL: REVERT: UNSET: LTR:0,DIRECTION_LTR RTL:0,DIRECTION_RTL IDENT:)
-display:CSS_PROP_DISPLAY IDENT:( INHERIT: INITIAL: REVERT: UNSET: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE FLEX:0,DISPLAY_FLEX INLINE_FLEX:0,DISPLAY_INLINE_FLEX IDENT:)
+display:CSS_PROP_DISPLAY IDENT:( INHERIT: INITIAL: REVERT: UNSET: INLINE:0,DISPLAY_INLINE BLOCK:0,DISPLAY_BLOCK LIST_ITEM:0,DISPLAY_LIST_ITEM RUN_IN:0,DISPLAY_RUN_IN INLINE_BLOCK:0,DISPLAY_INLINE_BLOCK TABLE:0,DISPLAY_TABLE INLINE_TABLE:0,DISPLAY_INLINE_TABLE TABLE_ROW_GROUP:0,DISPLAY_TABLE_ROW_GROUP TABLE_HEADER_GROUP:0,DISPLAY_TABLE_HEADER_GROUP TABLE_FOOTER_GROUP:0,DISPLAY_TABLE_FOOTER_GROUP TABLE_ROW:0,DISPLAY_TABLE_ROW TABLE_COLUMN_GROUP:0,DISPLAY_TABLE_COLUMN_GROUP TABLE_COLUMN:0,DISPLAY_TABLE_COLUMN TABLE_CELL:0,DISPLAY_TABLE_CELL TABLE_CAPTION:0,DISPLAY_TABLE_CAPTION NONE:0,DISPLAY_NONE FLEX:0,DISPLAY_FLEX INLINE_FLEX:0,DISPLAY_INLINE_FLEX GRID:0,DISPLAY_GRID INLINE_GRID:0,DISPLAY_INLINE_GRID IDENT:)
empty_cells:CSS_PROP_EMPTY_CELLS IDENT:( INHERIT: INITIAL: REVERT: UNSET: SHOW:0,EMPTY_CELLS_SHOW HIDE:0,EMPTY_CELLS_HIDE IDENT:)
@@ -148,7 +148,7 @@ pitch:CSS_PROP_PITCH IDENT:( INHERIT: INITIAL: REVERT: UNSET: X_LOW:0,PITCH_X_LO
pitch_range:CSS_PROP_PITCH_RANGE IDENT:( INHERIT: INITIAL: REVERT: UNSET: IDENT:) NUMBER:( false:PITCH_RANGE_SET RANGE:num<0||num>F_100 NUMBER:)
-position:CSS_PROP_POSITION IDENT:( INHERIT: INITIAL: REVERT: UNSET: LIBCSS_STATIC:0,POSITION_STATIC RELATIVE:0,POSITION_RELATIVE ABSOLUTE:0,POSITION_ABSOLUTE FIXED:0,POSITION_FIXED IDENT:)
+position:CSS_PROP_POSITION IDENT:( INHERIT: INITIAL: REVERT: UNSET: LIBCSS_STATIC:0,POSITION_STATIC RELATIVE:0,POSITION_RELATIVE ABSOLUTE:0,POSITION_ABSOLUTE FIXED:0,POSITION_FIXED STICKY:0,POSITION_STICKY IDENT:)
richness:CSS_PROP_RICHNESS IDENT:( INHERIT: INITIAL: REVERT: UNSET: IDENT:) NUMBER:( false:RICHNESS_SET RANGE:num<0||num>F_100 NUMBER:)
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;