Index: third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
diff --git a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
index bac63e9869bfdf8c31e7585bef0aa8b4e66d4652..b5235fc8532f87410c7d7b37f09a9b1e61ad29cf 100644 |
--- a/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
+++ b/third_party/WebKit/Source/core/css/StylePropertySerializer.cpp |
@@ -659,6 +659,7 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor |
bool useRepeatXShorthand = false; |
bool useRepeatYShorthand = false; |
bool useSingleWordShorthand = false; |
+ bool foundPositionXCSSProperty = false; |
bool foundPositionYCSSProperty = false; |
for (unsigned propertyIndex = 0; propertyIndex < size; propertyIndex++) { |
@@ -711,8 +712,8 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor |
if (property == CSSPropertyBackgroundSize || property == CSSPropertyWebkitMaskSize) { |
if (foundPositionYCSSProperty) |
Timothy Loh
2016/02/08 05:29:28
Maybe this should be:
if (foundPositionXCSSProper
|
layerResult.appendLiteral(" / "); |
- else |
- continue; |
+ else if (!foundPositionXCSSProperty) |
+ layerResult.appendLiteral(" 0% 0% / "); |
} else if (!layerResult.isEmpty()) { |
// Do this second to avoid ending up with an extra space in the output if we hit the continue above. |
layerResult.append(' '); |
@@ -729,6 +730,8 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor |
useSingleWordShorthand = false; |
layerResult.append(value->cssText()); |
} |
+ if (property == CSSPropertyBackgroundPositionX) |
Timothy Loh
2016/02/08 05:29:27
might as well check for CSSPropertyWebkitMaskPosit
|
+ foundPositionXCSSProperty = true; |
if (property == CSSPropertyBackgroundPositionY || property == CSSPropertyWebkitMaskPositionY) { |
foundPositionYCSSProperty = true; |
// background-position is a special case. If only the first offset is specified, |