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

Unified Diff: Source/core/animation/ImageSliceStyleInterpolation.cpp

Issue 1304993002: Change Rect and Quad to be CSSValues (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@split_counter_out_attempt_3
Patch Set: Small change to generated style builder functions Created 5 years, 4 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/ImageSliceStyleInterpolation.cpp
diff --git a/Source/core/animation/ImageSliceStyleInterpolation.cpp b/Source/core/animation/ImageSliceStyleInterpolation.cpp
index 827cce5287b1d741eb0adf4ba23905850b7626dc..b147ce304af65f805c80faadad773d9a6449d183 100644
--- a/Source/core/animation/ImageSliceStyleInterpolation.cpp
+++ b/Source/core/animation/ImageSliceStyleInterpolation.cpp
@@ -7,7 +7,7 @@
#include "core/css/CSSBorderImageSliceValue.h"
#include "core/css/CSSPrimitiveValue.h"
-#include "core/css/Rect.h"
+#include "core/css/CSSQuadValue.h"
#include "core/css/resolver/StyleBuilder.h"
namespace blink {
@@ -40,7 +40,7 @@ private:
{
const size_t kQuadSides = 4;
OwnPtrWillBeRawPtr<InterpolableList> interpolableList = InterpolableList::create(kQuadSides);
- const Quad& quad = *value.slices();
+ const CSSQuadValue& quad = *value.slices();
interpolableList->set(0, InterpolableNumber::create(quad.top()->getDoubleValue()));
interpolableList->set(1, InterpolableNumber::create(quad.right()->getDoubleValue()));
interpolableList->set(2, InterpolableNumber::create(quad.bottom()->getDoubleValue()));
@@ -59,12 +59,11 @@ PassRefPtrWillBeRawPtr<CSSBorderImageSliceValue> compose(const InterpolableValue
{
const InterpolableList& interpolableList = toInterpolableList(value);
CSSPrimitiveValue::UnitType type = metadata.isPercentage ? CSSPrimitiveValue::UnitType::Percentage : CSSPrimitiveValue::UnitType::Number;
- RefPtrWillBeRawPtr<Quad> quad = Quad::create();
- quad->setTop(CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(0))->value(), 0), type));
- quad->setRight(CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(1))->value(), 0), type));
- quad->setBottom(CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(2))->value(), 0), type));
- quad->setLeft(CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(3))->value(), 0), type));
- return CSSBorderImageSliceValue::create(CSSPrimitiveValue::create(quad.release()), metadata.fill);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> top = CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(0))->value(), 0), type);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> right = CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(1))->value(), 0), type);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> bottom = CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(2))->value(), 0), type);
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> left = CSSPrimitiveValue::create(clampTo<double>(toInterpolableNumber(interpolableList.get(3))->value(), 0), type);
+ return CSSBorderImageSliceValue::create(CSSQuadValue::create(top.release(), right.release(), bottom.release(), left.release(), CSSQuadValue::SerializeAsQuad), metadata.fill);
}
} // namespace
« no previous file with comments | « Source/core/animation/DeferredLegacyStyleInterpolation.cpp ('k') | Source/core/animation/LengthBoxStyleInterpolation.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698