diff options
author | Benjamin Otte <otte@redhat.com> | 2013-03-28 23:13:43 +0100 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2013-03-28 23:18:59 +0100 |
commit | cbee3901486781370f50ee02f49bdbd463f3eaa3 (patch) | |
tree | 1fa0753468338560bed086dcfd77b69535c22ca8 /gtk/gtkcssstylefuncs.c | |
parent | c25d8e3aea900f8ae2abd2907a5b8a2e89e7ee9e (diff) | |
download | gtk+-cbee3901486781370f50ee02f49bdbd463f3eaa3.tar.gz |
cssvalue: At cycle detection to color resolving
The following CSS would infloop:
@define-color self @self
as it would infinitely lookup the color named "self" and try to resolve
it. This patch adds detection of such cycles to the resolve function by
keeping a list of currently resolving colors in the cycle_list variable.
Diffstat (limited to 'gtk/gtkcssstylefuncs.c')
-rw-r--r-- | gtk/gtkcssstylefuncs.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gtk/gtkcssstylefuncs.c b/gtk/gtkcssstylefuncs.c index af1c1b1b6f..1dff511d59 100644 --- a/gtk/gtkcssstylefuncs.c +++ b/gtk/gtkcssstylefuncs.c @@ -234,7 +234,8 @@ rgba_value_compute (GtkStyleProviderPrivate *provider, provider, _gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR), GTK_CSS_DEPENDS_ON_COLOR, - dependencies); + dependencies, + NULL); if (val != NULL) { rgba = *_gtk_css_rgba_value_get_rgba (val); @@ -323,7 +324,8 @@ color_value_compute (GtkStyleProviderPrivate *provider, provider, _gtk_css_computed_values_get_value (values, GTK_CSS_PROPERTY_COLOR), GTK_CSS_DEPENDS_ON_COLOR, - dependencies); + dependencies, + NULL); if (val != NULL) { const GdkRGBA *rgba = _gtk_css_rgba_value_get_rgba (val); |