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

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

Issue 1682083004: Add additive animation support for CSS property transform-origin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_radiusInterpolationType
Patch Set: Rebased 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
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 247797fb14508ddab0fe0754060ee222f49d3408..32b45e95368254bbde5b6be3c0d7e7054f6dc709 100644
--- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
@@ -83,6 +83,7 @@ ValueRange LengthListPropertyFunctions::valueRange(CSSPropertyID property)
case CSSPropertyBackgroundPositionY:
case CSSPropertyObjectPosition:
case CSSPropertyPerspectiveOrigin:
+ case CSSPropertyTransformOrigin:
case CSSPropertyWebkitMaskPositionX:
case CSSPropertyWebkitMaskPositionY:
return ValueRangeAll;
@@ -121,6 +122,15 @@ static Vector<Length> toVector(const LengthSize& size)
return result;
}
+static Vector<Length> toVector(const TransformOrigin& transformOrigin)
+{
+ Vector<Length> result(3);
+ result[0] = transformOrigin.x();
+ result[1] = transformOrigin.y();
+ result[2] = Length(transformOrigin.z(), Fixed);
+ return result;
+}
+
Vector<Length> LengthListPropertyFunctions::getLengthList(CSSPropertyID property, const ComputedStyle& style)
{
switch (property) {
@@ -141,6 +151,8 @@ Vector<Length> LengthListPropertyFunctions::getLengthList(CSSPropertyID property
return toVector(style.borderTopLeftRadius());
case CSSPropertyBorderTopRightRadius:
return toVector(style.borderTopRightRadius());
+ case CSSPropertyTransformOrigin:
+ return toVector(style.transformOrigin());
default:
break;
}
@@ -167,6 +179,12 @@ static LengthSize sizeFromVector(const Vector<Length>& list)
return LengthSize(list[0], list[1]);
}
+static TransformOrigin transformOriginFromVector(const Vector<Length>& list)
+{
+ ASSERT(list.size() == 3);
+ return TransformOrigin(list[0], list[1], list[2].pixels());
+}
+
void LengthListPropertyFunctions::setLengthList(CSSPropertyID property, ComputedStyle& style, Vector<Length>&& lengthList)
{
switch (property) {
@@ -191,6 +209,9 @@ void LengthListPropertyFunctions::setLengthList(CSSPropertyID property, Computed
case CSSPropertyBorderTopRightRadius:
style.setBorderTopRightRadius(sizeFromVector(lengthList));
return;
+ case CSSPropertyTransformOrigin:
+ style.setTransformOrigin(transformOriginFromVector(lengthList));
+ return;
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698