[gtk+] stylecontext: Don't use cache when unsaved
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] stylecontext: Don't use cache when unsaved
- Date: Tue, 10 Feb 2015 22:49:50 +0000 (UTC)
commit b763bb0594ec98ef96d2d9987ce622e2de9452e0
Author: Benjamin Otte <otte redhat com>
Date: Tue Feb 10 23:49:15 2015 +0100
stylecontext: Don't use cache when unsaved
Fixes image-load-from-file reftest
gtk/gtkstylecontext.c | 25 ++++++++++++++++---------
1 files changed, 16 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index a1d1533..17e0c9b 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -883,17 +883,24 @@ gtk_style_context_lookup_style (GtkStyleContext *context)
if (cssnode->values)
return cssnode->values;
- values = g_hash_table_lookup (priv->style_values, cssnode->decl);
- if (values)
+ if (!gtk_style_context_is_saved (context))
{
- gtk_css_node_set_values (cssnode, values);
- return values;
+ values = build_properties (context, cssnode->decl, TRUE, gtk_css_node_get_parent_style (context,
cssnode));
}
+ else
+ {
+ values = g_hash_table_lookup (priv->style_values, cssnode->decl);
+ if (values)
+ {
+ gtk_css_node_set_values (cssnode, values);
+ return values;
+ }
- values = build_properties (context, cssnode->decl, FALSE, gtk_css_node_get_parent_style (context,
cssnode));
- g_hash_table_insert (priv->style_values,
- gtk_css_node_declaration_ref (cssnode->decl),
- g_object_ref (values));
+ values = build_properties (context, cssnode->decl, FALSE, gtk_css_node_get_parent_style (context,
cssnode));
+ g_hash_table_insert (priv->style_values,
+ gtk_css_node_declaration_ref (cssnode->decl),
+ g_object_ref (values));
+ }
gtk_css_node_set_values (cssnode, values);
g_object_unref (values);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]