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

Unified Diff: third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp

Issue 2695893002: Fix misinterpretation of background-position edge in underlying value for animations (Closed)
Patch Set: Remove dependency Created 3 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/animations/underlying-background-position-edge.html ('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/animation/LengthListPropertyFunctions.cpp
diff --git a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
index ba7c6294bfe13c653b5eb1082cb3b0c88aa74297..6f65bbf4d6ce4070f5724dd33c4de558128707b2 100644
--- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
@@ -41,15 +41,12 @@ FillLayer* accessFillLayer(CSSPropertyID property, ComputedStyle& style) {
struct FillLayerMethods {
FillLayerMethods(CSSPropertyID property) {
- isSet = nullptr;
- getLength = nullptr;
- setLength = nullptr;
- clear = nullptr;
switch (property) {
case CSSPropertyBackgroundPositionX:
case CSSPropertyWebkitMaskPositionX:
isSet = &FillLayer::isXPositionSet;
getLength = &FillLayer::xPosition;
+ getEdge = &FillLayer::backgroundXOrigin;
setLength = &FillLayer::setXPosition;
clear = &FillLayer::clearXPosition;
break;
@@ -57,6 +54,7 @@ struct FillLayerMethods {
case CSSPropertyWebkitMaskPositionY:
isSet = &FillLayer::isYPositionSet;
getLength = &FillLayer::yPosition;
+ getEdge = &FillLayer::backgroundYOrigin;
setLength = &FillLayer::setYPosition;
clear = &FillLayer::clearYPosition;
break;
@@ -66,10 +64,11 @@ struct FillLayerMethods {
}
}
- bool (FillLayer::*isSet)() const;
- const Length& (FillLayer::*getLength)() const;
- void (FillLayer::*setLength)(const Length&);
- void (FillLayer::*clear)();
+ bool (FillLayer::*isSet)() const = nullptr;
+ const Length& (FillLayer::*getLength)() const = nullptr;
+ BackgroundEdgeOrigin (FillLayer::*getEdge)() const = nullptr;
+ void (FillLayer::*setLength)(const Length&) = nullptr;
+ void (FillLayer::*clear)() = nullptr;
};
} // namespace
@@ -164,6 +163,14 @@ bool LengthListPropertyFunctions::getLengthList(CSSPropertyID property,
FillLayerMethods fillLayerMethods(property);
while (fillLayer && (fillLayer->*fillLayerMethods.isSet)()) {
result.push_back((fillLayer->*fillLayerMethods.getLength)());
+ switch ((fillLayer->*fillLayerMethods.getEdge)()) {
+ case RightEdge:
+ case BottomEdge:
+ result.back() = result.back().subtractFromOneHundredPercent();
+ break;
+ default:
+ break;
+ }
fillLayer = fillLayer->next();
}
return true;
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/underlying-background-position-edge.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698