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

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

Issue 1225553002: CSSValue Immediates: Make CSSPrimitiveValue a container (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 5 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/LengthBoxStyleInterpolation.cpp
diff --git a/Source/core/animation/LengthBoxStyleInterpolation.cpp b/Source/core/animation/LengthBoxStyleInterpolation.cpp
index 42cda4ba4510bbe4467c30a551c14f78e84a592f..d3f9724e1867193e91daf3828fa0f84a7360b693 100644
--- a/Source/core/animation/LengthBoxStyleInterpolation.cpp
+++ b/Source/core/animation/LengthBoxStyleInterpolation.cpp
@@ -13,10 +13,10 @@ namespace {
bool onlyInterpolateBetweenLengthAndCSSValueAuto(Rect& startRect, Rect& endRect)
{
- return startRect.left()->isLength() != endRect.left()->isLength()
- && startRect.right()->isLength() != endRect.right()->isLength()
- && startRect.top()->isLength() != endRect.top()->isLength()
- && startRect.bottom()->isLength() != endRect.bottom()->isLength();
+ return startRect.left().isLength() != endRect.left().isLength()
+ && startRect.right().isLength() != endRect.right().isLength()
+ && startRect.top().isLength() != endRect.top().isLength()
+ && startRect.bottom().isLength() != endRect.bottom().isLength();
}
} // namespace
@@ -37,14 +37,14 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> LengthBoxStyleInterpolation::lengthBox
OwnPtrWillBeRawPtr<InterpolableList> result = InterpolableList::create(numberOfSides);
Rect* rect = toCSSPrimitiveValue(lengthBox).getRectValue();
Rect* matchingRect = toCSSPrimitiveValue(matchingValue).getRectValue();
- CSSPrimitiveValue* side[numberOfSides] = { rect->left(), rect->right(), rect->top(), rect->bottom() };
- CSSPrimitiveValue* matchingSide[numberOfSides] = { matchingRect->left(), matchingRect->right(), matchingRect->top(), matchingRect->bottom() };
+ CSSPrimitiveValue side[numberOfSides] = { rect->left(), rect->right(), rect->top(), rect->bottom() };
+ CSSPrimitiveValue matchingSide[numberOfSides] = { matchingRect->left(), matchingRect->right(), matchingRect->top(), matchingRect->bottom() };
for (size_t i = 0; i < numberOfSides; i++) {
- if (side[i]->isValueID() || matchingSide[i]->isValueID()) {
+ if (side[i].isValueID() || matchingSide[i].isValueID()) {
result->set(i, InterpolableBool::create(isEndInterpolation));
} else {
- CSSValue sideCSSValue(*side[i]);
+ CSSValue sideCSSValue(side[i]);
ASSERT(LengthStyleInterpolation::canCreateFrom(sideCSSValue));
result->set(i, LengthStyleInterpolation::toInterpolableValue(sideCSSValue));
}
@@ -56,8 +56,8 @@ bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start
{
if (!start.isPrimitiveValue() || !end.isPrimitiveValue())
return false;
- const CSSPrimitiveValue& startValue = toCSSPrimitiveValue(start);
- const CSSPrimitiveValue& endValue = toCSSPrimitiveValue(end);
+ const CSSPrimitiveValue startValue = toCSSPrimitiveValue(start);
+ const CSSPrimitiveValue endValue = toCSSPrimitiveValue(end);
if ((startValue.isValueID() && startValue.getValueID() == CSSValueAuto)
|| (endValue.isValueID() && endValue.getValueID() == CSSValueAuto))
return true;
@@ -66,7 +66,7 @@ bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start
namespace {
-PassRefPtrWillBeRawPtr<CSSPrimitiveValue> indexedValueToLength(InterpolableList& lengthBox, size_t i, CSSPrimitiveValue* start[], CSSPrimitiveValue* end[])
+CSSPrimitiveValue indexedValueToLength(InterpolableList& lengthBox, size_t i, CSSPrimitiveValue start[], CSSPrimitiveValue end[])
{
if (lengthBox.get(i)->isBool()) {
if (toInterpolableBool(lengthBox.get(i))->value())
@@ -83,8 +83,8 @@ CSSValue LengthBoxStyleInterpolation::interpolableValueToLengthBox(InterpolableV
InterpolableList* lengthBox = toInterpolableList(value);
Rect* startRect = toCSSPrimitiveValue(originalStart).getRectValue();
Rect* endRect = toCSSPrimitiveValue(originalEnd).getRectValue();
- CSSPrimitiveValue* startSides[4] = { startRect->left(), startRect->right(), startRect->top(), startRect->bottom() };
- CSSPrimitiveValue* endSides[4] = { endRect->left(), endRect->right(), endRect->top(), endRect->bottom() };
+ CSSPrimitiveValue startSides[4] = { startRect->left(), startRect->right(), startRect->top(), startRect->bottom() };
+ CSSPrimitiveValue endSides[4] = { endRect->left(), endRect->right(), endRect->top(), endRect->bottom() };
RefPtrWillBeRawPtr<Rect> result = Rect::create();
result->setLeft(indexedValueToLength(*lengthBox, 0, startSides, endSides));
« no previous file with comments | « Source/core/animation/KeyframeEffectModelTest.cpp ('k') | Source/core/animation/LengthBoxStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698