forked from AuroraMiddleware/gtk
csspositionvalue: make empty error value non fatal
If there's just no value to parse (e.g. because we're parsing a shorthand property), don't error out while trying to parse a number.
This commit is contained in:
parent
a17c69cc03
commit
3cd6edeba8
@ -186,14 +186,20 @@ _gtk_css_position_value_parse (GtkCssParser *parser)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (names[first].name == NULL)
|
if (names[first].name == NULL)
|
||||||
|
{
|
||||||
|
if (_gtk_css_parser_has_number (parser))
|
||||||
{
|
{
|
||||||
missing = &y;
|
missing = &y;
|
||||||
x = _gtk_css_number_value_parse (parser,
|
x = _gtk_css_number_value_parse (parser,
|
||||||
GTK_CSS_PARSE_PERCENT
|
GTK_CSS_PARSE_PERCENT
|
||||||
| GTK_CSS_PARSE_LENGTH);
|
| GTK_CSS_PARSE_LENGTH);
|
||||||
|
|
||||||
if (x == NULL)
|
if (x == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
for (second = 0; names[second].name != NULL; second++)
|
for (second = 0; names[second].name != NULL; second++)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user