cssvalue: Make the array parser no longer parse "none"

Arrays that support it, handle it themselves.
This commit is contained in:
Benjamin Otte 2012-08-29 12:30:33 +02:00
parent 44ba5d253f
commit 912d5a5c23
3 changed files with 12 additions and 18 deletions

View File

@ -157,16 +157,11 @@ _gtk_css_array_value_new_from_array (GtkCssValue **values,
GtkCssValue *
_gtk_css_array_value_parse (GtkCssParser *parser,
GtkCssValue *(* parse_func) (GtkCssParser *parser),
gboolean allow_none)
GtkCssValue *(* parse_func) (GtkCssParser *parser))
{
GtkCssValue *value, *result;
GPtrArray *values;
if (allow_none &&
_gtk_css_parser_try (parser, "none", TRUE))
return _gtk_css_value_ref (&none_singleton);
values = g_ptr_array_new ();
do {

View File

@ -30,8 +30,7 @@ GtkCssValue * _gtk_css_array_value_new (GtkCssValue *
GtkCssValue * _gtk_css_array_value_new_from_array (GtkCssValue **values,
guint n_values);
GtkCssValue * _gtk_css_array_value_parse (GtkCssParser *parser,
GtkCssValue * (* parse_func) (GtkCssParser *),
gboolean allow_none);
GtkCssValue * (* parse_func) (GtkCssParser *));
GtkCssValue * _gtk_css_array_value_get_nth (const GtkCssValue *value,
guint i);

View File

@ -222,7 +222,7 @@ static GtkCssValue *
font_family_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, font_family_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, font_family_parse_one);
}
static void
@ -394,7 +394,7 @@ static GtkCssValue *
parse_css_area (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, parse_css_area_one, FALSE);
return _gtk_css_array_value_parse (parser, parse_css_area_one);
}
static GtkCssValue *
@ -427,7 +427,7 @@ static GtkCssValue *
bindings_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, bindings_value_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, bindings_value_parse_one);
}
static void
@ -569,7 +569,7 @@ static GtkCssValue *
background_image_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, background_image_value_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, background_image_value_parse_one);
}
static void
@ -671,7 +671,7 @@ static GtkCssValue *
transition_property_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, transition_property_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, transition_property_parse_one);
}
static GtkCssValue *
@ -684,14 +684,14 @@ static GtkCssValue *
transition_time_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, transition_time_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, transition_time_parse_one);
}
static GtkCssValue *
transition_timing_function_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, _gtk_css_ease_value_parse, FALSE);
return _gtk_css_array_value_parse (parser, _gtk_css_ease_value_parse);
}
static GtkCssValue *
@ -764,21 +764,21 @@ static GtkCssValue *
background_repeat_value_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one, FALSE);
return _gtk_css_array_value_parse (parser, background_repeat_value_parse_one);
}
static GtkCssValue *
background_size_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, _gtk_css_bg_size_value_parse, FALSE);
return _gtk_css_array_value_parse (parser, _gtk_css_bg_size_value_parse);
}
static GtkCssValue *
background_position_parse (GtkCssStyleProperty *property,
GtkCssParser *parser)
{
return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse, FALSE);
return _gtk_css_array_value_parse (parser, _gtk_css_position_value_parse);
}
/*** REGISTRATION ***/