summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-03-23 01:02:59 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-03-23 01:02:59 +0000
commit570510b0762d9bb02f9dc64497c8802bc2a1649d (patch)
tree21bdec088c22894e77e4adbca99a2db8b894202d /src
parentdcc0deb8e5cc5bf817d60a11b19e226a1bc22bd1 (diff)
downloadlibcss-570510b0762d9bb02f9dc64497c8802bc2a1649d.tar.gz
libcss-570510b0762d9bb02f9dc64497c8802bc2a1649d.tar.bz2
Completely change the approach used for presentational hints.
This one stands a chance of working sanely. While this compiles, please don't expect it to link. svn path=/trunk/libcss/; revision=6820
Diffstat (limited to 'src')
-rw-r--r--src/bytecode/bytecode.h105
-rw-r--r--src/parse/properties.c203
-rw-r--r--src/select/computed.c2
-rw-r--r--src/select/dispatch.c200
-rw-r--r--src/select/dispatch.h4
-rw-r--r--src/select/properties.h198
-rw-r--r--src/select/select.c47
-rw-r--r--src/select/select.h2
-rw-r--r--src/utils/errors.c3
9 files changed, 446 insertions, 318 deletions
diff --git a/src/bytecode/bytecode.h b/src/bytecode/bytecode.h
index a0810e2..4235ab2 100644
--- a/src/bytecode/bytecode.h
+++ b/src/bytecode/bytecode.h
@@ -12,110 +12,9 @@
#include <stdio.h>
#include <libcss/types.h>
+#include <libcss/properties.h>
-typedef enum opcode {
- OP_AZIMUTH = 0x000,
- OP_BACKGROUND_ATTACHMENT = 0x001,
- OP_BACKGROUND_COLOR = 0x002,
- OP_BACKGROUND_IMAGE = 0x003,
- OP_BACKGROUND_POSITION = 0x004,
- OP_BACKGROUND_REPEAT = 0x005,
- OP_BORDER_COLLAPSE = 0x006,
- OP_BORDER_SPACING = 0x007,
- OP_BORDER_TOP_COLOR = 0x008,
- OP_BORDER_RIGHT_COLOR = 0x009,
- OP_BORDER_BOTTOM_COLOR = 0x00a,
- OP_BORDER_LEFT_COLOR = 0x00b,
- OP_BORDER_TOP_STYLE = 0x00c,
- OP_BORDER_RIGHT_STYLE = 0x00d,
- OP_BORDER_BOTTOM_STYLE = 0x00e,
- OP_BORDER_LEFT_STYLE = 0x00f,
- OP_BORDER_TOP_WIDTH = 0x010,
- OP_BORDER_RIGHT_WIDTH = 0x011,
- OP_BORDER_BOTTOM_WIDTH = 0x012,
- OP_BORDER_LEFT_WIDTH = 0x013,
- OP_BOTTOM = 0x014,
- OP_CAPTION_SIDE = 0x015,
- OP_CLEAR = 0x016,
- OP_CLIP = 0x017,
- OP_COLOR = 0x018,
- OP_CONTENT = 0x019,
- OP_COUNTER_INCREMENT = 0x01a,
- OP_COUNTER_RESET = 0x01b,
- OP_CUE_AFTER = 0x01c,
- OP_CUE_BEFORE = 0x01d,
- OP_CURSOR = 0x01e,
- OP_DIRECTION = 0x01f,
- OP_DISPLAY = 0x020,
- OP_ELEVATION = 0x021,
- OP_EMPTY_CELLS = 0x022,
- OP_FLOAT = 0x023,
- OP_FONT_FAMILY = 0x024,
- OP_FONT_SIZE = 0x025,
- OP_FONT_STYLE = 0x026,
- OP_FONT_VARIANT = 0x027,
- OP_FONT_WEIGHT = 0x028,
- OP_HEIGHT = 0x029,
- OP_LEFT = 0x02a,
- OP_LETTER_SPACING = 0x02b,
- OP_LINE_HEIGHT = 0x02c,
- OP_LIST_STYLE_IMAGE = 0x02d,
- OP_LIST_STYLE_POSITION = 0x02e,
- OP_LIST_STYLE_TYPE = 0x02f,
- OP_MARGIN_TOP = 0x030,
- OP_MARGIN_RIGHT = 0x031,
- OP_MARGIN_BOTTOM = 0x032,
- OP_MARGIN_LEFT = 0x033,
- OP_MAX_HEIGHT = 0x034,
- OP_MAX_WIDTH = 0x035,
- OP_MIN_HEIGHT = 0x036,
- OP_MIN_WIDTH = 0x037,
- OP_ORPHANS = 0x038,
- OP_OUTLINE_COLOR = 0x039,
- OP_OUTLINE_STYLE = 0x03a,
- OP_OUTLINE_WIDTH = 0x03b,
- OP_OVERFLOW = 0x03c,
- OP_PADDING_TOP = 0x03d,
- OP_PADDING_RIGHT = 0x03e,
- OP_PADDING_BOTTOM = 0x03f,
- OP_PADDING_LEFT = 0x040,
- OP_PAGE_BREAK_AFTER = 0x041,
- OP_PAGE_BREAK_BEFORE = 0x042,
- OP_PAGE_BREAK_INSIDE = 0x043,
- OP_PAUSE_AFTER = 0x044,
- OP_PAUSE_BEFORE = 0x045,
- OP_PITCH_RANGE = 0x046,
- OP_PITCH = 0x047,
- OP_PLAY_DURING = 0x048,
- OP_POSITION = 0x049,
- OP_QUOTES = 0x04a,
- OP_RICHNESS = 0x04b,
- OP_RIGHT = 0x04c,
- OP_SPEAK_HEADER = 0x04d,
- OP_SPEAK_NUMERAL = 0x04e,
- OP_SPEAK_PUNCTUATION = 0x04f,
- OP_SPEAK = 0x050,
- OP_SPEECH_RATE = 0x051,
- OP_STRESS = 0x052,
- OP_TABLE_LAYOUT = 0x053,
- OP_TEXT_ALIGN = 0x054,
- OP_TEXT_DECORATION = 0x055,
- OP_TEXT_INDENT = 0x056,
- OP_TEXT_TRANSFORM = 0x057,
- OP_TOP = 0x058,
- OP_UNICODE_BIDI = 0x059,
- OP_VERTICAL_ALIGN = 0x05a,
- OP_VISIBILITY = 0x05b,
- OP_VOICE_FAMILY = 0x05c,
- OP_VOLUME = 0x05d,
- OP_WHITE_SPACE = 0x05e,
- OP_WIDOWS = 0x05f,
- OP_WIDTH = 0x060,
- OP_WORD_SPACING = 0x061,
- OP_Z_INDEX = 0x062,
-
- N_OPCODES = OP_Z_INDEX + 1
-} opcode;
+typedef enum css_properties opcode;
enum flag {
FLAG_IMPORTANT = (1<<0),
diff --git a/src/parse/properties.c b/src/parse/properties.c
index f54b3f9..c40b223 100644
--- a/src/parse/properties.c
+++ b/src/parse/properties.c
@@ -596,7 +596,7 @@ css_error parse_azimuth(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_AZIMUTH, flags, value);
+ opv = buildOPV(CSS_PROP_AZIMUTH, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == AZIMUTH_ANGLE)
@@ -647,7 +647,7 @@ css_error parse_background_attachment(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_BACKGROUND_ATTACHMENT, flags, value);
+ opv = buildOPV(CSS_PROP_BACKGROUND_ATTACHMENT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -697,7 +697,7 @@ css_error parse_background_color(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_BACKGROUND_COLOR, flags, value);
+ opv = buildOPV(CSS_PROP_BACKGROUND_COLOR, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == BACKGROUND_COLOR_SET)
@@ -750,7 +750,7 @@ css_error parse_background_image(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_BACKGROUND_IMAGE, flags, value);
+ opv = buildOPV(CSS_PROP_BACKGROUND_IMAGE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == BACKGROUND_IMAGE_URI)
@@ -893,7 +893,7 @@ css_error parse_background_position(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_BACKGROUND_POSITION, flags, value[0] | value[1]);
+ opv = buildOPV(CSS_PROP_BACKGROUND_POSITION, flags, value[0] | value[1]);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false) {
@@ -960,7 +960,7 @@ css_error parse_background_repeat(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_BACKGROUND_REPEAT, flags, value);
+ opv = buildOPV(CSS_PROP_BACKGROUND_REPEAT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -978,7 +978,7 @@ css_error parse_border_bottom_color(css_language *c,
css_style **result)
{
return parse_border_side_color(c, vector, ctx,
- OP_BORDER_BOTTOM_COLOR, result);
+ CSS_PROP_BORDER_BOTTOM_COLOR, result);
}
css_error parse_border_bottom_style(css_language *c,
@@ -986,7 +986,7 @@ css_error parse_border_bottom_style(css_language *c,
css_style **result)
{
return parse_border_side_style(c, vector, ctx,
- OP_BORDER_BOTTOM_STYLE, result);
+ CSS_PROP_BORDER_BOTTOM_STYLE, result);
}
css_error parse_border_bottom_width(css_language *c,
@@ -994,7 +994,7 @@ css_error parse_border_bottom_width(css_language *c,
css_style **result)
{
return parse_border_side_width(c, vector, ctx,
- OP_BORDER_BOTTOM_WIDTH, result);
+ CSS_PROP_BORDER_BOTTOM_WIDTH, result);
}
css_error parse_border_collapse(css_language *c,
@@ -1025,7 +1025,7 @@ css_error parse_border_collapse(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_BORDER_COLLAPSE, flags, value);
+ opv = buildOPV(CSS_PROP_BORDER_COLLAPSE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -1043,7 +1043,7 @@ css_error parse_border_left_color(css_language *c,
css_style **result)
{
return parse_border_side_color(c, vector, ctx,
- OP_BORDER_LEFT_COLOR, result);
+ CSS_PROP_BORDER_LEFT_COLOR, result);
}
css_error parse_border_left_style(css_language *c,
@@ -1051,7 +1051,7 @@ css_error parse_border_left_style(css_language *c,
css_style **result)
{
return parse_border_side_style(c, vector, ctx,
- OP_BORDER_LEFT_STYLE, result);
+ CSS_PROP_BORDER_LEFT_STYLE, result);
}
css_error parse_border_left_width(css_language *c,
@@ -1059,7 +1059,7 @@ css_error parse_border_left_width(css_language *c,
css_style **result)
{
return parse_border_side_width(c, vector, ctx,
- OP_BORDER_LEFT_WIDTH, result);
+ CSS_PROP_BORDER_LEFT_WIDTH, result);
}
css_error parse_border_right_color(css_language *c,
@@ -1067,7 +1067,7 @@ css_error parse_border_right_color(css_language *c,
css_style **result)
{
return parse_border_side_color(c, vector, ctx,
- OP_BORDER_RIGHT_COLOR, result);
+ CSS_PROP_BORDER_RIGHT_COLOR, result);
}
css_error parse_border_right_style(css_language *c,
@@ -1075,7 +1075,7 @@ css_error parse_border_right_style(css_language *c,
css_style **result)
{
return parse_border_side_style(c, vector, ctx,
- OP_BORDER_RIGHT_STYLE, result);
+ CSS_PROP_BORDER_RIGHT_STYLE, result);
}
css_error parse_border_right_width(css_language *c,
@@ -1083,7 +1083,7 @@ css_error parse_border_right_width(css_language *c,
css_style **result)
{
return parse_border_side_width(c, vector, ctx,
- OP_BORDER_RIGHT_WIDTH, result);
+ CSS_PROP_BORDER_RIGHT_WIDTH, result);
}
css_error parse_border_spacing(css_language *c,
@@ -1156,7 +1156,7 @@ css_error parse_border_spacing(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_BORDER_SPACING, flags, value);
+ opv = buildOPV(CSS_PROP_BORDER_SPACING, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == BORDER_SPACING_SET)
@@ -1189,7 +1189,7 @@ css_error parse_border_top_color(css_language *c,
css_style **result)
{
return parse_border_side_color(c, vector, ctx,
- OP_BORDER_TOP_COLOR, result);
+ CSS_PROP_BORDER_TOP_COLOR, result);
}
css_error parse_border_top_style(css_language *c,
@@ -1197,7 +1197,7 @@ css_error parse_border_top_style(css_language *c,
css_style **result)
{
return parse_border_side_style(c, vector, ctx,
- OP_BORDER_TOP_STYLE, result);
+ CSS_PROP_BORDER_TOP_STYLE, result);
}
css_error parse_border_top_width(css_language *c,
@@ -1205,7 +1205,7 @@ css_error parse_border_top_width(css_language *c,
css_style **result)
{
return parse_border_side_width(c, vector, ctx,
- OP_BORDER_TOP_WIDTH, result);
+ CSS_PROP_BORDER_TOP_WIDTH, result);
}
css_error parse_bottom(css_language *c,
@@ -1250,7 +1250,7 @@ css_error parse_bottom(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_BOTTOM, flags, value);
+ opv = buildOPV(CSS_PROP_BOTTOM, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == BOTTOM_SET)
@@ -1301,7 +1301,7 @@ css_error parse_caption_side(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_CAPTION_SIDE, flags, value);
+ opv = buildOPV(CSS_PROP_CAPTION_SIDE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -1346,7 +1346,7 @@ css_error parse_clear(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_CLEAR, flags, value);
+ opv = buildOPV(CSS_PROP_CLEAR, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -1450,7 +1450,7 @@ css_error parse_clip(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_CLIP, flags, value);
+ opv = buildOPV(CSS_PROP_CLIP, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false &&
@@ -1514,7 +1514,7 @@ css_error parse_color(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_COLOR, flags, value);
+ opv = buildOPV(CSS_PROP_COLOR, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == COLOR_SET)
@@ -1590,7 +1590,7 @@ css_error parse_content(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_CONTENT, flags, value);
+ opv = buildOPV(CSS_PROP_CONTENT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -1706,7 +1706,7 @@ css_error parse_counter_increment(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_COUNTER_INCREMENT, flags, value);
+ opv = buildOPV(CSS_PROP_COUNTER_INCREMENT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -1874,7 +1874,7 @@ css_error parse_counter_reset(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_COUNTER_RESET, flags, value);
+ opv = buildOPV(CSS_PROP_COUNTER_RESET, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -1994,7 +1994,7 @@ css_error parse_cue_after(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_CUE_AFTER, flags, value);
+ opv = buildOPV(CSS_PROP_CUE_AFTER, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == CUE_AFTER_URI)
@@ -2049,7 +2049,7 @@ css_error parse_cue_before(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_CUE_BEFORE, flags, value);
+ opv = buildOPV(CSS_PROP_CUE_BEFORE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == CUE_BEFORE_URI)
@@ -2222,7 +2222,7 @@ css_error parse_cursor(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_CURSOR, flags, value);
+ opv = buildOPV(CSS_PROP_CURSOR, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -2366,7 +2366,7 @@ css_error parse_direction(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_DIRECTION, flags, value);
+ opv = buildOPV(CSS_PROP_DIRECTION, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -2438,7 +2438,7 @@ css_error parse_display(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_DISPLAY, flags, value);
+ opv = buildOPV(CSS_PROP_DISPLAY, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -2521,7 +2521,7 @@ css_error parse_elevation(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_ELEVATION, flags, value);
+ opv = buildOPV(CSS_PROP_ELEVATION, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == ELEVATION_ANGLE)
@@ -2572,7 +2572,7 @@ css_error parse_empty_cells(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_EMPTY_CELLS, flags, value);
+ opv = buildOPV(CSS_PROP_EMPTY_CELLS, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -2615,7 +2615,7 @@ css_error parse_float(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_FLOAT, flags, value);
+ opv = buildOPV(CSS_PROP_FLOAT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -2774,7 +2774,7 @@ css_error parse_font_family(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_FONT_FAMILY, flags, value);
+ opv = buildOPV(CSS_PROP_FONT_FAMILY, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -3069,7 +3069,7 @@ css_error parse_font_size(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_FONT_SIZE, flags, value);
+ opv = buildOPV(CSS_PROP_FONT_SIZE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == FONT_SIZE_DIMENSION)
@@ -3122,7 +3122,7 @@ css_error parse_font_style(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_FONT_STYLE, flags, value);
+ opv = buildOPV(CSS_PROP_FONT_STYLE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -3163,7 +3163,7 @@ css_error parse_font_variant(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_FONT_VARIANT, flags, value);
+ opv = buildOPV(CSS_PROP_FONT_VARIANT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -3228,7 +3228,7 @@ css_error parse_font_weight(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_FONT_WEIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_FONT_WEIGHT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -3287,7 +3287,7 @@ css_error parse_height(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_HEIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_HEIGHT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == HEIGHT_SET)
@@ -3352,7 +3352,7 @@ css_error parse_left(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_LEFT, flags, value);
+ opv = buildOPV(CSS_PROP_LEFT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == LEFT_SET)
@@ -3418,7 +3418,7 @@ css_error parse_letter_spacing(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_LETTER_SPACING, flags, value);
+ opv = buildOPV(CSS_PROP_LETTER_SPACING, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == LETTER_SPACING_SET)
@@ -3499,7 +3499,7 @@ css_error parse_line_height(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_LINE_HEIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_LINE_HEIGHT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == LINE_HEIGHT_NUMBER)
@@ -3558,7 +3558,7 @@ css_error parse_list_style_image(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_LIST_STYLE_IMAGE, flags, value);
+ opv = buildOPV(CSS_PROP_LIST_STYLE_IMAGE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == LIST_STYLE_IMAGE_URI)
@@ -3609,7 +3609,7 @@ css_error parse_list_style_position(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_LIST_STYLE_POSITION, flags, value);
+ opv = buildOPV(CSS_PROP_LIST_STYLE_POSITION, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -3653,7 +3653,7 @@ css_error parse_list_style_type(css_language *c,
return error;
}
- opv = buildOPV(OP_LIST_STYLE_TYPE, flags, value);
+ opv = buildOPV(CSS_PROP_LIST_STYLE_TYPE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -3670,28 +3670,29 @@ css_error parse_margin_bottom(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_margin_side(c, vector, ctx, OP_MARGIN_BOTTOM, result);
+ return parse_margin_side(c, vector, ctx,
+ CSS_PROP_MARGIN_BOTTOM, result);
}
css_error parse_margin_left(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_margin_side(c, vector, ctx, OP_MARGIN_LEFT, result);
+ return parse_margin_side(c, vector, ctx, CSS_PROP_MARGIN_LEFT, result);
}
css_error parse_margin_right(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_margin_side(c, vector, ctx, OP_MARGIN_RIGHT, result);
+ return parse_margin_side(c, vector, ctx, CSS_PROP_MARGIN_RIGHT, result);
}
css_error parse_margin_top(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_margin_side(c, vector, ctx, OP_MARGIN_TOP, result);
+ return parse_margin_side(c, vector, ctx, CSS_PROP_MARGIN_TOP, result);
}
css_error parse_max_height(css_language *c,
@@ -3740,7 +3741,7 @@ css_error parse_max_height(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_MAX_HEIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_MAX_HEIGHT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == MAX_HEIGHT_SET)
@@ -3809,7 +3810,7 @@ css_error parse_max_width(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_MAX_WIDTH, flags, value);
+ opv = buildOPV(CSS_PROP_MAX_WIDTH, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == MAX_WIDTH_SET)
@@ -3874,7 +3875,7 @@ css_error parse_min_height(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_MIN_HEIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_MIN_HEIGHT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == MIN_HEIGHT_SET)
@@ -3939,7 +3940,7 @@ css_error parse_min_width(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_MIN_WIDTH, flags, value);
+ opv = buildOPV(CSS_PROP_MIN_WIDTH, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == MIN_WIDTH_SET)
@@ -4001,7 +4002,7 @@ css_error parse_orphans(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_ORPHANS, flags, value);
+ opv = buildOPV(CSS_PROP_ORPHANS, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == ORPHANS_SET)
@@ -4059,7 +4060,7 @@ css_error parse_outline_color(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_OUTLINE_COLOR, flags, value);
+ opv = buildOPV(CSS_PROP_OUTLINE_COLOR, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == OUTLINE_COLOR_SET)
@@ -4090,7 +4091,7 @@ css_error parse_outline_style(css_language *c,
/* Parse as a border style */
error = parse_border_side_style(c, vector, ctx,
- OP_OUTLINE_STYLE, result);
+ CSS_PROP_OUTLINE_STYLE, result);
if (error != CSS_OK)
return error;
@@ -4111,7 +4112,7 @@ css_error parse_outline_width(css_language *c,
{
/* Parse as border width */
return parse_border_side_width(c, vector, ctx,
- OP_OUTLINE_WIDTH, result);
+ CSS_PROP_OUTLINE_WIDTH, result);
}
css_error parse_overflow(css_language *c,
@@ -4146,7 +4147,7 @@ css_error parse_overflow(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_OVERFLOW, flags, value);
+ opv = buildOPV(CSS_PROP_OVERFLOW, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -4163,28 +4164,32 @@ css_error parse_padding_bottom(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_padding_side(c, vector, ctx, OP_PADDING_BOTTOM, result);
+ return parse_padding_side(c, vector, ctx,
+ CSS_PROP_PADDING_BOTTOM, result);
}
css_error parse_padding_left(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_padding_side(c, vector, ctx, OP_PADDING_LEFT, result);
+ return parse_padding_side(c, vector, ctx,
+ CSS_PROP_PADDING_LEFT, result);
}
css_error parse_padding_right(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_padding_side(c, vector, ctx, OP_PADDING_RIGHT, result);
+ return parse_padding_side(c, vector, ctx,
+ CSS_PROP_PADDING_RIGHT, result);
}
css_error parse_padding_top(css_language *c,
const parserutils_vector *vector, int *ctx,
css_style **result)
{
- return parse_padding_side(c, vector, ctx, OP_PADDING_TOP, result);
+ return parse_padding_side(c, vector, ctx,
+ CSS_PROP_PADDING_TOP, result);
}
css_error parse_page_break_after(css_language *c,
@@ -4221,7 +4226,7 @@ css_error parse_page_break_after(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_PAGE_BREAK_AFTER, flags, value);
+ opv = buildOPV(CSS_PROP_PAGE_BREAK_AFTER, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -4268,7 +4273,7 @@ css_error parse_page_break_before(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_PAGE_BREAK_BEFORE, flags, value);
+ opv = buildOPV(CSS_PROP_PAGE_BREAK_BEFORE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -4309,7 +4314,7 @@ css_error parse_page_break_inside(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_PAGE_BREAK_INSIDE, flags, value);
+ opv = buildOPV(CSS_PROP_PAGE_BREAK_INSIDE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -4364,7 +4369,7 @@ css_error parse_pause_after(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_PAUSE_AFTER, flags, value);
+ opv = buildOPV(CSS_PROP_PAUSE_AFTER, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == PAUSE_AFTER_SET)
@@ -4429,7 +4434,7 @@ css_error parse_pause_before(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_PAUSE_BEFORE, flags, value);
+ opv = buildOPV(CSS_PROP_PAUSE_BEFORE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == PAUSE_BEFORE_SET)
@@ -4491,7 +4496,7 @@ css_error parse_pitch_range(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_PITCH_RANGE, flags, value);
+ opv = buildOPV(CSS_PROP_PITCH_RANGE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == PITCH_RANGE_SET)
@@ -4574,7 +4579,7 @@ css_error parse_pitch(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_PITCH, flags, value);
+ opv = buildOPV(CSS_PROP_PITCH, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == PITCH_FREQUENCY)
@@ -4658,7 +4663,7 @@ css_error parse_play_during(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_PLAY_DURING, flags, value);
+ opv = buildOPV(CSS_PROP_PLAY_DURING, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false &&
@@ -4714,7 +4719,7 @@ css_error parse_position(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_POSITION, flags, value);
+ opv = buildOPV(CSS_PROP_POSITION, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -4804,7 +4809,7 @@ css_error parse_quotes(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_QUOTES, flags, value);
+ opv = buildOPV(CSS_PROP_QUOTES, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -4924,7 +4929,7 @@ css_error parse_richness(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_RICHNESS, flags, value);
+ opv = buildOPV(CSS_PROP_RICHNESS, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == RICHNESS_SET)
@@ -4987,7 +4992,7 @@ css_error parse_right(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_RIGHT, flags, value);
+ opv = buildOPV(CSS_PROP_RIGHT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == RIGHT_SET)
@@ -5038,7 +5043,7 @@ css_error parse_speak_header(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_SPEAK_HEADER, flags, value);
+ opv = buildOPV(CSS_PROP_SPEAK_HEADER, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5079,7 +5084,7 @@ css_error parse_speak_numeral(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_SPEAK_NUMERAL, flags, value);
+ opv = buildOPV(CSS_PROP_SPEAK_NUMERAL, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5120,7 +5125,7 @@ css_error parse_speak_punctuation(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_SPEAK_PUNCTUATION, flags, value);
+ opv = buildOPV(CSS_PROP_SPEAK_PUNCTUATION, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5163,7 +5168,7 @@ css_error parse_speak(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_SPEAK, flags, value);
+ opv = buildOPV(CSS_PROP_SPEAK, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5239,7 +5244,7 @@ css_error parse_speech_rate(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_SPEECH_RATE, flags, value);
+ opv = buildOPV(CSS_PROP_SPEECH_RATE, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == SPEECH_RATE_SET)
@@ -5298,7 +5303,7 @@ css_error parse_stress(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_STRESS, flags, value);
+ opv = buildOPV(CSS_PROP_STRESS, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == STRESS_SET)
@@ -5347,7 +5352,7 @@ css_error parse_table_layout(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_TABLE_LAYOUT, flags, value);
+ opv = buildOPV(CSS_PROP_TABLE_LAYOUT, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5392,7 +5397,7 @@ css_error parse_text_align(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_TEXT_ALIGN, flags, value);
+ opv = buildOPV(CSS_PROP_TEXT_ALIGN, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5463,7 +5468,7 @@ css_error parse_text_decoration(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_TEXT_DECORATION, flags, value);
+ opv = buildOPV(CSS_PROP_TEXT_DECORATION, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5514,7 +5519,7 @@ css_error parse_text_indent(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_TEXT_INDENT, flags, value);
+ opv = buildOPV(CSS_PROP_TEXT_INDENT, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == TEXT_INDENT_SET)
@@ -5569,7 +5574,7 @@ css_error parse_text_transform(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_TEXT_TRANSFORM, flags, value);
+ opv = buildOPV(CSS_PROP_TEXT_TRANSFORM, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5624,7 +5629,7 @@ css_error parse_top(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_TOP, flags, value);
+ opv = buildOPV(CSS_PROP_TOP, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == TOP_SET)
@@ -5677,7 +5682,7 @@ css_error parse_unicode_bidi(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_UNICODE_BIDI, flags, value);
+ opv = buildOPV(CSS_PROP_UNICODE_BIDI, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5762,7 +5767,7 @@ css_error parse_vertical_align(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_VERTICAL_ALIGN, flags, value);
+ opv = buildOPV(CSS_PROP_VERTICAL_ALIGN, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == VERTICAL_ALIGN_SET)
@@ -5815,7 +5820,7 @@ css_error parse_visibility(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_VISIBILITY, flags, value);
+ opv = buildOPV(CSS_PROP_VISIBILITY, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -5958,7 +5963,7 @@ css_error parse_voice_family(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_VOICE_FAMILY, flags, value);
+ opv = buildOPV(CSS_PROP_VOICE_FAMILY, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, required_size, result);
@@ -6245,7 +6250,7 @@ css_error parse_volume(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_VOLUME, flags, value);
+ opv = buildOPV(CSS_PROP_VOLUME, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == VOLUME_NUMBER)
@@ -6305,7 +6310,7 @@ css_error parse_white_space(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_WHITE_SPACE, flags, value);
+ opv = buildOPV(CSS_PROP_WHITE_SPACE, flags, value);
/* Allocate result */
error = css_stylesheet_style_create(c->sheet, sizeof(opv), result);
@@ -6357,7 +6362,7 @@ css_error parse_widows(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_WIDOWS, flags, value);
+ opv = buildOPV(CSS_PROP_WIDOWS, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == WIDOWS_SET)
@@ -6424,7 +6429,7 @@ css_error parse_width(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_WIDTH, flags, value);
+ opv = buildOPV(CSS_PROP_WIDTH, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == WIDTH_SET)
@@ -6490,7 +6495,7 @@ css_error parse_word_spacing(css_language *c,
if (error != CSS_OK)
return error;
- opv = buildOPV(OP_WORD_SPACING, flags, value);
+ opv = buildOPV(CSS_PROP_WORD_SPACING, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == WORD_SPACING_SET)
@@ -6552,7 +6557,7 @@ css_error parse_z_index(css_language *c,
} else
return CSS_INVALID;
- opv = buildOPV(OP_Z_INDEX, flags, value);
+ opv = buildOPV(CSS_PROP_Z_INDEX, flags, value);
required_size = sizeof(opv);
if ((flags & FLAG_INHERIT) == false && value == Z_INDEX_SET)
diff --git a/src/select/computed.c b/src/select/computed.c
index e5605da..7829b23 100644
--- a/src/select/computed.c
+++ b/src/select/computed.c
@@ -110,7 +110,7 @@ css_error css_computed_style_compose(const css_computed_style *parent,
size_t i;
/* Iterate through the properties */
- for (i = 0; i < N_OPCODES; i++) {
+ for (i = 0; i < CSS_N_PROPERTIES; i++) {
/* Skip any in extension blocks if the block does not exist */
if (prop_dispatch[i].group == GROUP_UNCOMMON &&
parent->uncommon == NULL &&
diff --git a/src/select/dispatch.c b/src/select/dispatch.c
index 97ce4a4..98cf6ea 100644
--- a/src/select/dispatch.c
+++ b/src/select/dispatch.c
@@ -11,105 +11,105 @@
/**
* Dispatch table for properties, indexed by opcode
*/
-struct prop_table prop_dispatch[N_OPCODES] = {
- { cascade_azimuth, initial_azimuth, compose_azimuth, 1, GROUP_AURAL},
- { cascade_background_attachment, initial_background_attachment, compose_background_attachment, 0, GROUP_NORMAL },
- { cascade_background_color, initial_background_color, compose_background_color, 0, GROUP_NORMAL },
- { cascade_background_image, initial_background_image, compose_background_image, 0, GROUP_NORMAL },
- { cascade_background_position, initial_background_position, compose_background_position, 0, GROUP_NORMAL },
- { cascade_background_repeat, initial_background_repeat, compose_background_repeat, 0, GROUP_NORMAL },
- { cascade_border_collapse, initial_border_collapse, compose_border_collapse, 1, GROUP_NORMAL },
- { cascade_border_spacing, initial_border_spacing, compose_border_spacing, 1, GROUP_UNCOMMON },
- { cascade_border_top_color, initial_border_top_color, compose_border_top_color, 0, GROUP_NORMAL },
- { cascade_border_right_color, initial_border_right_color, compose_border_right_color, 0, GROUP_NORMAL },
- { cascade_border_bottom_color, initial_border_bottom_color, compose_border_bottom_color, 0, GROUP_NORMAL },
- { cascade_border_left_color, initial_border_left_color, compose_border_left_color, 0, GROUP_NORMAL },
- { cascade_border_top_style, initial_border_top_style, compose_border_top_style, 0, GROUP_NORMAL },
- { cascade_border_right_style, initial_border_right_style, compose_border_right_style, 0, GROUP_NORMAL },
- { cascade_border_bottom_style, initial_border_bottom_style, compose_border_bottom_style, 0, GROUP_NORMAL },
- { cascade_border_left_style, initial_border_left_style, compose_border_left_style, 0, GROUP_NORMAL },
- { cascade_border_top_width, initial_border_top_width, compose_border_top_width, 0, GROUP_NORMAL },
- { cascade_border_right_width, initial_border_right_width, compose_border_right_width, 0, GROUP_NORMAL },
- { cascade_border_bottom_width, initial_border_bottom_width, compose_border_bottom_width, 0, GROUP_NORMAL },
- { cascade_border_left_width, initial_border_left_width, compose_border_left_width, 0, GROUP_NORMAL },
- { cascade_bottom, initial_bottom, compose_bottom, 0, GROUP_NORMAL },
- { cascade_caption_side, initial_caption_side, compose_caption_side, 1, GROUP_NORMAL },
- { cascade_clear, initial_clear, compose_clear, 0, GROUP_NORMAL },
- { cascade_clip, initial_clip, compose_clip, 0, GROUP_UNCOMMON },
- { cascade_color, initial_color, compose_color, 1, GROUP_NORMAL },
- { cascade_content, initial_content, compose_content, 0, GROUP_UNCOMMON },
- { cascade_counter_increment, initial_counter_increment, compose_counter_increment, 0, GROUP_UNCOMMON },
- { cascade_counter_reset, initial_counter_reset, compose_counter_reset, 0, GROUP_UNCOMMON },
- { cascade_cue_after, initial_cue_after, compose_cue_after, 0, GROUP_AURAL },
- { cascade_cue_before, initial_cue_before, compose_cue_before, 0, GROUP_AURAL },
- { cascade_cursor, initial_cursor, compose_cursor, 1, GROUP_UNCOMMON },
- { cascade_direction, initial_direction, compose_direction, 1, GROUP_NORMAL },
- { cascade_display, initial_display, compose_display, 0, GROUP_NORMAL },
- { cascade_elevation, initial_elevation, compose_elevation, 1, GROUP_AURAL },
- { cascade_empty_cells, initial_empty_cells, compose_empty_cells, 1, GROUP_NORMAL },
- { cascade_float, initial_float, compose_float, 0, GROUP_NORMAL },
- { cascade_font_family, initial_font_family, compose_font_family, 1, GROUP_NORMAL },
- { cascade_font_size, initial_font_size, compose_font_size, 1, GROUP_NORMAL },
- { cascade_font_style, initial_font_style, compose_font_style, 1, GROUP_NORMAL },
- { cascade_font_variant, initial_font_variant, compose_font_variant, 1, GROUP_NORMAL },
- { cascade_font_weight, initial_font_weight, compose_font_weight, 1, GROUP_NORMAL },
- { cascade_height, initial_height, compose_height, 0, GROUP_NORMAL },
- { cascade_left, initial_left, compose_left, 0, GROUP_NORMAL },
- { cascade_letter_spacing, initial_letter_spacing, compose_letter_spacing, 1, GROUP_UNCOMMON },
- { cascade_line_height, initial_line_height, compose_line_height, 1, GROUP_NORMAL },
- { cascade_list_style_image, initial_list_style_image, compose_list_style_image, 1, GROUP_NORMAL },
- { cascade_list_style_position, initial_list_style_position, compose_list_style_position, 1, GROUP_NORMAL },
- { cascade_list_style_type, initial_list_style_type, compose_list_style_type, 1, GROUP_NORMAL },
- { cascade_margin_top, initial_margin_top, compose_margin_top, 0, GROUP_NORMAL },
- { cascade_margin_right, initial_margin_right, compose_margin_right, 0, GROUP_NORMAL },
- { cascade_margin_bottom, initial_margin_bottom, compose_margin_bottom, 0, GROUP_NORMAL },
- { cascade_margin_left, initial_margin_left, compose_margin_left, 0, GROUP_NORMAL },
- { cascade_max_height, initial_max_height, compose_max_height, 0, GROUP_NORMAL },
- { cascade_max_width, initial_max_width, compose_max_width, 0, GROUP_NORMAL },
- { cascade_min_height, initial_min_height, compose_min_height, 0, GROUP_NORMAL },
- { cascade_min_width, initial_min_width, compose_min_width, 0, GROUP_NORMAL },
- { cascade_orphans, initial_orphans, compose_orphans, 1, GROUP_PAGE },
- { cascade_outline_color, initial_outline_color, compose_outline_color, 0, GROUP_UNCOMMON },
- { cascade_outline_style, initial_outline_style, compose_outline_style, 0, GROUP_NORMAL },
- { cascade_outline_width, initial_outline_width, compose_outline_width, 0, GROUP_UNCOMMON },
- { cascade_overflow, initial_overflow, compose_overflow, 0, GROUP_NORMAL },
- { cascade_padding_top, initial_padding_top, compose_padding_top, 0, GROUP_NORMAL },
- { cascade_padding_right, initial_padding_right, compose_padding_right, 0, GROUP_NORMAL },
- { cascade_padding_bottom, initial_padding_bottom, compose_padding_bottom, 0, GROUP_NORMAL },
- { cascade_padding_left, initial_padding_left, compose_padding_left, 0, GROUP_NORMAL },
- { cascade_page_break_after, initial_page_break_after, compose_page_break_after, 0, GROUP_PAGE },
- { cascade_page_break_before, initial_page_break_before, compose_page_break_before, 0, GROUP_PAGE },
- { cascade_page_break_inside, initial_page_break_inside, compose_page_break_inside, 1, GROUP_PAGE },
- { cascade_pause_after, initial_pause_after, compose_pause_after, 0, GROUP_AURAL },
- { cascade_pause_before, initial_pause_before, compose_pause_before, 0, GROUP_AURAL },
- { cascade_pitch_range, initial_pitch_range, compose_pitch_range, 1, GROUP_AURAL },
- { cascade_pitch, initial_pitch, compose_pitch, 1, GROUP_AURAL },
- { cascade_play_during, initial_play_during, compose_play_during, 0, GROUP_AURAL },
- { cascade_position, initial_position, compose_position, 0, GROUP_NORMAL },
- { cascade_quotes, initial_quotes, compose_quotes, 1, GROUP_UNCOMMON },
- { cascade_richness, initial_richness, compose_richness, 1, GROUP_AURAL },
- { cascade_right, initial_right, compose_right, 0, GROUP_NORMAL },
- { cascade_speak_header, initial_speak_header, compose_speak_header, 1, GROUP_AURAL },
- { cascade_speak_numeral, initial_speak_numeral, compose_speak_numeral, 1, GROUP_AURAL },
- { cascade_speak_punctuation, initial_speak_punctuation, compose_speak_punctuation, 1, GROUP_AURAL },
- { cascade_speak, initial_speak, compose_speak, 1, GROUP_AURAL },
- { cascade_speech_rate, initial_speech_rate, compose_speech_rate, 1, GROUP_AURAL },
- { cascade_stress, initial_stress, compose_stress, 1, GROUP_AURAL },
- { cascade_table_layout, initial_table_layout, compose_table_layout, 0, GROUP_NORMAL },
- { cascade_text_align, initial_text_align, compose_text_align, 1, GROUP_NORMAL },
- { cascade_text_decoration, initial_text_decoration, compose_text_decoration, 0, GROUP_NORMAL },
- { cascade_text_indent, initial_text_indent, compose_text_indent, 1, GROUP_NORMAL },
- { cascade_text_transform, initial_text_transform, compose_text_transform, 1, GROUP_NORMAL },
- { cascade_top, initial_top, compose_top, 0, GROUP_NORMAL },
- { cascade_unicode_bidi, initial_unicode_bidi, compose_unicode_bidi, 0, GROUP_NORMAL },
- { cascade_vertical_align, initial_vertical_align, compose_vertical_align, 0, GROUP_NORMAL },
- { cascade_visibility, initial_visibility, compose_visibility, 1, GROUP_NORMAL },
- { cascade_voice_family, initial_voice_family, compose_voice_family, 1, GROUP_AURAL },
- { cascade_volume, initial_volume, compose_volume, 1, GROUP_AURAL },
- { cascade_white_space, initial_white_space, compose_white_space, 1, GROUP_NORMAL },
- { cascade_widows, initial_widows, compose_widows, 1, GROUP_PAGE },
- { cascade_width, initial_width, compose_width, 0, GROUP_NORMAL },
- { cascade_word_spacing, initial_word_spacing, compose_word_spacing, 1, GROUP_UNCOMMON },
- { cascade_z_index, initial_z_index, compose_z_index, 0, GROUP_NORMAL }
+struct prop_table prop_dispatch[CSS_N_PROPERTIES] = {
+ { cascade_azimuth, set_azimuth_from_hint, initial_azimuth, compose_azimuth, 1, GROUP_AURAL},
+ { cascade_background_attachment, set_background_attachment_from_hint, initial_background_attachment, compose_background_attachment, 0, GROUP_NORMAL },
+ { cascade_background_color, set_background_color_from_hint, initial_background_color, compose_background_color, 0, GROUP_NORMAL },
+ { cascade_background_image, set_background_image_from_hint, initial_background_image, compose_background_image, 0, GROUP_NORMAL },
+ { cascade_background_position, set_background_position_from_hint, initial_background_position, compose_background_position, 0, GROUP_NORMAL },
+ { cascade_background_repeat, set_background_repeat_from_hint, initial_background_repeat, compose_background_repeat, 0, GROUP_NORMAL },
+ { cascade_border_collapse, set_border_collapse_from_hint, initial_border_collapse, compose_border_collapse, 1, GROUP_NORMAL },
+ { cascade_border_spacing, set_border_spacing_from_hint, initial_border_spacing, compose_border_spacing, 1, GROUP_UNCOMMON },
+ { cascade_border_top_color, set_border_top_color_from_hint, initial_border_top_color, compose_border_top_color, 0, GROUP_NORMAL },
+ { cascade_border_right_color, set_border_right_color_from_hint, initial_border_right_color, compose_border_right_color, 0, GROUP_NORMAL },
+ { cascade_border_bottom_color, set_border_bottom_color_from_hint, initial_border_bottom_color, compose_border_bottom_color, 0, GROUP_NORMAL },
+ { cascade_border_left_color, set_border_left_color_from_hint, initial_border_left_color, compose_border_left_color, 0, GROUP_NORMAL },
+ { cascade_border_top_style, set_border_top_style_from_hint, initial_border_top_style, compose_border_top_style, 0, GROUP_NORMAL },
+ { cascade_border_right_style, set_border_right_style_from_hint, initial_border_right_style, compose_border_right_style, 0, GROUP_NORMAL },
+ { cascade_border_bottom_style, set_border_bottom_style_from_hint, initial_border_bottom_style, compose_border_bottom_style, 0, GROUP_NORMAL },
+ { cascade_border_left_style, set_border_left_style_from_hint, initial_border_left_style, compose_border_left_style, 0, GROUP_NORMAL },
+ { cascade_border_top_width, set_border_top_width_from_hint, initial_border_top_width, compose_border_top_width, 0, GROUP_NORMAL },
+ { cascade_border_right_width, set_border_right_width_from_hint, initial_border_right_width, compose_border_right_width, 0, GROUP_NORMAL },
+ { cascade_border_bottom_width, set_border_bottom_width_from_hint, initial_border_bottom_width, compose_border_bottom_width, 0, GROUP_NORMAL },
+ { cascade_border_left_width, set_border_left_width_from_hint, initial_border_left_width, compose_border_left_width, 0, GROUP_NORMAL },
+ { cascade_bottom, set_bottom_from_hint, initial_bottom, compose_bottom, 0, GROUP_NORMAL },
+ { cascade_caption_side, set_caption_side_from_hint, initial_caption_side, compose_caption_side, 1, GROUP_NORMAL },
+ { cascade_clear, set_clear_from_hint, initial_clear, compose_clear, 0, GROUP_NORMAL },
+ { cascade_clip, set_clip_from_hint, initial_clip, compose_clip, 0, GROUP_UNCOMMON },
+ { cascade_color, set_color_from_hint, initial_color, compose_color, 1, GROUP_NORMAL },
+ { cascade_content, set_content_from_hint, initial_content, compose_content, 0, GROUP_UNCOMMON },
+ { cascade_counter_increment, set_counter_increment_from_hint, initial_counter_increment, compose_counter_increment, 0, GROUP_UNCOMMON },
+ { cascade_counter_reset, set_counter_reset_from_hint, initial_counter_reset, compose_counter_reset, 0, GROUP_UNCOMMON },
+ { cascade_cue_after, set_cue_after_from_hint, initial_cue_after, compose_cue_after, 0, GROUP_AURAL },
+ { cascade_cue_before, set_cue_before_from_hint, initial_cue_before, compose_cue_before, 0, GROUP_AURAL },
+ { cascade_cursor, set_cursor_from_hint, initial_cursor, compose_cursor, 1, GROUP_UNCOMMON },
+ { cascade_direction, set_direction_from_hint, initial_direction, compose_direction, 1, GROUP_NORMAL },
+ { cascade_display, set_display_from_hint, initial_display, compose_display, 0, GROUP_NORMAL },
+ { cascade_elevation, set_elevation_from_hint, initial_elevation, compose_elevation, 1, GROUP_AURAL },
+ { cascade_empty_cells, set_empty_cells_from_hint, initial_empty_cells, compose_empty_cells, 1, GROUP_NORMAL },
+ { cascade_float, set_float_from_hint, initial_float, compose_float, 0, GROUP_NORMAL },
+ { cascade_font_family, set_font_family_from_hint, initial_font_family, compose_font_family, 1, GROUP_NORMAL },
+ { cascade_font_size, set_font_size_from_hint, initial_font_size, compose_font_size, 1, GROUP_NORMAL },
+ { cascade_font_style, set_font_style_from_hint, initial_font_style, compose_font_style, 1, GROUP_NORMAL },
+ { cascade_font_variant, set_font_variant_from_hint, initial_font_variant, compose_font_variant, 1, GROUP_NORMAL },
+ { cascade_font_weight, set_font_weight_from_hint, initial_font_weight, compose_font_weight, 1, GROUP_NORMAL },
+ { cascade_height, set_height_from_hint, initial_height, compose_height, 0, GROUP_NORMAL },
+ { cascade_left, set_left_from_hint, initial_left, compose_left, 0, GROUP_NORMAL },
+ { cascade_letter_spacing, set_letter_spacing_from_hint, initial_letter_spacing, compose_letter_spacing, 1, GROUP_UNCOMMON },
+ { cascade_line_height, set_line_height_from_hint, initial_line_height, compose_line_height, 1, GROUP_NORMAL },
+ { cascade_list_style_image, set_list_style_image_from_hint, initial_list_style_image, compose_list_style_image, 1, GROUP_NORMAL },
+ { cascade_list_style_position, set_list_style_position_from_hint, initial_list_style_position, compose_list_style_position, 1, GROUP_NORMAL },
+ { cascade_list_style_type, set_list_style_type_from_hint, initial_list_style_type, compose_list_style_type, 1, GROUP_NORMAL },
+ { cascade_margin_top, set_margin_top_from_hint, initial_margin_top, compose_margin_top, 0, GROUP_NORMAL },
+ { cascade_margin_right, set_margin_right_from_hint, initial_margin_right, compose_margin_right, 0, GROUP_NORMAL },
+ { cascade_margin_bottom, set_margin_bottom_from_hint, initial_margin_bottom, compose_margin_bottom, 0, GROUP_NORMAL },
+ { cascade_margin_left, set_margin_left_from_hint, initial_margin_left, compose_margin_left, 0, GROUP_NORMAL },
+ { cascade_max_height, set_max_height_from_hint, initial_max_height, compose_max_height, 0, GROUP_NORMAL },
+ { cascade_max_width, set_max_width_from_hint, initial_max_width, compose_max_width, 0, GROUP_NORMAL },
+ { cascade_min_height, set_min_height_from_hint, initial_min_height, compose_min_height, 0, GROUP_NORMAL },
+ { cascade_min_width, set_min_width_from_hint, initial_min_width, compose_min_width, 0, GROUP_NORMAL },
+ { cascade_orphans, set_orphans_from_hint, initial_orphans, compose_orphans, 1, GROUP_PAGE },
+ { cascade_outline_color, set_outline_color_from_hint, initial_outline_color, compose_outline_color, 0, GROUP_UNCOMMON },
+ { cascade_outline_style, set_outline_style_from_hint, initial_outline_style, compose_outline_style, 0, GROUP_NORMAL },
+ { cascade_outline_width, set_outline_width_from_hint, initial_outline_width, compose_outline_width, 0, GROUP_UNCOMMON },
+ { cascade_overflow, set_overflow_from_hint, initial_overflow, compose_overflow, 0, GROUP_NORMAL },
+ { cascade_padding_top, set_padding_top_from_hint, initial_padding_top, compose_padding_top, 0, GROUP_NORMAL },
+ { cascade_padding_right, set_padding_right_from_hint, initial_padding_right, compose_padding_right, 0, GROUP_NORMAL },
+ { cascade_padding_bottom, set_padding_bottom_from_hint, initial_padding_bottom, compose_padding_bottom, 0, GROUP_NORMAL },
+ { cascade_padding_left, set_padding_left_from_hint, initial_padding_left, compose_padding_left, 0, GROUP_NORMAL },
+ { cascade_page_break_after, set_page_break_after_from_hint, initial_page_break_after, compose_page_break_after, 0, GROUP_PAGE },
+ { cascade_page_break_before, set_page_break_before_from_hint, initial_page_break_before, compose_page_break_before, 0, GROUP_PAGE },
+ { cascade_page_break_inside, set_page_break_inside_from_hint, initial_page_break_inside, compose_page_break_inside, 1, GROUP_PAGE },
+ { cascade_pause_after, set_pause_after_from_hint, initial_pause_after, compose_pause_after, 0, GROUP_AURAL },
+ { cascade_pause_before, set_pause_before_from_hint, initial_pause_before, compose_pause_before, 0, GROUP_AURAL },
+ { cascade_pitch_range, set_pitch_range_from_hint, initial_pitch_range, compose_pitch_range, 1, GROUP_AURAL },
+ { cascade_pitch, set_pitch_from_hint, initial_pitch, compose_pitch, 1, GROUP_AURAL },
+ { cascade_play_during, set_play_during_from_hint, initial_play_during, compose_play_during, 0, GROUP_AURAL },
+ { cascade_position, set_position_from_hint, initial_position, compose_position, 0, GROUP_NORMAL },
+ { cascade_quotes, set_quotes_from_hint, initial_quotes, compose_quotes, 1, GROUP_UNCOMMON },
+ { cascade_richness, set_richness_from_hint, initial_richness, compose_richness, 1, GROUP_AURAL },
+ { cascade_right, set_right_from_hint, initial_right, compose_right, 0, GROUP_NORMAL },
+ { cascade_speak_header, set_speak_header_from_hint, initial_speak_header, compose_speak_header, 1, GROUP_AURAL },
+ { cascade_speak_numeral, set_speak_numeral_from_hint, initial_speak_numeral, compose_speak_numeral, 1, GROUP_AURAL },
+ { cascade_speak_punctuation, set_speak_punctuation_from_hint, initial_speak_punctuation, compose_speak_punctuation, 1, GROUP_AURAL },
+ { cascade_speak, set_speak_from_hint, initial_speak, compose_speak, 1, GROUP_AURAL },
+ { cascade_speech_rate, set_speech_rate_from_hint, initial_speech_rate, compose_speech_rate, 1, GROUP_AURAL },
+ { cascade_stress, set_stress_from_hint, initial_stress, compose_stress, 1, GROUP_AURAL },
+ { cascade_table_layout, set_table_layout_from_hint, initial_table_layout, compose_table_layout, 0, GROUP_NORMAL },
+ { cascade_text_align, set_text_align_from_hint, initial_text_align, compose_text_align, 1, GROUP_NORMAL },
+ { cascade_text_decoration, set_text_decoration_from_hint, initial_text_decoration, compose_text_decoration, 0, GROUP_NORMAL },
+ { cascade_text_indent, set_text_indent_from_hint, initial_text_indent, compose_text_indent, 1, GROUP_NORMAL },
+ { cascade_text_transform, set_text_transform_from_hint, initial_text_transform, compose_text_transform, 1, GROUP_NORMAL },
+ { cascade_top, set_top_from_hint, initial_top, compose_top, 0, GROUP_NORMAL },
+ { cascade_unicode_bidi, set_unicode_bidi_from_hint, initial_unicode_bidi, compose_unicode_bidi, 0, GROUP_NORMAL },
+ { cascade_vertical_align, set_vertical_align_from_hint, initial_vertical_align, compose_vertical_align, 0, GROUP_NORMAL },
+ { cascade_visibility, set_visibility_from_hint, initial_visibility, compose_visibility, 1, GROUP_NORMAL },
+ { cascade_voice_family, set_voice_family_from_hint, initial_voice_family, compose_voice_family, 1, GROUP_AURAL },
+ { cascade_volume, set_volume_from_hint, initial_volume, compose_volume, 1, GROUP_AURAL },
+ { cascade_white_space, set_white_space_from_hint, initial_white_space, compose_white_space, 1, GROUP_NORMAL },
+ { cascade_widows, set_widows_from_hint, initial_widows, compose_widows, 1, GROUP_PAGE },
+ { cascade_width, set_width_from_hint, initial_width, compose_width, 0, GROUP_NORMAL },
+ { cascade_word_spacing, set_word_spacing_from_hint, initial_word_spacing, compose_word_spacing, 1, GROUP_UNCOMMON },
+ { cascade_z_index, set_z_index_from_hint, initial_z_index, compose_z_index, 0, GROUP_NORMAL }
};
diff --git a/src/select/dispatch.h b/src/select/dispatch.h
index a5f7a7a..e38a89d 100644
--- a/src/select/dispatch.h
+++ b/src/select/dispatch.h
@@ -30,6 +30,8 @@ enum prop_group {
extern struct prop_table {
css_error (*cascade)(uint32_t opv, css_style *style,
css_select_state *state);
+ css_error (*set_from_hint)(const css_hint *hint,
+ css_computed_style *style);
css_error (*initial)(css_computed_style *style);
css_error (*compose)(const css_computed_style *parent,
const css_computed_style *child,
@@ -37,6 +39,6 @@ extern struct prop_table {
uint32_t inherited : 1,
group : 2;
-} prop_dispatch[N_OPCODES];
+} prop_dispatch[CSS_N_PROPERTIES];
#endif
diff --git a/src/select/properties.h b/src/select/properties.h
index d6af879..6f1f453 100644
--- a/src/select/properties.h
+++ b/src/select/properties.h
@@ -16,594 +16,792 @@
css_error cascade_azimuth(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_azimuth_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_azimuth(css_computed_style *style);
css_error compose_azimuth(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_background_attachment(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_background_attachment_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_background_attachment(css_computed_style *style);
css_error compose_background_attachment(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_background_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_background_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_background_color(css_computed_style *style);
css_error compose_background_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_background_image(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_background_image_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_background_image(css_computed_style *style);
css_error compose_background_image(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_background_position(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_background_position_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_background_position(css_computed_style *style);
css_error compose_background_position(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_background_repeat(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_background_repeat_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_background_repeat(css_computed_style *style);
css_error compose_background_repeat(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_collapse(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_collapse_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_collapse(css_computed_style *style);
css_error compose_border_collapse(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_spacing(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_spacing_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_spacing(css_computed_style *style);
css_error compose_border_spacing(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_top_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_top_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_top_color(css_computed_style *style);
css_error compose_border_top_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_right_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_right_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_right_color(css_computed_style *style);
css_error compose_border_right_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_bottom_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_bottom_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_bottom_color(css_computed_style *style);
css_error compose_border_bottom_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_left_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_left_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_left_color(css_computed_style *style);
css_error compose_border_left_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_top_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_top_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_top_style(css_computed_style *style);
css_error compose_border_top_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_right_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_right_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_right_style(css_computed_style *style);
css_error compose_border_right_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_bottom_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_bottom_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_bottom_style(css_computed_style *style);
css_error compose_border_bottom_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_left_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_left_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_left_style(css_computed_style *style);
css_error compose_border_left_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_top_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_top_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_top_width(css_computed_style *style);
css_error compose_border_top_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_right_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_right_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_right_width(css_computed_style *style);
css_error compose_border_right_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_bottom_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_bottom_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_bottom_width(css_computed_style *style);
css_error compose_border_bottom_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_border_left_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_border_left_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_border_left_width(css_computed_style *style);
css_error compose_border_left_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_bottom(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_bottom_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_bottom(css_computed_style *style);
css_error compose_bottom(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_caption_side(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_caption_side_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_caption_side(css_computed_style *style);
css_error compose_caption_side(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_clear(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_clear_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_clear(css_computed_style *style);
css_error compose_clear(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_clip(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_clip_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_clip(css_computed_style *style);
css_error compose_clip(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_color(css_computed_style *style);
css_error compose_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_content(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_content_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_content(css_computed_style *style);
css_error compose_content(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_counter_increment(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_counter_increment_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_counter_increment(css_computed_style *style);
css_error compose_counter_increment(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_counter_reset(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_counter_reset_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_counter_reset(css_computed_style *style);
css_error compose_counter_reset(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_cue_after(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_cue_after_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_cue_after(css_computed_style *style);
css_error compose_cue_after(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_cue_before(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_cue_before_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_cue_before(css_computed_style *style);
css_error compose_cue_before(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_cursor(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_cursor_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_cursor(css_computed_style *style);
css_error compose_cursor(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_direction(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_direction_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_direction(css_computed_style *style);
css_error compose_direction(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_display(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_display_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_display(css_computed_style *style);
css_error compose_display(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_elevation(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_elevation_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_elevation(css_computed_style *style);
css_error compose_elevation(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_empty_cells(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_empty_cells_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_empty_cells(css_computed_style *style);
css_error compose_empty_cells(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_float(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_float_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_float(css_computed_style *style);
css_error compose_float(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_font_family(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_font_family_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_font_family(css_computed_style *style);
css_error compose_font_family(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_font_size(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_font_size_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_font_size(css_computed_style *style);
css_error compose_font_size(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_font_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_font_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_font_style(css_computed_style *style);
css_error compose_font_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_font_variant(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_font_variant_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_font_variant(css_computed_style *style);
css_error compose_font_variant(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_font_weight(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_font_weight_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_font_weight(css_computed_style *style);
css_error compose_font_weight(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_height(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_height_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_height(css_computed_style *style);
css_error compose_height(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_left(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_left_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_left(css_computed_style *style);
css_error compose_left(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_letter_spacing(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_letter_spacing_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_letter_spacing(css_computed_style *style);
css_error compose_letter_spacing(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_line_height(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_line_height_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_line_height(css_computed_style *style);
css_error compose_line_height(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_list_style_image(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_list_style_image_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_list_style_image(css_computed_style *style);
css_error compose_list_style_image(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_list_style_position(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_list_style_position_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_list_style_position(css_computed_style *style);
css_error compose_list_style_position(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_list_style_type(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_list_style_type_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_list_style_type(css_computed_style *style);
css_error compose_list_style_type(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_margin_top(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_margin_top_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_margin_top(css_computed_style *style);
css_error compose_margin_top(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_margin_right(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_margin_right_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_margin_right(css_computed_style *style);
css_error compose_margin_right(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_margin_bottom(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_margin_bottom_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_margin_bottom(css_computed_style *style);
css_error compose_margin_bottom(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_margin_left(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_margin_left_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_margin_left(css_computed_style *style);
css_error compose_margin_left(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_max_height(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_max_height_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_max_height(css_computed_style *style);
css_error compose_max_height(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_max_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_max_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_max_width(css_computed_style *style);
css_error compose_max_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_min_height(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_min_height_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_min_height(css_computed_style *style);
css_error compose_min_height(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_min_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_min_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_min_width(css_computed_style *style);
css_error compose_min_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_orphans(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_orphans_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_orphans(css_computed_style *style);
css_error compose_orphans(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_outline_color(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_outline_color_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_outline_color(css_computed_style *style);
css_error compose_outline_color(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_outline_style(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_outline_style_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_outline_style(css_computed_style *style);
css_error compose_outline_style(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_outline_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_outline_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_outline_width(css_computed_style *style);
css_error compose_outline_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_overflow(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_overflow_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_overflow(css_computed_style *style);
css_error compose_overflow(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_padding_top(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_padding_top_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_padding_top(css_computed_style *style);
css_error compose_padding_top(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_padding_right(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_padding_right_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_padding_right(css_computed_style *style);
css_error compose_padding_right(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_padding_bottom(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_padding_bottom_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_padding_bottom(css_computed_style *style);
css_error compose_padding_bottom(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_padding_left(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_padding_left_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_padding_left(css_computed_style *style);
css_error compose_padding_left(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_page_break_after(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_page_break_after_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_page_break_after(css_computed_style *style);
css_error compose_page_break_after(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_page_break_before(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_page_break_before_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_page_break_before(css_computed_style *style);
css_error compose_page_break_before(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_page_break_inside(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_page_break_inside_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_page_break_inside(css_computed_style *style);
css_error compose_page_break_inside(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_pause_after(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_pause_after_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_pause_after(css_computed_style *style);
css_error compose_pause_after(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_pause_before(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_pause_before_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_pause_before(css_computed_style *style);
css_error compose_pause_before(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_pitch_range(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_pitch_range_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_pitch_range(css_computed_style *style);
css_error compose_pitch_range(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_pitch(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_pitch_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_pitch(css_computed_style *style);
css_error compose_pitch(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_play_during(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_play_during_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_play_during(css_computed_style *style);
css_error compose_play_during(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_position(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_position_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_position(css_computed_style *style);
css_error compose_position(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_quotes(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_quotes_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_quotes(css_computed_style *style);
css_error compose_quotes(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_richness(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_richness_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_richness(css_computed_style *style);
css_error compose_richness(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_right(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_right_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_right(css_computed_style *style);
css_error compose_right(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_speak_header(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_speak_header_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_speak_header(css_computed_style *style);
css_error compose_speak_header(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_speak_numeral(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_speak_numeral_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_speak_numeral(css_computed_style *style);
css_error compose_speak_numeral(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_speak_punctuation(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_speak_punctuation_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_speak_punctuation(css_computed_style *style);
css_error compose_speak_punctuation(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_speak(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_speak_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_speak(css_computed_style *style);
css_error compose_speak(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_speech_rate(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_speech_rate_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_speech_rate(css_computed_style *style);
css_error compose_speech_rate(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_stress(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_stress_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_stress(css_computed_style *style);
css_error compose_stress(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_table_layout(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_table_layout_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_table_layout(css_computed_style *style);
css_error compose_table_layout(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_text_align(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_text_align_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_text_align(css_computed_style *style);
css_error compose_text_align(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_text_decoration(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_text_decoration_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_text_decoration(css_computed_style *style);
css_error compose_text_decoration(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_text_indent(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_text_indent_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_text_indent(css_computed_style *style);
css_error compose_text_indent(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_text_transform(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_text_transform_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_text_transform(css_computed_style *style);
css_error compose_text_transform(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_top(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_top_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_top(css_computed_style *style);
css_error compose_top(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_unicode_bidi(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_unicode_bidi_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_unicode_bidi(css_computed_style *style);
css_error compose_unicode_bidi(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_vertical_align(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_vertical_align_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_vertical_align(css_computed_style *style);
css_error compose_vertical_align(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_visibility(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_visibility_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_visibility(css_computed_style *style);
css_error compose_visibility(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_voice_family(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_voice_family_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_voice_family(css_computed_style *style);
css_error compose_voice_family(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_volume(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_volume_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_volume(css_computed_style *style);
css_error compose_volume(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_white_space(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_white_space_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_white_space(css_computed_style *style);
css_error compose_white_space(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_widows(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_widows_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_widows(css_computed_style *style);
css_error compose_widows(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_width(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_width_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_width(css_computed_style *style);
css_error compose_width(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_word_spacing(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_word_spacing_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_word_spacing(css_computed_style *style);
css_error compose_word_spacing(const css_computed_style *parent,
const css_computed_style *child,
css_computed_style *result);
css_error cascade_z_index(uint32_t opv, css_style *style,
css_select_state *state);
+css_error set_z_index_from_hint(const css_hint *hint,
+ css_computed_style *style);
css_error initial_z_index(css_computed_style *style);
css_error compose_z_index(const css_computed_style *parent,
const css_computed_style *child,
diff --git a/src/select/select.c b/src/select/select.c
index 7b83f90..453289c 100644
--- a/src/select/select.c
+++ b/src/select/select.c
@@ -240,7 +240,6 @@ css_error css_select_ctx_get_sheet(css_select_ctx *ctx, uint32_t index,
* \param node Node to select style for
* \param pseudo_element Pseudo element to select for, instead
* \param media Currently active media types
- * \param hint Presentational hints, or NULL for none
* \param result Pointer to style to populate (assumed clean)
* \param handler Dispatch table of handler functions
* \param pw Client-specific private data for handler functions
@@ -257,11 +256,12 @@ css_error css_select_ctx_get_sheet(css_select_ctx *ctx, uint32_t index,
*/
css_error css_select_style(css_select_ctx *ctx, void *node,
uint32_t pseudo_element, uint64_t media,
- const css_hint *hints, css_computed_style *result,
+ css_computed_style *result,
css_select_handler *handler, void *pw)
{
uint32_t i;
css_error error;
+ css_hint hint;
css_select_state state;
if (ctx == NULL || node == NULL || result == NULL || handler == NULL)
@@ -288,23 +288,44 @@ css_error css_select_style(css_select_ctx *ctx, void *node,
}
}
- /** \todo take account of presentational hints:
- *
- * foreach property in hints:
- * if !state.property.set || (state.property.origin == UA ||
- * (state.property.origin == USER &&
- * !state.property.important)):
- * result.property = property
- * state.property.set = true
- */
- UNUSED(hints);
+ /* Take account of presentational hints */
+ /** \todo Optimisation: merge this loop and the next together */
+ for (i = 0; i < CSS_N_PROPERTIES; i++) {
+ /* If the existing property value came from an author
+ * stylesheet or a user sheet using !important, then leave
+ * it alone. */
+ if (state.props[i].set &&
+ (state.props[i].origin == CSS_ORIGIN_AUTHOR ||
+ state.props[i].important))
+ continue;
+
+ /* Retrieve this property's hint from the client */
+ error = handler->node_presentational_hint(pw, node, i, &hint);
+ if (error != CSS_OK && error != CSS_PROPERTY_NOT_SET)
+ goto cleanup;
+
+ /* Ignore if there isn't one */
+ if (error != CSS_OK)
+ continue;
+
+ /* Set it in the result */
+ error = prop_dispatch[i].set_from_hint(&hint, result);
+ if (error != CSS_OK)
+ goto cleanup;
+
+ /* Keep selection state in sync with reality */
+ state.props[i].set = 1;
+ state.props[i].specificity = 0;
+ state.props[i].origin = CSS_ORIGIN_AUTHOR;
+ state.props[i].important = 0;
+ }
/* Finally, fix up any remaining unset properties.
* Those properties which are inherited need to be set as inherit.
* Those which are not inherited need to be set to their default value.
*/
/** \todo If node is tree root, everything should be defaulted. */
- for (i = 0; i < N_OPCODES; i++) {
+ for (i = 0; i < CSS_N_PROPERTIES; i++) {
/* Do nothing if this property is set */
if (state.props[i].set)
continue;
diff --git a/src/select/select.h b/src/select/select.h
index e232a0b..1b3c702 100644
--- a/src/select/select.h
+++ b/src/select/select.h
@@ -52,7 +52,7 @@ typedef struct css_select_state {
lwc_string *before;
lwc_string *after;
- prop_state props[N_OPCODES];
+ prop_state props[CSS_N_PROPERTIES];
} css_select_state;
static inline void advance_bytecode(css_style *style, uint32_t n_bytes)
diff --git a/src/utils/errors.c b/src/utils/errors.c
index c53a442..e759d78 100644
--- a/src/utils/errors.c
+++ b/src/utils/errors.c
@@ -47,6 +47,9 @@ const char *css_error_to_string(css_error error)
case CSS_IMPORTS_PENDING:
result = "Imports pending";
break;
+ case CSS_PROPERTY_NOT_SET:
+ result = "Property not set";
+ break;
}
return result;