summaryrefslogtreecommitdiff
path: root/gtk/gtkcssstylefuncs.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2013-03-28 23:13:43 +0100
committerBenjamin Otte <otte@redhat.com>2013-03-28 23:18:59 +0100
commitcbee3901486781370f50ee02f49bdbd463f3eaa3 (patch)
tree1fa0753468338560bed086dcfd77b69535c22ca8 /gtk/gtkcssstylefuncs.c
parentc25d8e3aea900f8ae2abd2907a5b8a2e89e7ee9e (diff)
downloadgtk+-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.c6
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);