Commit a16d6f59 authored by Andrea Iacovitti's avatar Andrea Iacovitti

Return a list of values instead of a string value.

String serialization returns a 'quoted' string, this is not expected and
may cause problem in further string manipulation process.
parent cf2317c7
......@@ -462,19 +462,10 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID )
case CSS_PROP_BACKGROUND_POSITION:
{
RETURN_NULL_ON_NULL(renderer);
QString string;
Length length(style->backgroundXPosition());
if (length.isPercent())
string = QString(QString::number(length.percent()) + "%");
else
string = QString(QString::number(length.minWidth(renderer->contentWidth())) + "px");
string += " ";
length = style->backgroundYPosition();
if (length.isPercent())
string += QString(QString::number(length.percent()) + "%");
else
string += QString(QString::number(length.minWidth(renderer->contentWidth())) + "px");
return new CSSPrimitiveValueImpl(DOMString(string), CSSPrimitiveValue::CSS_STRING);
CSSValueListImpl *values = new CSSValueListImpl(CSSValueListImpl::Space);
values->append(valueForLength(style->backgroundXPosition(), renderer->contentWidth()));
values->append(valueForLength(style->backgroundYPosition(), renderer->contentHeight()));
return values;
}
case CSS_PROP_BACKGROUND_POSITION_X:
RETURN_NULL_ON_NULL(renderer);
......@@ -526,18 +517,15 @@ CSSValueImpl *RenderStyleDeclarationImpl::getPropertyCSSValue( int propertyID )
return new CSSPrimitiveValueImpl(CSS_VAL_SEPARATE);
case CSS_PROP_BORDER_SPACING:
{
QString string(QString::number(style->borderHorizontalSpacing()) +
"px " +
QString::number(style->borderVerticalSpacing()) +
"px");
return new CSSPrimitiveValueImpl(DOMString(string), CSSPrimitiveValue::CSS_STRING);
CSSValueListImpl *values = new CSSValueListImpl(CSSValueListImpl::Space);
values->append(new CSSPrimitiveValueImpl(style->borderHorizontalSpacing(), CSSPrimitiveValue::CSS_PX));
values->append(new CSSPrimitiveValueImpl(style->borderVerticalSpacing(), CSSPrimitiveValue::CSS_PX));
return values;
}
case CSS_PROP__KHTML_BORDER_HORIZONTAL_SPACING:
return new CSSPrimitiveValueImpl(style->borderHorizontalSpacing(),
CSSPrimitiveValue::CSS_PX);
return new CSSPrimitiveValueImpl(style->borderHorizontalSpacing(), CSSPrimitiveValue::CSS_PX);
case CSS_PROP__KHTML_BORDER_VERTICAL_SPACING:
return new CSSPrimitiveValueImpl(style->borderVerticalSpacing(),
CSSPrimitiveValue::CSS_PX);
return new CSSPrimitiveValueImpl(style->borderVerticalSpacing(), CSSPrimitiveValue::CSS_PX);
case CSS_PROP__KHTML_BORDER_TOP_RIGHT_RADIUS:
case CSS_PROP_BORDER_TOP_RIGHT_RADIUS:
return valueForBorderRadii(style->borderTopRightRadius());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment