Chromium Code Reviews| Index: Source/core/css/CSSComputedStyleDeclaration.cpp |
| diff --git a/Source/core/css/CSSComputedStyleDeclaration.cpp b/Source/core/css/CSSComputedStyleDeclaration.cpp |
| index e48c2a1cd8c165c53dd3e5962ae40b51dfc69dc0..39b614e7d90f9ec595ee266ae5cf6e5b31192696 100644 |
| --- a/Source/core/css/CSSComputedStyleDeclaration.cpp |
| +++ b/Source/core/css/CSSComputedStyleDeclaration.cpp |
| @@ -463,7 +463,7 @@ static PassRefPtr<CSSBorderImageSliceValue> valueForNinePieceImageSlice(const Ni |
| return CSSBorderImageSliceValue::create(cssValuePool().createValue(quad.release()), image.fill()); |
| } |
| -static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthBox& box, const RenderStyle* style) |
| +static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthOrNumberBox& box, const RenderStyle* style) |
| { |
| // Create the slices. |
| RefPtr<CSSPrimitiveValue> top; |
| @@ -471,37 +471,37 @@ static PassRefPtr<CSSPrimitiveValue> valueForNinePieceImageQuad(const LengthBox& |
| RefPtr<CSSPrimitiveValue> bottom; |
| RefPtr<CSSPrimitiveValue> left; |
| - if (box.top().isRelative()) |
| - top = cssValuePool().createValue(box.top().value(), CSSPrimitiveValue::CSS_NUMBER); |
| + if (box.top().isNumber()) |
| + top = cssValuePool().createValue(box.top().number(), CSSPrimitiveValue::CSS_NUMBER); |
| else |
| - top = cssValuePool().createValue(box.top(), style); |
| + top = cssValuePool().createValue(box.top().length(), style); |
|
Julien - ping for review
2013/11/01 18:27:11
Maybe be worth considering having a LengthOrNumber
davve
2013/11/04 12:42:54
Sure. I've put it on my todo for a later CL.
|
| if (box.right() == box.top() && box.bottom() == box.top() && box.left() == box.top()) { |
| right = top; |
| bottom = top; |
| left = top; |
| } else { |
| - if (box.right().isRelative()) |
| - right = cssValuePool().createValue(box.right().value(), CSSPrimitiveValue::CSS_NUMBER); |
| + if (box.right().isNumber()) |
| + right = cssValuePool().createValue(box.right().number(), CSSPrimitiveValue::CSS_NUMBER); |
| else |
| - right = cssValuePool().createValue(box.right(), style); |
| + right = cssValuePool().createValue(box.right().length(), style); |
| if (box.bottom() == box.top() && box.right() == box.left()) { |
| bottom = top; |
| left = right; |
| } else { |
| - if (box.bottom().isRelative()) |
| - bottom = cssValuePool().createValue(box.bottom().value(), CSSPrimitiveValue::CSS_NUMBER); |
| + if (box.bottom().isNumber()) |
| + bottom = cssValuePool().createValue(box.bottom().number(), CSSPrimitiveValue::CSS_NUMBER); |
| else |
| - bottom = cssValuePool().createValue(box.bottom(), style); |
| + bottom = cssValuePool().createValue(box.bottom().length(), style); |
| if (box.left() == box.right()) |
| left = right; |
| else { |
| - if (box.left().isRelative()) |
| - left = cssValuePool().createValue(box.left().value(), CSSPrimitiveValue::CSS_NUMBER); |
| + if (box.left().isNumber()) |
| + left = cssValuePool().createValue(box.left().number(), CSSPrimitiveValue::CSS_NUMBER); |
| else |
| - left = cssValuePool().createValue(box.left(), style); |
| + left = cssValuePool().createValue(box.left().length(), style); |
| } |
| } |
| } |