Merge pull request #69 from aygulsalahli/border_spacing

Added border spacing.
This commit is contained in:
Alexander 2019-10-21 16:05:01 +03:00 committed by GitHub
commit 0d6e102dc6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 61 additions and 9 deletions

View File

@ -801,4 +801,16 @@ static mycss_declaration_entry_t mycss_declaration_default_entry_vertical_align
NULL, NULL
};
static mycss_declaration_entry_t mycss_declaration_default_entry_border_spacing = {
MyCSS_PROPERTY_TYPE_BORDER_SPACING,
MyCSS_PROPERTY_VALUE_UNDEF,
&(mycss_values_shorthand_two_type_t){
&(mycss_values_length_t){{0}, false, MyCSS_UNIT_TYPE_UNDEF},
&(mycss_values_length_t){{0}, false, MyCSS_UNIT_TYPE_UNDEF},
},
false,
MyCSS_DECLARATION_FLAGS_READ_ONLY,
NULL, NULL
};
#endif /* MyCSS_DECLARATION_DEFAULT_ENTRIES_H */

View File

@ -92,7 +92,7 @@ static mycss_declaration_entry_t * mycss_declaration_default_entry_index_type[My
&mycss_declaration_default_entry_border_right_color,
&mycss_declaration_default_entry_border_right_style,
&mycss_declaration_default_entry_border_right_width,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_border_spacing,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_border_top_color,

View File

@ -48,6 +48,7 @@ mycss_declaration_entry_t * mycss_declaration_entry_destroy_background_image(myc
mycss_declaration_entry_t * mycss_declaration_entry_destroy_background_repeat(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_background_position(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_background_size(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_spacing(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
#ifdef __cplusplus
} /* extern "C" */

View File

@ -90,7 +90,7 @@ static mycss_callback_declaration_destroy_f mycss_declaration_entry_destroy_map_
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_border_spacing,
mycss_declaration_entry_destroy_border_style,
mycss_declaration_entry_destroy_border_x,
mycss_declaration_entry_destroy_undef,

View File

@ -90,7 +90,7 @@ static mycss_declaration_serialization_f mycss_declaration_serialization_map_by_
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_shorthand_two_type,
mycss_declaration_serialization_shorthand_four,
mycss_declaration_serialization_border_x,
mycss_declaration_serialization_undef,

View File

@ -1117,6 +1117,12 @@ enum mycss_property_border_top_right_radius {
}
typedef mycss_property_border_top_right_radius_t;
enum mycss_property_border_spacing {
MyCSS_PROPERTY_BORDER_SPACING_INHERIT = 0x0092,
MyCSS_PROPERTY_BORDER_SPACING__LENGTH = 0x019a,
}
typedef mycss_property_border_spacing_t;
enum mycss_property_border_top_style {
MyCSS_PROPERTY_BORDER_TOP_STYLE_NONE = 0x00d3,
MyCSS_PROPERTY_BORDER_TOP_STYLE_SOLID = 0x013d,

View File

@ -131,6 +131,7 @@ bool mycss_property_parser_border_right(mycss_entry_t* entry, mycss_token_t* tok
bool mycss_property_parser_border_right_color(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
bool mycss_property_parser_border_right_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
bool mycss_property_parser_border_right_width(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
bool mycss_property_parser_short_two_type(mycss_entry_t* entry, mycss_token_t* token);
bool mycss_property_parser_border_spacing(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
bool mycss_property_parser_border_style(mycss_entry_t* entry, mycss_token_t* token, bool last_response);
bool mycss_property_parser_border_top(mycss_entry_t* entry, mycss_token_t* token, bool last_response);

View File

@ -801,4 +801,17 @@ static mycss_declaration_entry_t mycss_declaration_default_entry_vertical_align
NULL, NULL
};
static mycss_declaration_entry_t mycss_declaration_default_entry_border_spacing = {
MyCSS_PROPERTY_TYPE_BORDER_SPACING,
MyCSS_PROPERTY_VALUE_UNDEF,
&(mycss_values_shorthand_two_type_t){
&(mycss_values_length_t){{0}, false, MyCSS_UNIT_TYPE_UNDEF},
&(mycss_values_length_t){{0}, false, MyCSS_UNIT_TYPE_UNDEF},
},
false,
MyCSS_DECLARATION_FLAGS_READ_ONLY,
NULL, NULL
};
#endif /* MyCSS_DECLARATION_DEFAULT_ENTRIES_H */

View File

@ -92,7 +92,7 @@ static mycss_declaration_entry_t * mycss_declaration_default_entry_index_type[My
&mycss_declaration_default_entry_border_right_color,
&mycss_declaration_default_entry_border_right_style,
&mycss_declaration_default_entry_border_right_width,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_border_spacing,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_undef,
&mycss_declaration_default_entry_border_top_color,

View File

@ -215,4 +215,17 @@ mycss_declaration_entry_t * mycss_declaration_entry_destroy_background_size(mycs
return decl_entry;
}
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_spacing(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy)
{
decl_entry->value = mycss_values_destroy_shorthand_two_type(declaration->ref_entry, decl_entry->value, true);
if(self_destroy) {
mcobject_free(declaration->mcobject_entries, decl_entry);
return NULL;
}
return decl_entry;
}

View File

@ -40,6 +40,7 @@ mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_color(mycss_d
mycss_declaration_entry_t * mycss_declaration_entry_destroy_font(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_x(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_top_right_radius(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_spacing(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_top_left_radius(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_bottom_right_radius(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);
mycss_declaration_entry_t * mycss_declaration_entry_destroy_border_bottom_left_radius(mycss_declaration_t* declaration, mycss_declaration_entry_t* decl_entry, bool self_destroy);

View File

@ -90,7 +90,7 @@ static mycss_callback_declaration_destroy_f mycss_declaration_entry_destroy_map_
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_undef,
mycss_declaration_entry_destroy_border_spacing,
mycss_declaration_entry_destroy_border_style,
mycss_declaration_entry_destroy_border_x,
mycss_declaration_entry_destroy_undef,

View File

@ -90,7 +90,7 @@ static mycss_declaration_serialization_f mycss_declaration_serialization_map_by_
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_undef,
mycss_declaration_serialization_shorthand_two_type,
mycss_declaration_serialization_shorthand_four,
mycss_declaration_serialization_border_x,
mycss_declaration_serialization_undef,

View File

@ -1033,7 +1033,7 @@ bool mycss_property_parser_border_radius(mycss_entry_t* entry, mycss_token_t* to
return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
}
bool mycss_property_parser_border_top_right_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
bool mycss_property_parser_short_two_type(mycss_entry_t* entry, mycss_token_t* token)
{
if(token->type == MyCSS_TOKEN_TYPE_WHITESPACE)
return true;
@ -1075,6 +1075,11 @@ bool mycss_property_parser_border_top_right_radius(mycss_entry_t* entry, mycss_t
return mycss_property_parser_destroy_string(&str, mycss_property_shared_switch_to_parse_error(entry));
}
bool mycss_property_parser_border_top_right_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
{
return mycss_property_parser_short_two_type(entry, token);
}
bool mycss_property_parser_border_top_left_radius(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
{
return mycss_property_parser_border_top_right_radius(entry, token, last_response);
@ -2838,7 +2843,7 @@ bool mycss_property_parser_border_image_width(mycss_entry_t* entry, mycss_token_
bool mycss_property_parser_border_spacing(mycss_entry_t* entry, mycss_token_t* token, bool last_response)
{
return mycss_property_shared_switch_to_parse_error(entry);
return mycss_property_parser_short_two_type(entry, token);
}
bool mycss_property_parser_box_decoration_break(mycss_entry_t* entry, mycss_token_t* token, bool last_response)

View File

@ -161,7 +161,7 @@ zoom-in | zoom-out | inherit | initial | unset" initial="auto" default="cursor">
<!-- https://drafts.csswg.org/css-tables-3/#propdef-border-collapse -->
<property name="border-collapse" value="separate | collapse" initial="separate"></property>
<!-- https://drafts.csswg.org/css-tables-3/#propdef-border-spacing -->
<property name="border-spacing" value="" initial="0px 0px"></property>
<property name="border-spacing" value="<length> | inherit | initial | unset" initial="0px 0px" serialize="shorthand_two_type" destroy="border_spacing" default="border_spacing"></property>
<!-- https://drafts.csswg.org/css-tables-3/#propdef-caption-side -->
<property name="caption-side" value="top | bottom" initial="top"></property>
<!-- https://drafts.csswg.org/css-tables-3/#propdef-empty-cells -->