summaryrefslogtreecommitdiff
path: root/src/select
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/select
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/select')
-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
6 files changed, 337 insertions, 116 deletions
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)