From f2dc63cc6a68b5ba06fa3cdc8451ed2da7c2cd45 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 2 Jan 2012 12:36:22 +0100 Subject: [PATCH] css: Pass the real context to the CSS lookup This will be necessary soon. --- gtk/gtkcsslookup.c | 9 +++++---- gtk/gtkstylecontext.c | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c index c3e6a7316f..dc43005287 100644 --- a/gtk/gtkcsslookup.c +++ b/gtk/gtkcsslookup.c @@ -106,8 +106,7 @@ _gtk_css_lookup_set (GtkCssLookup *lookup, /** * _gtk_css_lookup_resolve: * @lookup: the lookup - * @parent: the parent properties to look up inherited values from or %NULL - * if none + * @context: the context the values are resolved for * * Resolves the current lookup into a styleproperties object. This is done * by converting from the "winning declaration" to the "computed value". @@ -119,14 +118,16 @@ _gtk_css_lookup_set (GtkCssLookup *lookup, **/ GtkStyleProperties * _gtk_css_lookup_resolve (GtkCssLookup *lookup, - GtkStyleContext *parent) + GtkStyleContext *context) { GtkStyleProperties *props; + GtkStyleContext *parent; guint i, n; g_return_val_if_fail (lookup != NULL, NULL); - g_return_val_if_fail (parent == NULL || GTK_IS_STYLE_CONTEXT (parent), NULL); + g_return_val_if_fail (GTK_IS_STYLE_CONTEXT (context), NULL); + parent = gtk_style_context_get_parent (context); n = _gtk_css_style_property_get_n_properties (); props = gtk_style_properties_new (); diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c index bbcdc2a593..bda25e05a6 100644 --- a/gtk/gtkstylecontext.c +++ b/gtk/gtkstylecontext.c @@ -987,7 +987,7 @@ build_properties (GtkStyleContext *context, } } - style_data->store = _gtk_css_lookup_resolve (lookup, priv->parent); + style_data->store = _gtk_css_lookup_resolve (lookup, context); _gtk_style_properties_set_color_lookup_func (style_data->store, gtk_style_context_color_lookup_func, context);