summaryrefslogtreecommitdiff
path: root/gtk/gtkcssenumvalue.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-07-07 19:44:59 +0200
committerBenjamin Otte <otte@redhat.com>2014-07-07 20:06:40 +0200
commitb6aecca71c8493b8068024863b8a8fabfb89216a (patch)
treef192c4adca3ba866f94fe7a14ee6f41b43f589e2 /gtk/gtkcssenumvalue.c
parentcb1ac0c056dfc5b84d84c049f48d0b55cb019a8b (diff)
downloadgtk+-b6aecca71c8493b8068024863b8a8fabfb89216a.tar.gz
css: Fix animation-direction parsing
We were parsig "alternate-reverse" as "alternate" and then complaining about the "-reverse" junk at the end of the value.
Diffstat (limited to 'gtk/gtkcssenumvalue.c')
-rw-r--r--gtk/gtkcssenumvalue.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index a8c807b155..b131823ad0 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -524,11 +524,14 @@ _gtk_css_direction_value_new (GtkCssDirection direction)
GtkCssValue *
_gtk_css_direction_value_try_parse (GtkCssParser *parser)
{
- guint i;
+ int i;
g_return_val_if_fail (parser != NULL, NULL);
- for (i = 0; i < G_N_ELEMENTS (direction_values); i++)
+ /* need to parse backwards here, otherwise "alternate" will also match "alternate-reverse".
+ * Our parser rocks!
+ */
+ for (i = G_N_ELEMENTS (direction_values) - 1; i >= 0; i--)
{
if (_gtk_css_parser_try (parser, direction_values[i].name, TRUE))
return _gtk_css_value_ref (&direction_values[i]);