Index: third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp |
diff --git a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp |
index 432805181e45b1292d8cc04b37eb99bcdf730828..265a08e2636c73955585c90ca04e5acdb7d03c5d 100644 |
--- a/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp |
+++ b/third_party/WebKit/Source/core/css/CSSBasicShapeValues.cpp |
@@ -80,6 +80,10 @@ static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(Pass |
} else if (offset->isValuePair()) { |
side = toCSSPrimitiveValue(toCSSValuePair(*offset).first()).getValueID(); |
amount = &toCSSPrimitiveValue(toCSSValuePair(*offset).second()); |
+ if ((side == CSSValueRight || side == CSSValueBottom) && amount->isPercentage()) { |
+ side = defaultSide; |
+ amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPrimitiveValue::UnitType::Percentage); |
+ } |
} else { |
amount = toCSSPrimitiveValue(offset.get()); |
} |
@@ -87,11 +91,7 @@ static PassRefPtrWillBeRawPtr<CSSValuePair> buildSerializablePositionOffset(Pass |
if (side == CSSValueCenter) { |
side = defaultSide; |
amount = cssValuePool().createValue(50, CSSPrimitiveValue::UnitType::Percentage); |
- } else if ((side == CSSValueRight || side == CSSValueBottom) |
- && amount->isPercentage()) { |
- side = defaultSide; |
- amount = cssValuePool().createValue(100 - amount->getFloatValue(), CSSPrimitiveValue::UnitType::Percentage); |
- } else if (amount->isLength() && !amount->getFloatValue()) { |
+ } else if (!amount || (amount->isLength() && !amount->getFloatValue())) { |
if (side == CSSValueRight || side == CSSValueBottom) |
amount = cssValuePool().createValue(100, CSSPrimitiveValue::UnitType::Percentage); |
else |