Commit da25771e authored by Benjamin Otte's avatar Benjamin Otte

cssvalue: Remove GtkCssDependencies

They are not used anymore.
parent e95985da
......@@ -305,18 +305,16 @@ gtk_gradient_resolve (GtkGradient *gradient,
cairo_pattern_t *
_gtk_gradient_resolve_full (GtkGradient *gradient,
GtkStyleProviderPrivate *provider,
GtkCssStyle *values,
GtkCssStyle *parent_values,
GtkCssDependencies *dependencies)
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
cairo_pattern_t *pattern;
guint i;
g_return_val_if_fail (gradient != NULL, NULL);
g_return_val_if_fail (GTK_IS_STYLE_PROVIDER (provider), NULL);
g_return_val_if_fail (GTK_IS_CSS_STYLE (values), NULL);
g_return_val_if_fail (parent_values == NULL || GTK_IS_CSS_STYLE (parent_values), NULL);
g_return_val_if_fail (*dependencies == 0, NULL);
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
if (gradient->radius0 == 0 && gradient->radius1 == 0)
pattern = cairo_pattern_create_linear (gradient->x0, gradient->y0,
......@@ -332,21 +330,17 @@ _gtk_gradient_resolve_full (GtkGradient *gradient,
ColorStop *stop;
GtkCssValue *val;
GdkRGBA rgba;
GtkCssDependencies stop_deps;
stop = &g_array_index (gradient->stops, ColorStop, i);
/* if color resolving fails, assume transparency */
val = _gtk_css_color_value_resolve (_gtk_symbolic_color_get_css_value (stop->color),
provider,
gtk_css_style_get_value (values, GTK_CSS_PROPERTY_COLOR),
GTK_CSS_DEPENDS_ON_COLOR,
&stop_deps,
gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR),
NULL);
if (val)
{
rgba = *_gtk_css_rgba_value_get_rgba (val);
*dependencies = _gtk_css_dependencies_union (*dependencies, stop_deps);
_gtk_css_value_unref (val);
}
else
......
......@@ -25,9 +25,8 @@ G_BEGIN_DECLS
cairo_pattern_t * _gtk_gradient_resolve_full (GtkGradient *gradient,
GtkStyleProviderPrivate *provider,
GtkCssStyle *values,
GtkCssStyle *parent_values,
GtkCssDependencies *dependencies);
GtkCssStyle *style,
GtkCssStyle *parent_style);
GtkGradient * _gtk_gradient_transition (GtkGradient *start,
GtkGradient *end,
......
......@@ -306,8 +306,6 @@ gtk_symbolic_color_resolve (GtkSymbolicColor *color,
v = _gtk_css_color_value_resolve (color->value,
GTK_STYLE_PROVIDER_PRIVATE (props),
current,
0,
NULL,
NULL);
_gtk_css_value_unref (current);
if (v == NULL)
......
......@@ -47,20 +47,16 @@ gtk_css_value_array_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *result;
GtkCssValue *i_value;
guint i, j;
GtkCssDependencies child_deps;
result = NULL;
for (i = 0; i < value->n_values; i++)
{
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
i_value = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
if (result == NULL &&
i_value != value->values[i])
......
......@@ -45,25 +45,20 @@ gtk_css_value_bg_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *x, *y;
GtkCssDependencies x_deps, y_deps;
if (value->x == NULL && value->y == NULL)
return _gtk_css_value_ref (value);
x_deps = y_deps = 0;
x = y = NULL;
if (value->x)
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style, &x_deps);
x = _gtk_css_value_compute (value->x, property_id, provider, style, parent_style);
if (value->y)
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style, &y_deps);
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
y = _gtk_css_value_compute (value->y, property_id, provider, style, parent_style);
return _gtk_css_bg_size_value_new (value->x ? x : NULL,
value->y ? y : NULL);
......
......@@ -46,11 +46,9 @@ gtk_css_value_border_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *computed;
GtkCssDependencies child_deps;
gboolean changed = FALSE;
guint i;
......@@ -61,8 +59,7 @@ gtk_css_value_border_compute (GtkCssValue *value,
{
if (value->values[i])
{
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style, &child_deps);
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
computed->values[i] = _gtk_css_value_compute (value->values[i], property_id, provider, style, parent_style);
changed |= (computed->values[i] != value->values[i]);
}
}
......
......@@ -124,8 +124,7 @@ gtk_css_value_color_get_fallback (guint property_id,
property_id,
provider,
style,
parent_style,
NULL);
parent_style);
default:
if (property_id < GTK_CSS_PROPERTY_N_PROPERTIES)
g_warning ("No fallback color defined for property '%s'",
......@@ -138,20 +137,13 @@ GtkCssValue *
_gtk_css_color_value_resolve (GtkCssValue *color,
GtkStyleProviderPrivate *provider,
GtkCssValue *current,
GtkCssDependencies current_deps,
GtkCssDependencies *dependencies,
GSList *cycle_list)
{
GtkCssDependencies unused;
GtkCssValue *value;
g_return_val_if_fail (color != NULL, NULL);
g_return_val_if_fail (provider == NULL || GTK_IS_STYLE_PROVIDER_PRIVATE (provider), NULL);
if (dependencies == NULL)
dependencies = &unused;
*dependencies = 0;
switch (color->type)
{
case COLOR_TYPE_LITERAL:
......@@ -170,7 +162,7 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
if (named == NULL)
return NULL;
value = _gtk_css_color_value_resolve (named, provider, current, current_deps, dependencies, &cycle);
value = _gtk_css_color_value_resolve (named, provider, current, &cycle);
if (value == NULL)
return NULL;
}
......@@ -182,12 +174,10 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
GtkHSLA hsla;
GdkRGBA shade;
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, current_deps, dependencies, cycle_list);
val = _gtk_css_color_value_resolve (color->sym_col.shade.color, provider, current, cycle_list);
if (val == NULL)
return NULL;
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
_gtk_hsla_init_from_rgba (&hsla, _gtk_css_rgba_value_get_rgba (val));
_gtk_hsla_shade (&hsla, &hsla, color->sym_col.shade.factor);
......@@ -204,11 +194,10 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
GtkCssValue *val;
GdkRGBA alpha;
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, current_deps, dependencies, cycle_list);
val = _gtk_css_color_value_resolve (color->sym_col.alpha.color, provider, current, cycle_list);
if (val == NULL)
return NULL;
*dependencies = _gtk_css_dependencies_union (*dependencies, 0);
alpha = *_gtk_css_rgba_value_get_rgba (val);
alpha.alpha = CLAMP (alpha.alpha * color->sym_col.alpha.factor, 0, 1);
......@@ -222,21 +211,19 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
{
GtkCssValue *val;
GdkRGBA color1, color2, res;
GtkCssDependencies dep1, dep2;
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, current_deps, &dep1, cycle_list);
val = _gtk_css_color_value_resolve (color->sym_col.mix.color1, provider, current, cycle_list);
if (val == NULL)
return NULL;
color1 = *_gtk_css_rgba_value_get_rgba (val);
_gtk_css_value_unref (val);
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, current_deps, &dep2, cycle_list);
val = _gtk_css_color_value_resolve (color->sym_col.mix.color2, provider, current, cycle_list);
if (val == NULL)
return NULL;
color2 = *_gtk_css_rgba_value_get_rgba (val);
_gtk_css_value_unref (val);
*dependencies = _gtk_css_dependencies_union (dep1, dep2);
res.red = CLAMP (color1.red + ((color2.red - color1.red) * color->sym_col.mix.factor), 0, 1);
res.green = CLAMP (color1.green + ((color2.green - color1.green) * color->sym_col.mix.factor), 0, 1);
res.blue = CLAMP (color1.blue + ((color2.blue - color1.blue) * color->sym_col.mix.factor), 0, 1);
......@@ -262,7 +249,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
case COLOR_TYPE_CURRENT_COLOR:
if (current)
{
*dependencies = current_deps;
return _gtk_css_value_ref (current);
}
else
......@@ -270,8 +256,6 @@ _gtk_css_color_value_resolve (GtkCssValue *color,
return _gtk_css_color_value_resolve (_gtk_css_style_property_get_initial_value (_gtk_css_style_property_lookup_by_id (GTK_CSS_PROPERTY_COLOR)),
provider,
NULL,
0,
dependencies,
cycle_list);
}
break;
......@@ -301,11 +285,9 @@ gtk_css_value_color_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *resolved, *current;
GtkCssDependencies current_deps;
/* The computed value of the ‘currentColor’ keyword is the computed
* value of the ‘color’ property. If the ‘currentColor’ keyword is
......@@ -314,27 +296,18 @@ gtk_css_value_color_compute (GtkCssValue *value,
if (property_id == GTK_CSS_PROPERTY_COLOR)
{
if (parent_style)
{
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
current_deps = GTK_CSS_EQUALS_PARENT;
}
current = gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_COLOR);
else
{
current = NULL;
current_deps = 0;
}
current = NULL;
}
else
{
current = gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR);
current_deps = GTK_CSS_DEPENDS_ON_COLOR;
}
resolved = _gtk_css_color_value_resolve (value,
provider,
current,
current_deps,
dependencies,
NULL);
if (resolved == NULL)
......
......@@ -46,8 +46,6 @@ GtkCssValue * _gtk_css_color_value_parse (GtkCssParser *parser)
GtkCssValue * _gtk_css_color_value_resolve (GtkCssValue *color,
GtkStyleProviderPrivate *provider,
GtkCssValue *current,
GtkCssDependencies current_deps,
GtkCssDependencies *dependencies,
GSList *cycle_list);
......
......@@ -41,15 +41,12 @@ gtk_css_value_corner_compute (GtkCssValue *corner,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *x, *y;
GtkCssDependencies x_deps, y_deps;
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style, &x_deps);
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style, &y_deps);
*dependencies = _gtk_css_dependencies_union (x_deps, y_deps);
x = _gtk_css_value_compute (corner->x, property_id, provider, style, parent_style);
y = _gtk_css_value_compute (corner->y, property_id, provider, style, parent_style);
if (x == corner->x && y == corner->y)
{
_gtk_css_value_unref (x);
......
......@@ -54,8 +54,7 @@ gtk_css_value_ease_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
return _gtk_css_value_ref (value);
}
......
......@@ -40,8 +40,7 @@ gtk_css_value_engine_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
return _gtk_css_value_ref (value);
}
......
......@@ -42,8 +42,7 @@ gtk_css_value_enum_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
return _gtk_css_value_ref (value);
}
......@@ -165,8 +164,7 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
double font_size;
......@@ -197,7 +195,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
font_size = _gtk_css_font_size_get_default (provider) * 2;
break;
case GTK_CSS_FONT_SIZE_SMALLER:
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_style)
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
......@@ -206,7 +203,6 @@ gtk_css_value_font_size_compute (GtkCssValue *value,
font_size /= 1.2;
break;
case GTK_CSS_FONT_SIZE_LARGER:
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_style)
font_size = _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
......@@ -376,8 +372,7 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
PangoWeight new_weight;
int parent_value;
......@@ -385,8 +380,6 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
if (value->value >= 0)
return _gtk_css_value_ref (value);
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_style)
parent_value = gtk_css_style_get_value (parent_style, property_id)->value;
else
......
......@@ -74,8 +74,7 @@ gtk_css_value_icon_theme_compute (GtkCssValue *icon_theme,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssValue *result;
GtkIconTheme *icontheme;
......
......@@ -65,8 +65,7 @@ gtk_css_image_real_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
return g_object_ref (image);
}
......@@ -149,23 +148,17 @@ _gtk_css_image_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssDependencies unused;
GtkCssImageClass *klass;
g_return_val_if_fail (GTK_IS_CSS_IMAGE (image), NULL);
g_return_val_if_fail (GTK_IS_CSS_STYLE (style), NULL);
g_return_val_if_fail (parent_style == NULL || GTK_IS_CSS_STYLE (parent_style), NULL);
if (dependencies == NULL)
dependencies = &unused;
*dependencies = 0;
klass = GTK_CSS_IMAGE_GET_CLASS (image);
return klass->compute (image, property_id, provider, style, parent_style, dependencies);
return klass->compute (image, property_id, provider, style, parent_style);
}
GtkCssImage *
......
......@@ -806,8 +806,7 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageBuiltin *result;
GtkBorderStyle border_style;
......@@ -832,9 +831,6 @@ gtk_css_image_builtin_compute (GtkCssImage *image,
result->bg_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BACKGROUND_COLOR));
result->border_color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_BORDER_TOP_COLOR));
/* XXX: We also depend on other values, but I guess we cannot express that */
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
return GTK_CSS_IMAGE (result);
}
......
......@@ -35,8 +35,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageGradient *gradient = GTK_CSS_IMAGE_GRADIENT (image);
GtkCssImageGradient *copy;
......@@ -46,7 +45,7 @@ gtk_css_image_gradient_compute (GtkCssImage *image,
copy = g_object_new (GTK_TYPE_CSS_IMAGE_GRADIENT, NULL);
copy->gradient = gtk_gradient_ref (gradient->gradient);
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style, dependencies);
copy->pattern = _gtk_gradient_resolve_full (copy->gradient, provider, style, parent_style);
return GTK_CSS_IMAGE (copy);
}
......
......@@ -129,8 +129,7 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageIconTheme *icon_theme = GTK_CSS_IMAGE_ICON_THEME (image);
GtkCssImageIconTheme *copy;
......@@ -149,8 +148,6 @@ gtk_css_image_icon_theme_compute (GtkCssImage *image,
copy->scale = _gtk_style_provider_private_get_scale (provider);
copy->color = *_gtk_css_rgba_value_get_rgba (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_COLOR));
*dependencies = GTK_CSS_DEPENDS_ON_COLOR;
return GTK_CSS_IMAGE (copy);
}
......
......@@ -432,8 +432,7 @@ gtk_css_image_linear_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageLinear *linear = GTK_CSS_IMAGE_LINEAR (image);
GtkCssImageLinear *copy;
......@@ -442,24 +441,21 @@ gtk_css_image_linear_compute (GtkCssImage *image,
copy = g_object_new (GTK_TYPE_CSS_IMAGE_LINEAR, NULL);
copy->repeating = linear->repeating;
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style, dependencies);
copy->angle = _gtk_css_value_compute (linear->angle, property_id, provider, style, parent_style);
g_array_set_size (copy->stops, linear->stops->len);
for (i = 0; i < linear->stops->len; i++)
{
GtkCssImageLinearColorStop *stop, *scopy;
GtkCssDependencies child_deps;
stop = &g_array_index (linear->stops, GtkCssImageLinearColorStop, i);
scopy = &g_array_index (copy->stops, GtkCssImageLinearColorStop, i);
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style, &child_deps);
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
scopy->color = _gtk_css_value_compute (stop->color, property_id, provider, style, parent_style);
if (stop->offset)
{
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style, &child_deps);
*dependencies = _gtk_css_dependencies_union (*dependencies, child_deps);
scopy->offset = _gtk_css_value_compute (stop->offset, property_id, provider, style, parent_style);
}
else
{
......
......@@ -59,8 +59,7 @@ struct _GtkCssImageClass
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies);
GtkCssStyle *parent_style);
/* compare two images for equality */
gboolean (* equal) (GtkCssImage *image1,
GtkCssImage *image2);
......@@ -96,8 +95,7 @@ GtkCssImage * _gtk_css_image_compute (GtkCssImage *
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies);
GtkCssStyle *parent_style);
gboolean _gtk_css_image_equal (GtkCssImage *image1,
GtkCssImage *image2);
GtkCssImage * _gtk_css_image_transition (GtkCssImage *start,
......
......@@ -97,8 +97,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageScaled *scaled = GTK_CSS_IMAGE_SCALED (image);
GtkCssImageScaled *copy;
......@@ -122,8 +121,7 @@ gtk_css_image_scaled_compute (GtkCssImage *image,
property_id,
provider,
style,
parent_style,
dependencies);
parent_style);
else
copy->images[i] = g_object_ref (scaled->images[i]);
}
......
......@@ -124,8 +124,7 @@ gtk_css_image_url_compute (GtkCssImage *image,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImageUrl *url = GTK_CSS_IMAGE_URL (image);
......
......@@ -38,8 +38,7 @@ gtk_css_value_image_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkCssImage *image, *computed;
......@@ -48,7 +47,7 @@ gtk_css_value_image_compute (GtkCssValue *value,
if (image == NULL)
return _gtk_css_value_ref (value);
computed = _gtk_css_image_compute (image, property_id, provider, style, parent_style, dependencies);
computed = _gtk_css_image_compute (image, property_id, provider, style, parent_style);
if (computed == image)
{
......
......@@ -38,12 +38,10 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
if (parent_style)
{
*dependencies = GTK_CSS_EQUALS_PARENT;
return _gtk_css_value_ref (gtk_css_style_get_value (parent_style, property_id));
}
else
......@@ -52,8 +50,7 @@ gtk_css_value_inherit_compute (GtkCssValue *value,
property_id,
provider,
style,
parent_style,
dependencies);
parent_style);
}
}
......
......@@ -42,8 +42,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkSettings *settings;
......@@ -94,8 +93,7 @@ gtk_css_value_initial_compute (GtkCssValue *value,
property_id,
provider,
style,
parent_style,
dependencies);
parent_style);
}
static gboolean
......
......@@ -466,8 +466,7 @@ _gtk_css_keyframes_compute (GtkCssKeyframes *keyframes,
resolved->property_ids[p],
provider,
style,
parent_style,
NULL);
parent_style);
}
}
......
......@@ -39,19 +39,16 @@ static double
get_base_font_size (guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
{
*dependencies = GTK_CSS_DEPENDS_ON_PARENT;
if (parent_style)
return _gtk_css_number_value_get (gtk_css_style_get_value (parent_style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
else
return _gtk_css_font_size_get_default (provider);
}
*dependencies = GTK_CSS_DEPENDS_ON_FONT_SIZE;
return _gtk_css_number_value_get (gtk_css_style_get_value (style, GTK_CSS_PROPERTY_FONT_SIZE), 100);
}
......@@ -60,8 +57,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
guint property_id,
GtkStyleProviderPrivate *provider,
GtkCssStyle *style,
GtkCssStyle *parent_style,
GtkCssDependencies *dependencies)
GtkCssStyle *parent_style)
{
GtkBorderStyle border_style;
......@@ -106,7 +102,7 @@ gtk_css_value_number_compute (GtkCssValue *number,
/* percentages for font sizes are computed, other percentages aren't */
if (property_id == GTK_CSS_PROPERTY_FONT_SIZE)
return _gtk_css_number_value_new (number->value / 100.0 *
get_base_font_size (property_id, provider, style, parent_style, dependencies),
get_base_font_size (property_id, provider, style, parent_style),
GTK_CSS_PX);
case GTK_CSS_NUMBER:
case GTK_CSS_PX:
......@@ -134,13 +130,13 @@ gtk_css_value_number_compute (GtkCssValue *number,
break;
case GTK_CSS_EM:
return _gtk_css_number_value_new (number->value *
get_base_font_size (property_id, provider, style, parent_style, dependencies),
get_base_font_size (property_id, provider, style, parent_style),
GTK_CSS_PX);
break;
case GTK_CSS_EX:
/* for now we pretend ex is half of em */
return _gtk_css_number_value_new (number->value * 0.5 *
get_base_font_size (property_id, provider, style, parent_style, dependencies),
get_base_font_size (property_id, provider, style, parent_style),
GTK_CSS_PX);
case GTK_CSS_RAD: