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

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

Issue 1690543002: Add additive animation support for CSS properties perspective-origin and object-position (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_backgroundPositionAnimation
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 904c14d1e01a162a0c3e36da238f89fd05f3f7dd..ace98e122848de0036b402b52b45eefd608051f8 100644
--- a/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/LengthListPropertyFunctions.cpp
@@ -81,6 +81,8 @@ ValueRange LengthListPropertyFunctions::valueRange(CSSPropertyID property)
switch (property) {
case CSSPropertyBackgroundPositionX:
case CSSPropertyBackgroundPositionY:
+ case CSSPropertyObjectPosition:
+ case CSSPropertyPerspectiveOrigin:
case CSSPropertyWebkitMaskPositionX:
case CSSPropertyWebkitMaskPositionY:
return ValueRangeAll;
@@ -103,10 +105,21 @@ Vector<Length> LengthListPropertyFunctions::getLengthList(CSSPropertyID property
{
Vector<Length> result;
- if (property == CSSPropertyStrokeDasharray) {
+ switch (property) {
+ case CSSPropertyStrokeDasharray:
if (style.strokeDashArray())
result.appendVector(style.strokeDashArray()->vector());
return result;
+ case CSSPropertyObjectPosition:
+ result.append(style.objectPosition().x());
+ result.append(style.objectPosition().y());
+ return result;
+ case CSSPropertyPerspectiveOrigin:
+ result.append(style.perspectiveOrigin().x());
+ result.append(style.perspectiveOrigin().y());
+ return result;
+ default:
+ break;
}
const FillLayer* fillLayer = getFillLayer(property, style);
@@ -120,9 +133,18 @@ Vector<Length> LengthListPropertyFunctions::getLengthList(CSSPropertyID property
void LengthListPropertyFunctions::setLengthList(CSSPropertyID property, ComputedStyle& style, Vector<Length>&& lengthList)
{
- if (property == CSSPropertyStrokeDasharray) {
+ switch (property) {
+ case CSSPropertyStrokeDasharray:
style.setStrokeDashArray(lengthList.isEmpty() ? nullptr : RefVector<Length>::create(std::move(lengthList)));
return;
+ case CSSPropertyObjectPosition:
+ style.setObjectPosition(LengthPoint(lengthList[0], lengthList[1]));
+ return;
+ case CSSPropertyPerspectiveOrigin:
+ style.setPerspectiveOrigin(LengthPoint(lengthList[0], lengthList[1]));
+ return;
+ default:
+ break;
}
FillLayer* fillLayer = accessFillLayer(property, style);

Powered by Google App Engine
This is Rietveld 408576698