diff options
author | Benjamin Otte <otte@redhat.com> | 2012-07-17 14:01:52 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2012-08-28 15:40:57 +0200 |
commit | 9e7e65ca6e01246cf9eea156f0153014b58e4d36 (patch) | |
tree | 6c4ba6560e23d854fa232a3e9af9b73b3a64972a /gtk/gtkcssinitialvalue.c | |
parent | 6dc3113edc484d9ac1bb1ca248177e279658d31e (diff) | |
download | gtk+-9e7e65ca6e01246cf9eea156f0153014b58e4d36.tar.gz |
css: Move computing of initial and inherit values
... to the compute vfunc. Simplifies code quite a bit. But makes the
code no longer a simple step-by-step implementation of the spec.
Diffstat (limited to 'gtk/gtkcssinitialvalue.c')
-rw-r--r-- | gtk/gtkcssinitialvalue.c | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/gtk/gtkcssinitialvalue.c b/gtk/gtkcssinitialvalue.c index 24955c3b58..7bebbc87d7 100644 --- a/gtk/gtkcssinitialvalue.c +++ b/gtk/gtkcssinitialvalue.c @@ -19,6 +19,8 @@ #include "gtkcssinitialvalueprivate.h" +#include "gtkcssstylepropertyprivate.h" + struct _GtkCssValue { GTK_CSS_VALUE_BASE }; @@ -35,8 +37,9 @@ gtk_css_value_initial_compute (GtkCssValue *value, guint property_id, GtkStyleContext *context) { - /* This value should be caught further up */ - g_return_val_if_reached (_gtk_css_value_ref (value)); + return _gtk_css_value_compute (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (property_id)), + property_id, + context); } static gboolean @@ -76,11 +79,3 @@ _gtk_css_initial_value_new (void) { return _gtk_css_value_ref (&initial); } - -gboolean -_gtk_css_value_is_initial (const GtkCssValue *value) -{ - g_return_val_if_fail (value != NULL, FALSE); - - return value == &initial; -} |