Commit Graph

5 Commits

Author SHA1 Message Date
Benjamin Otte
10fa786dfa csskeyframes: Split new() into alloc() and new()
The new() function is supposed to return an empty fully initialized
GtkCssKeyframes object, while the alloc() function just allocates and
initializes static values. So alloc() can be used for copying or
resolving keyframes.

Fixes a memleak when resolving keyframes.
2014-02-23 15:40:46 +01:00
Alexander Larsson
af2c40bd54 css: Add a scale argument to css-value compute vfunc
We need to be able to compute different GtkCssImage values
depending on the scale, and we need this at compute time so that
we don't need to read any images other than the scale in used (to
e.g. calculate the image size). GtkStyleProviderPrivate is shared
for all style contexts, so its not right.
2013-07-03 14:39:25 +02:00
Cosimo Cecchi
97f49c681b csskeyframes: unref GtkCssValues when free-ing
We assume a reference to all the GtkCssValues we store, so we need to
release it when free-ing.
2012-10-16 13:07:51 -04:00
Benjamin Otte
1454ba15ba css: Huge refactoring to avoid computing wrong values
Here's the shortest description of the bug I can come up with:
When computing values, we have 3 kinds of dependencies:
(1) other properties ("currentColor" or em values)
(2) inherited properties ("inherit")
(3) generic things from the theme (@keyframes or @define-color)
Previously, we passed the GtkStyleContext as an argument, because it
provided these 3 things using:
(1) _gtk_style_context_peek_property()
(2) _gtk_style_context_peek_property(gtk_style_context_get_parent())
(3) context->priv->cascade

However, this makes it impossible to lookup values other than the ones
accessible via _gtk_style_context_peek_property(). And this is exactly
what we are doing in gtk_style_context_update_cache(). So when the cache
updates encountered case (1), they were looking up the values from the
wrong style data.

So this large patch essentially does nothing but replace the
context argument in all compute functions with new arguments for the 3
cases above:
(1) values
(2) parent_values
(3) provider

We apparently have a lot of computing code.
2012-09-28 18:27:49 +02:00
Benjamin Otte
c4cdb33b32 cssprovider: Add parsing support for @keyframes 2012-09-17 20:39:10 +02:00