summaryrefslogtreecommitdiff
path: root/gtk/gtkcssnumbervalue.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2019-04-09 04:47:00 +0200
committerBenjamin Otte <otte@redhat.com>2019-04-12 19:34:28 +0200
commite0a01ba1743cd147ee29ad11944f8204768dd5c1 (patch)
tree85b615330d4050cff811d2be9d2c0a6bb6a9059a /gtk/gtkcssnumbervalue.c
parent98e076b51ea05fae38d75514f0144b68ff4aabfd (diff)
downloadgtk+-e0a01ba1743cd147ee29ad11944f8204768dd5c1.tar.gz
css: Redo for new parser
This commit is still way too big, but I couldn't make it smaller. It transitions the old CSS parser to the new parser. CSS parsing is now tokenized, everything else is probably still buggy.
Diffstat (limited to 'gtk/gtkcssnumbervalue.c')
-rw-r--r--gtk/gtkcssnumbervalue.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gtk/gtkcssnumbervalue.c b/gtk/gtkcssnumbervalue.c
index 6b742c42e1..e8543bea28 100644
--- a/gtk/gtkcssnumbervalue.c
+++ b/gtk/gtkcssnumbervalue.c
@@ -129,7 +129,14 @@ gtk_css_number_value_transition (GtkCssValue *start,
gboolean
gtk_css_number_value_can_parse (GtkCssParser *parser)
{
- return _gtk_css_parser_has_number (parser)
+ return gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNED_NUMBER)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNLESS_NUMBER)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNED_INTEGER)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNLESS_INTEGER)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_PERCENTAGE)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNED_INTEGER_DIMENSION)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_SIGNLESS_INTEGER_DIMENSION)
+ || gtk_css_parser_has_token (parser, GTK_CSS_TOKEN_DIMENSION)
|| gtk_css_parser_has_function (parser, "calc");
}