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

Unified Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 55813002: Convert animation and renderer code to know about BorderImageLength (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@length-relative-die-step-1-4
Patch Set: Rebased to latest master Created 7 years, 1 month 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 | « no previous file | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimatableValueFactory.cpp
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index 5a733f81dc18ba4ce88b87473c38d55f310003c7..55e8e3ca17a3210966b076298285530d42d937d0 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -128,6 +128,22 @@ inline static PassRefPtr<AnimatableValue> createFromLengthBox(const LengthBox& l
createFromLength(lengthBox.bottom(), style));
}
+static PassRefPtr<AnimatableValue> createFromBorderImageLength(const BorderImageLength& borderImageLength, const RenderStyle& style)
+{
+ if (borderImageLength.isNumber())
+ return createFromDouble(borderImageLength.number());
+ return createFromLength(borderImageLength.length(), style);
+}
+
+inline static PassRefPtr<AnimatableValue> createFromBorderImageLengthBox(const BorderImageLengthBox& borderImageLengthBox, const RenderStyle& style)
+{
+ return AnimatableLengthBox::create(
+ createFromBorderImageLength(borderImageLengthBox.left(), style),
+ createFromBorderImageLength(borderImageLengthBox.right(), style),
+ createFromBorderImageLength(borderImageLengthBox.top(), style),
+ createFromBorderImageLength(borderImageLengthBox.bottom(), style));
+}
+
inline static PassRefPtr<AnimatableValue> createFromLengthBoxAndBool(const LengthBox lengthBox, const bool flag, const RenderStyle& style)
{
return AnimatableLengthBoxAndBool::create(
@@ -246,13 +262,13 @@ PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPropertyID prop
case CSSPropertyBorderBottomWidth:
return createFromDouble(style.borderBottomWidth());
case CSSPropertyBorderImageOutset:
- return createFromLengthBox(style.borderImageOutset(), style);
+ return createFromBorderImageLengthBox(style.borderImageOutset(), style);
case CSSPropertyBorderImageSlice:
return createFromLengthBox(style.borderImageSlices(), style);
case CSSPropertyBorderImageSource:
return createFromStyleImage(style.borderImageSource());
case CSSPropertyBorderImageWidth:
- return createFromLengthBox(style.borderImageWidth(), style);
+ return createFromBorderImageLengthBox(style.borderImageWidth(), style);
case CSSPropertyBorderLeftColor:
return createFromColor(property, style);
case CSSPropertyBorderLeftWidth:
@@ -395,13 +411,13 @@ PassRefPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPropertyID prop
case CSSPropertyWebkitFilter:
return AnimatableFilterOperations::create(style.filter());
case CSSPropertyWebkitMaskBoxImageOutset:
- return createFromLengthBox(style.maskBoxImageOutset(), style);
+ return createFromBorderImageLengthBox(style.maskBoxImageOutset(), style);
case CSSPropertyWebkitMaskBoxImageSlice:
return createFromLengthBoxAndBool(style.maskBoxImageSlices(), style.maskBoxImageSlicesFill(), style);
case CSSPropertyWebkitMaskBoxImageSource:
return createFromStyleImage(style.maskBoxImageSource());
case CSSPropertyWebkitMaskBoxImageWidth:
- return createFromLengthBox(style.maskBoxImageWidth(), style);
+ return createFromBorderImageLengthBox(style.maskBoxImageWidth(), style);
case CSSPropertyWebkitMaskImage:
return createFromFillLayers<CSSPropertyWebkitMaskImage>(style.maskLayers(), style);
case CSSPropertyWebkitMaskPositionX:
« no previous file with comments | « no previous file | Source/core/css/resolver/AnimatedStyleBuilder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698