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

Side by Side Diff: Source/core/animation/LengthBoxStyleInterpolation.cpp

Issue 1226123008: CSSValue Immediates: Replace CSSPrimitiveValue usage with const references (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_4_attempt_2
Patch Set: Rebase 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/animation/LengthBoxStyleInterpolation.h" 6 #include "core/animation/LengthBoxStyleInterpolation.h"
7 7
8 #include "core/css/resolver/StyleBuilder.h" 8 #include "core/css/resolver/StyleBuilder.h"
9 9
10 namespace blink { 10 namespace blink {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 result->set(i, LengthStyleInterpolation::toInterpolableValue(sideCSS Value)); 49 result->set(i, LengthStyleInterpolation::toInterpolableValue(sideCSS Value));
50 } 50 }
51 } 51 }
52 return result.release(); 52 return result.release();
53 } 53 }
54 54
55 bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start , const CSSValue& end) 55 bool LengthBoxStyleInterpolation::usesDefaultInterpolation(const CSSValue& start , const CSSValue& end)
56 { 56 {
57 if (!start.isPrimitiveValue() || !end.isPrimitiveValue()) 57 if (!start.isPrimitiveValue() || !end.isPrimitiveValue())
58 return false; 58 return false;
59 const CSSPrimitiveValue startValue = toCSSPrimitiveValue(start); 59 const CSSPrimitiveValue& startValue = toCSSPrimitiveValue(start);
60 const CSSPrimitiveValue endValue = toCSSPrimitiveValue(end); 60 const CSSPrimitiveValue& endValue = toCSSPrimitiveValue(end);
61 if ((startValue.isValueID() && startValue.getValueID() == CSSValueAuto) 61 if ((startValue.isValueID() && startValue.getValueID() == CSSValueAuto)
62 || (endValue.isValueID() && endValue.getValueID() == CSSValueAuto)) 62 || (endValue.isValueID() && endValue.getValueID() == CSSValueAuto))
63 return true; 63 return true;
64 return onlyInterpolateBetweenLengthAndCSSValueAuto(*startValue.getRectValue( ), *endValue.getRectValue()); 64 return onlyInterpolateBetweenLengthAndCSSValueAuto(*startValue.getRectValue( ), *endValue.getRectValue());
65 } 65 }
66 66
67 namespace { 67 namespace {
68 68
69 CSSPrimitiveValue indexedValueToLength(InterpolableList& lengthBox, size_t i, CS SPrimitiveValue start[], CSSPrimitiveValue end[]) 69 CSSPrimitiveValue indexedValueToLength(InterpolableList& lengthBox, size_t i, CS SPrimitiveValue start[], CSSPrimitiveValue end[])
70 { 70 {
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 } 104 }
105 105
106 DEFINE_TRACE(LengthBoxStyleInterpolation) 106 DEFINE_TRACE(LengthBoxStyleInterpolation)
107 { 107 {
108 StyleInterpolation::trace(visitor); 108 StyleInterpolation::trace(visitor);
109 visitor->trace(m_startCSSValue); 109 visitor->trace(m_startCSSValue);
110 visitor->trace(m_endCSSValue); 110 visitor->trace(m_endCSSValue);
111 } 111 }
112 112
113 } 113 }
OLDNEW
« no previous file with comments | « Source/core/animation/DoubleStyleInterpolationTest.cpp ('k') | Source/core/animation/LengthPairStyleInterpolation.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698