Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(39)

Unified Diff: third_party/WebKit/Source/core/css/StylePropertySerializer.cpp

Issue 1659903002: Fix background-size serializing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/background-image-size-serialization-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..d9af51efb45727fe9c71177107e023ab23c74c8c 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++) {
@@ -709,10 +710,10 @@ String StylePropertySerializer::getLayeredShorthandValue(const StylePropertyShor
if (!(value->isInitialValue() && toCSSInitialValue(value)->isImplicit())) {
if (property == CSSPropertyBackgroundSize || property == CSSPropertyWebkitMaskSize) {
- if (foundPositionYCSSProperty)
+ if (foundPositionYCSSProperty || foundPositionXCSSProperty)
layerResult.appendLiteral(" / ");
else
- continue;
+ 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 || property == CSSPropertyWebkitMaskPositionX)
+ foundPositionXCSSProperty = true;
if (property == CSSPropertyBackgroundPositionY || property == CSSPropertyWebkitMaskPositionY) {
foundPositionYCSSProperty = true;
// background-position is a special case. If only the first offset is specified,
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/background-image-size-serialization-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698