diff options
Diffstat (limited to 'WebCore/css/CSSComputedStyleDeclaration.cpp')
-rw-r--r-- | WebCore/css/CSSComputedStyleDeclaration.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/WebCore/css/CSSComputedStyleDeclaration.cpp b/WebCore/css/CSSComputedStyleDeclaration.cpp index cbb9ca8..edb6987 100644 --- a/WebCore/css/CSSComputedStyleDeclaration.cpp +++ b/WebCore/css/CSSComputedStyleDeclaration.cpp @@ -404,14 +404,22 @@ PassRefPtr<CSSPrimitiveValue> CSSComputedStyleDeclaration::currentColorOrValidCo return CSSPrimitiveValue::createColor(color.rgb()); } -static PassRefPtr<CSSValue> getBorderRadiusCornerValue(IntSize radius) +static PassRefPtr<CSSValue> getBorderRadiusCornerValue(LengthSize radius) { - if (radius.width() == radius.height()) - return CSSPrimitiveValue::create(radius.width(), CSSPrimitiveValue::CSS_PX); - RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); - list->append(CSSPrimitiveValue::create(radius.width(), CSSPrimitiveValue::CSS_PX)); - list->append(CSSPrimitiveValue::create(radius.height(), CSSPrimitiveValue::CSS_PX)); + if (radius.width() == radius.height()) { + if (radius.width().type() == Percent) + return CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE); + return CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX); + } + if (radius.width().type() == Percent) + list->append(CSSPrimitiveValue::create(radius.width().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); + else + list->append(CSSPrimitiveValue::create(radius.width().value(), CSSPrimitiveValue::CSS_PX)); + if (radius.height().type() == Percent) + list->append(CSSPrimitiveValue::create(radius.height().percent(), CSSPrimitiveValue::CSS_PERCENTAGE)); + else + list->append(CSSPrimitiveValue::create(radius.height().value(), CSSPrimitiveValue::CSS_PX)); return list.release(); } @@ -715,6 +723,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper case CSSPropertyBackgroundColor: return CSSPrimitiveValue::createColor(m_allowVisitedStyle? style->visitedDependentColor(CSSPropertyBackgroundColor).rgb() : style->backgroundColor().rgb()); case CSSPropertyBackgroundImage: + // FIXME: Broken for multiple backgrounds. https://bugs.webkit.org/show_bug.cgi?id=44853 if (style->backgroundImage()) return style->backgroundImage()->cssValue(); return CSSPrimitiveValue::createIdentifier(CSSValueNone); @@ -861,7 +870,7 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(int proper if (cursors && cursors->size() > 0) { list = CSSValueList::createCommaSeparated(); for (unsigned i = 0; i < cursors->size(); ++i) - list->append(CSSPrimitiveValue::create((*cursors)[i].image()->url(), CSSPrimitiveValue::CSS_URI)); + list->append((*cursors)[i].image()->cssValue()); } RefPtr<CSSValue> value = CSSPrimitiveValue::create(style->cursor()); if (list) { |