summaryrefslogtreecommitdiff
path: root/gtk/gtkcsslookup.c
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2014-10-24 20:17:11 +0200
committerBenjamin Otte <otte@redhat.com>2014-10-24 21:31:40 +0200
commita1f7c459b75fe47e2abb7e856e6d4a4ad5208cb9 (patch)
tree2a23cb4351d2e1516d0fb2f4ac8d2e48c3cfce1a /gtk/gtkcsslookup.c
parentec8a29b0c20af204eab7ef3ec5f79dfdeaca35ea (diff)
downloadgtk+-a1f7c459b75fe47e2abb7e856e6d4a4ad5208cb9.tar.gz
css: Disallow bypassing value computation
This special code was added back in the days when computation wasn't idemptotent. These days it is. Also, the bypass code path is only used in fallback code that is pretty much unused.
Diffstat (limited to 'gtk/gtkcsslookup.c')
-rw-r--r--gtk/gtkcsslookup.c44
1 files changed, 2 insertions, 42 deletions
diff --git a/gtk/gtkcsslookup.c b/gtk/gtkcsslookup.c
index 8166ee9de9..2c8b6b87d7 100644
--- a/gtk/gtkcsslookup.c
+++ b/gtk/gtkcsslookup.c
@@ -92,40 +92,6 @@ _gtk_css_lookup_set (GtkCssLookup *lookup,
}
/**
- * _gtk_css_lookup_set_computed:
- * @lookup: the lookup
- * @id: id of the property to set, see _gtk_style_property_get_id()
- * @section: (allow-none): The @section the value was defined in or %NULL
- * @value: the “computed value” to use
- *
- * Sets the @value for a given @id. No value may have been set for @id
- * before. See _gtk_css_lookup_is_missing(). This function is used to
- * set the “winning declaration” of a lookup. Note that for performance
- * reasons @value and @section are not copied. It is your responsibility
- * to ensure they are kept alive until _gtk_css_lookup_free() is called.
- *
- * As opposed to _gtk_css_lookup_set(), this function forces a computed
- * value and will not cause computation to happen. In particular, with this
- * method relative lengths or symbolic colors can not be used. This is
- * usually only useful for doing overrides. It should not be used for proper
- * CSS.
- **/
-void
-_gtk_css_lookup_set_computed (GtkCssLookup *lookup,
- guint id,
- GtkCssSection *section,
- GtkCssValue *value)
-{
- g_return_if_fail (lookup != NULL);
- g_return_if_fail (_gtk_bitmask_get (lookup->missing, id));
- g_return_if_fail (value != NULL);
-
- lookup->missing = _gtk_bitmask_set (lookup->missing, id, FALSE);
- lookup->values[id].computed = value;
- lookup->values[id].section = section;
-}
-
-/**
* _gtk_css_lookup_resolve:
* @lookup: the lookup
* @context: the context the values are resolved for
@@ -155,14 +121,8 @@ _gtk_css_lookup_resolve (GtkCssLookup *lookup,
for (i = 0; i < n; i++)
{
- if (lookup->values[i].computed)
- _gtk_css_computed_values_set_value (values,
- i,
- lookup->values[i].computed,
- 0,
- lookup->values[i].section);
- else if (lookup->values[i].value ||
- _gtk_bitmask_get (lookup->missing, i))
+ if (lookup->values[i].value ||
+ _gtk_bitmask_get (lookup->missing, i))
_gtk_css_computed_values_compute_value (values,
provider,
scale,