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

Unified Diff: Source/core/css/resolver/AnimatedStyleBuilder.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
« no previous file with comments | « Source/core/css/LayoutStyleCSSValueMapping.cpp ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index d2460975b6406eb052be97430861dcaf9f94cc03..bd06b42e1a473995db538bd3686bc6aff9e97b51 100644
--- a/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -44,7 +44,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"
@@ -65,14 +64,24 @@ namespace blink {
namespace {
-Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
+Length animatableValueToLengthWithZoom(const AnimatableValue* value, float zoom, ValueRange range = ValueRangeAll)
{
if (value->isLength())
- return toAnimatableLength(value)->length(state.style()->effectiveZoom(), range);
+ return toAnimatableLength(value)->length(zoom, range);
ASSERT(toAnimatableUnknown(value)->toCSSValueID() == CSSValueAuto);
return Length(Auto);
}
+Length animatableValueToLength(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
+{
+ return animatableValueToLengthWithZoom(value, state.style()->effectiveZoom(), range);
+}
+
+UnzoomedLength animatableValueToUnzoomedLength(const AnimatableValue* value, const StyleResolverState&, ValueRange range = ValueRangeAll)
+{
+ return UnzoomedLength(animatableValueToLengthWithZoom(value, 1, range));
+}
+
BorderImageLength animatableValueToBorderImageLength(const AnimatableValue* value, const StyleResolverState& state)
{
if (value->isLength())
@@ -143,14 +152,6 @@ void setFillSize(FillLayer* fillLayer, const AnimatableValue* value, StyleResolv
CSSToStyleMap::mapFillSize(state, fillLayer, toAnimatableUnknown(value)->toCSSValue().get());
}
-PassRefPtrWillBeRawPtr<SVGLength> animatableValueToNonNegativeSVGLength(const AnimatableValue* value)
-{
- RefPtrWillBeRawPtr<SVGLength> length = toAnimatableSVGLength(value)->toSVGLength();
- if (length->valueInSpecifiedUnits() < 0)
- length->setValueInSpecifiedUnits(0);
- return length.release();
-}
-
template <CSSPropertyID property>
void setOnFillLayers(FillLayer& fillLayers, const AnimatableValue* value, StyleResolverState& state)
{
@@ -477,7 +478,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setRight(animatableValueToLength(value, state));
return;
case CSSPropertyStrokeWidth:
- style->setStrokeWidth(animatableValueToNonNegativeSVGLength(value));
+ style->setStrokeWidth(animatableValueToUnzoomedLength(value, state, ValueRangeNonNegative));
return;
case CSSPropertyStopColor:
style->setStopColor(toAnimatableColor(value)->color());
« no previous file with comments | « Source/core/css/LayoutStyleCSSValueMapping.cpp ('k') | Source/core/css/resolver/StyleBuilderConverter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698