cssparser: Make _gtk_css_parser_has_number() a bit smarter
Previously we just checked the first character. And if that was a "-" as in "-gtk-some-special-value", we assumed it was a number. Which it clearly wasn't. Test included
This commit is contained in:
parent
437dec6295
commit
3056d793a4
@ -599,8 +599,15 @@ _gtk_css_parser_try_double (GtkCssParser *parser,
|
||||
gboolean
|
||||
_gtk_css_parser_has_number (GtkCssParser *parser)
|
||||
{
|
||||
char c;
|
||||
|
||||
if (parser->data[0] == '-' || parser->data[0] == '+')
|
||||
c = parser->data[1];
|
||||
else
|
||||
c = parser->data[0];
|
||||
|
||||
/* ahem */
|
||||
return strchr ("+-0123456789.", parser->data[0]) != NULL;
|
||||
return g_ascii_isdigit (c) || c == '.';
|
||||
}
|
||||
|
||||
GtkCssValue *
|
||||
|
@ -195,6 +195,8 @@ test_data = \
|
||||
background-shorthand-single.ref.css \
|
||||
background-size.css \
|
||||
background-size.ref.css \
|
||||
background-win32-color-is-no-error.css \
|
||||
background-win32-color-is-no-error.ref.css \
|
||||
border.css \
|
||||
border.errors \
|
||||
border.ref.css \
|
||||
|
@ -0,0 +1,3 @@
|
||||
a {
|
||||
background: -gtk-win32-color(edit, highlight);
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
a {
|
||||
background-clip: border-box;
|
||||
background-color: -gtk-win32-color(edit, highlight);
|
||||
background-image: none;
|
||||
background-origin: padding-box;
|
||||
background-position: left top;
|
||||
background-repeat: repeat;
|
||||
background-size: auto;
|
||||
}
|
Loading…
Reference in New Issue
Block a user