[gtk/wip/baedert/for-master: 7/7] cssstaticstyle: Compute initial/inherit values directly
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/baedert/for-master: 7/7] cssstaticstyle: Compute initial/inherit values directly
- Date: Thu, 22 Aug 2019 17:27:03 +0000 (UTC)
commit b6ac424628770ec39245624252c77000e4ff90f9
Author: Timm Bäder <mail baedert org>
Date: Thu Aug 22 19:25:22 2019 +0200
cssstaticstyle: Compute initial/inherit values directly
gtk/gtkcssstaticstyle.c | 18 +++++++++++++-----
1 file changed, 13 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkcssstaticstyle.c b/gtk/gtkcssstaticstyle.c
index 840281e24e..bb8a0749e3 100644
--- a/gtk/gtkcssstaticstyle.c
+++ b/gtk/gtkcssstaticstyle.c
@@ -218,13 +218,21 @@ gtk_css_static_style_compute_value (GtkCssStaticStyle *style,
{
GtkCssStyleProperty *prop = _gtk_css_style_property_lookup_by_id (id);
- if (_gtk_css_style_property_is_inherit (prop))
- specified = _gtk_css_inherit_value_get ();
+ if (parent_style && _gtk_css_style_property_is_inherit (prop))
+ {
+ /* Just take the style from the parent */
+ value = _gtk_css_value_ref (gtk_css_style_get_value (parent_style, id));
+ }
else
- specified = _gtk_css_initial_value_get ();
+ {
+ value = gtk_css_value_initial_compute (_gtk_css_initial_value_get (),
+ id, provider, (GtkCssStyle *)style, parent_style);
+ }
+ }
+ else
+ {
+ value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style);
}
-
- value = _gtk_css_value_compute (specified, id, provider, (GtkCssStyle *)style, parent_style);
gtk_css_static_style_set_value (style, id, value, section);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]