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

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

Issue 983103003: Use Length for the stroke-width property in SVGLayoutStyle (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: lengthSetterForProperty Created 5 years, 9 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: Source/core/animation/css/CSSAnimatableValueFactory.cpp
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index 9c36cabe7a29c857d4d7e12ed770032d9b23c969..6b00404ae2e9796fcd0adb8fa2297a1a28ae2dff 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -45,7 +45,6 @@
#include "core/animation/animatable/AnimatableLengthPoint3D.h"
#include "core/animation/animatable/AnimatableLengthSize.h"
#include "core/animation/animatable/AnimatableRepeatable.h"
-#include "core/animation/animatable/AnimatableSVGLength.h"
#include "core/animation/animatable/AnimatableSVGPaint.h"
#include "core/animation/animatable/AnimatableShadow.h"
#include "core/animation/animatable/AnimatableShapeValue.h"
@@ -63,13 +62,13 @@
namespace blink {
-static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLength(const Length& length, const LayoutStyle& style)
+static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLengthWithZoom(const Length& length, float zoom)
{
switch (length.type()) {
case Fixed:
case Percent:
case Calculated:
- return AnimatableLength::create(length, style.effectiveZoom());
+ return AnimatableLength::create(length, zoom);
case Auto:
case Intrinsic:
case MinIntrinsic:
@@ -90,6 +89,16 @@ static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLength(const Length& le
return nullptr;
}
+static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLength(const Length& length, const LayoutStyle& style)
+{
+ return createFromLengthWithZoom(length, style.effectiveZoom());
+}
+
+static PassRefPtrWillBeRawPtr<AnimatableValue> createFromUnzoomedLength(const UnzoomedLength& unzoomedLength)
+{
+ return createFromLengthWithZoom(unzoomedLength.length(), 1);
+}
+
static PassRefPtrWillBeRawPtr<AnimatableValue> createFromLineHeight(const Length& length, const LayoutStyle& style)
{
if (length.type() == Percent) {
@@ -434,7 +443,7 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
case CSSPropertyRight:
return createFromLength(style.right(), style);
case CSSPropertyStrokeWidth:
- return AnimatableSVGLength::create(style.strokeWidth());
+ return createFromUnzoomedLength(style.strokeWidth());
case CSSPropertyStopColor:
return createFromColor(property, style);
case CSSPropertyStopOpacity:
« no previous file with comments | « Source/core/animation/animatable/AnimatableValueTestHelperTest.cpp ('k') | Source/core/animation/css/CSSPropertyEquality.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698