summaryrefslogtreecommitdiff
path: root/gtk/gtkcsslookup.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2012-08-24 17:31:57 +0200
committerBenjamin Otte <otte@redhat.com>2012-08-28 15:42:24 +0200
commit1d7b23845f79e809de2906cf45b1ca0cb3eaa1a6 (patch)
treeafb2dd56fd451c2162e9d25aaf1cb6fe70d92efd /gtk/gtkcsslookup.c
parent6fbd8b00031c4627085cf4bf300dc408a39833c1 (diff)
downloadgtk+-1d7b23845f79e809de2906cf45b1ca0cb3eaa1a6.tar.gz
css: Pass relevant properties to css lookup code
This is not used yet in this patch.
Diffstat (limited to 'gtk/gtkcsslookup.c')
-rw-r--r--gtk/gtkcsslookup.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c
index e0f0af78f6..67d7b1c21b 100644
--- a/gtk/gtkcsslookup.c
+++ b/gtk/gtkcsslookup.c
@@ -36,14 +36,22 @@ struct _GtkCssLookup {
};
GtkCssLookup *
-_gtk_css_lookup_new (void)
+_gtk_css_lookup_new (const GtkBitmask *relevant)
{
GtkCssLookup *lookup;
guint n = _gtk_css_style_property_get_n_properties ();
lookup = g_malloc0 (sizeof (GtkCssLookup) + sizeof (GtkCssLookupValue) * n);
- lookup->missing = _gtk_bitmask_new ();
- lookup->missing = _gtk_bitmask_invert_range (lookup->missing, 0, n);
+
+ if (relevant)
+ {
+ lookup->missing = _gtk_bitmask_copy (relevant);
+ }
+ else
+ {
+ lookup->missing = _gtk_bitmask_new ();
+ lookup->missing = _gtk_bitmask_invert_range (lookup->missing, 0, n);
+ }
return lookup;
}
@@ -169,11 +177,13 @@ _gtk_css_lookup_resolve (GtkCssLookup *lookup,
lookup->values[i].computed,
0,
lookup->values[i].section);
- else
+ else if (lookup->values[i].value ||
+ _gtk_bitmask_get (lookup->missing, i))
_gtk_css_computed_values_compute_value (values,
context,
i,
lookup->values[i].value,
lookup->values[i].section);
+ /* else not a relevant property */
}
}