Index: Source/core/css/CSSToStyleMap.cpp |
diff --git a/Source/core/css/CSSToStyleMap.cpp b/Source/core/css/CSSToStyleMap.cpp |
index 180d3100afb670e763cc27ae8d4b94d77044b3c1..7733b599a8a4361ef5654ae5040ea174d38c9480 100644 |
--- a/Source/core/css/CSSToStyleMap.cpp |
+++ b/Source/core/css/CSSToStyleMap.cpp |
@@ -565,14 +565,14 @@ void CSSToStyleMap::mapNinePieceImage(RenderStyle* mutableStyle, CSSPropertyID p |
// We have to preserve the legacy behavior of -webkit-border-image and make the border slices |
// also set the border widths. We don't need to worry about percentages, since we don't even support |
// those on real borders yet. |
- if (image.borderSlices().top().isFixed()) |
- mutableStyle->setBorderTopWidth(image.borderSlices().top().value()); |
- if (image.borderSlices().right().isFixed()) |
- mutableStyle->setBorderRightWidth(image.borderSlices().right().value()); |
- if (image.borderSlices().bottom().isFixed()) |
- mutableStyle->setBorderBottomWidth(image.borderSlices().bottom().value()); |
- if (image.borderSlices().left().isFixed()) |
- mutableStyle->setBorderLeftWidth(image.borderSlices().left().value()); |
+ if (image.borderSlices().top().isLength() && image.borderSlices().top().length().isFixed()) |
+ mutableStyle->setBorderTopWidth(image.borderSlices().top().length().value()); |
+ if (image.borderSlices().right().isLength() && image.borderSlices().right().length().isFixed()) |
+ mutableStyle->setBorderRightWidth(image.borderSlices().right().length().value()); |
+ if (image.borderSlices().bottom().isLength() && image.borderSlices().bottom().length().isFixed()) |
+ mutableStyle->setBorderBottomWidth(image.borderSlices().bottom().length().value()); |
+ if (image.borderSlices().left().isLength() && image.borderSlices().left().length().isFixed()) |
+ mutableStyle->setBorderLeftWidth(image.borderSlices().left().length().value()); |
} |
} |
@@ -609,10 +609,10 @@ void CSSToStyleMap::mapNinePieceImageSlice(CSSValue* value, NinePieceImage& imag |
image.setFill(borderImageSlice->m_fill); |
} |
-LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const |
+LengthOrNumberBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const |
{ |
if (!value || !value->isPrimitiveValue()) |
- return LengthBox(); |
+ return LengthOrNumberBox(); |
// Get our zoom value. |
float zoom = useSVGZoomRules() ? 1.0f : style()->effectiveZoom(); |
@@ -621,35 +621,35 @@ LengthBox CSSToStyleMap::mapNinePieceImageQuad(CSSValue* value) const |
CSSPrimitiveValue* borderWidths = toCSSPrimitiveValue(value); |
// Set up a length box to represent our image slices. |
- LengthBox box; // Defaults to 'auto' so we don't have to handle that explicitly below. |
+ LengthOrNumberBox box; // Defaults to 'auto' so we don't have to handle that explicitly below. |
Quad* slices = borderWidths->getQuadValue(); |
if (slices->top()->isNumber()) |
- box.m_top = Length(slices->top()->getIntValue(), Relative); |
+ box.setTop(LengthOrNumber(slices->top()->getIntValue())); |
Julien - ping for review
2013/11/01 18:27:11
Nit: There is no explicit around LengthOrNumber(do
davve
2013/11/04 12:42:54
Thanks. I use an implicit constructor for both Len
|
else if (slices->top()->isPercentage()) |
- box.m_top = Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); |
+ box.setTop(LengthOrNumber(Length(slices->top()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent))); |
else if (slices->top()->getValueID() != CSSValueAuto) |
- box.m_top = slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom); |
+ box.setTop(LengthOrNumber(slices->top()->computeLength<Length>(style(), rootElementStyle(), zoom))); |
if (slices->right()->isNumber()) |
- box.m_right = Length(slices->right()->getIntValue(), Relative); |
+ box.setRight(LengthOrNumber(slices->right()->getIntValue())); |
else if (slices->right()->isPercentage()) |
- box.m_right = Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); |
+ box.setRight(LengthOrNumber(Length(slices->right()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent))); |
else if (slices->right()->getValueID() != CSSValueAuto) |
- box.m_right = slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom); |
+ box.setRight(LengthOrNumber(slices->right()->computeLength<Length>(style(), rootElementStyle(), zoom))); |
if (slices->bottom()->isNumber()) |
- box.m_bottom = Length(slices->bottom()->getIntValue(), Relative); |
+ box.setBottom(LengthOrNumber(slices->bottom()->getIntValue())); |
else if (slices->bottom()->isPercentage()) |
- box.m_bottom = Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); |
+ box.setBottom(LengthOrNumber(Length(slices->bottom()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent))); |
else if (slices->bottom()->getValueID() != CSSValueAuto) |
- box.m_bottom = slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom); |
+ box.setBottom(LengthOrNumber(slices->bottom()->computeLength<Length>(style(), rootElementStyle(), zoom))); |
if (slices->left()->isNumber()) |
- box.m_left = Length(slices->left()->getIntValue(), Relative); |
+ box.setLeft(LengthOrNumber(slices->left()->getIntValue())); |
else if (slices->left()->isPercentage()) |
- box.m_left = Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent); |
+ box.setLeft(LengthOrNumber(Length(slices->left()->getDoubleValue(CSSPrimitiveValue::CSS_PERCENTAGE), Percent))); |
else if (slices->left()->getValueID() != CSSValueAuto) |
- box.m_left = slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom); |
+ box.setLeft(LengthOrNumber(slices->left()->computeLength<Length>(style(), rootElementStyle(), zoom))); |
return box; |
} |