css: Move "border-style: none" special case to CssValueNumber
This fixes the background being shifted by the border-width even though the border-style was none.
This commit is contained in:
committed by
Benjamin Otte
parent
610f7e8f70
commit
728bce2cf8
@ -64,6 +64,40 @@ gtk_css_value_number_compute (GtkCssValue *number,
|
||||
GtkCssStyle *parent_values,
|
||||
GtkCssDependencies *dependencies)
|
||||
{
|
||||
GtkBorderStyle border_style;
|
||||
|
||||
/* special case according to http://dev.w3.org/csswg/css-backgrounds/#the-border-width */
|
||||
switch (property_id)
|
||||
{
|
||||
case GTK_CSS_PROPERTY_BORDER_TOP_WIDTH:
|
||||
border_style = _gtk_css_border_style_value_get(gtk_css_style_get_value (values, GTK_CSS_PROPERTY_BORDER_TOP_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN)
|
||||
return _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
break;
|
||||
case GTK_CSS_PROPERTY_BORDER_RIGHT_WIDTH:
|
||||
border_style = _gtk_css_border_style_value_get(gtk_css_style_get_value (values, GTK_CSS_PROPERTY_BORDER_RIGHT_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN)
|
||||
return _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
break;
|
||||
case GTK_CSS_PROPERTY_BORDER_BOTTOM_WIDTH:
|
||||
border_style = _gtk_css_border_style_value_get(gtk_css_style_get_value (values, GTK_CSS_PROPERTY_BORDER_BOTTOM_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN)
|
||||
return _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
break;
|
||||
case GTK_CSS_PROPERTY_BORDER_LEFT_WIDTH:
|
||||
border_style = _gtk_css_border_style_value_get(gtk_css_style_get_value (values, GTK_CSS_PROPERTY_BORDER_LEFT_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN)
|
||||
return _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
break;
|
||||
case GTK_CSS_PROPERTY_OUTLINE_WIDTH:
|
||||
border_style = _gtk_css_border_style_value_get(gtk_css_style_get_value (values, GTK_CSS_PROPERTY_OUTLINE_STYLE));
|
||||
if (border_style == GTK_BORDER_STYLE_NONE || border_style == GTK_BORDER_STYLE_HIDDEN)
|
||||
return _gtk_css_number_value_new (0, GTK_CSS_NUMBER);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
switch (number->unit)
|
||||
{
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user