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

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

Issue 1190253003: Remove redundant check for CSS_DEG type, isAngle() is more general (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/DoubleStyleInterpolation.h" 6 #include "core/animation/DoubleStyleInterpolation.h"
7 7
8 #include "core/css/CSSCalculationValue.h" 8 #include "core/css/CSSCalculationValue.h"
9 #include "core/css/resolver/StyleBuilder.h" 9 #include "core/css/resolver/StyleBuilder.h"
10 10
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 for (int i = 0; i < len; i++) { 95 for (int i = 0; i < len; i++) {
96 const CSSValue* item = list.item(i); 96 const CSSValue* item = list.item(i);
97 if (!item->isPrimitiveValue()) 97 if (!item->isPrimitiveValue())
98 return false; 98 return false;
99 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item); 99 const CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(item);
100 if (primitiveValue->getValueID() == CSSValueAuto) { 100 if (primitiveValue->getValueID() == CSSValueAuto) {
101 *rotationType = MotionRotationAuto; 101 *rotationType = MotionRotationAuto;
102 } else if (primitiveValue->getValueID() == CSSValueReverse) { 102 } else if (primitiveValue->getValueID() == CSSValueReverse) {
103 *rotationType = MotionRotationAuto; 103 *rotationType = MotionRotationAuto;
104 *rotation += 180; 104 *rotation += 180;
105 } else if (primitiveValue->isAngle() || primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_DEG) { 105 } else if (primitiveValue->isAngle()) {
106 *rotation += primitiveValue->computeDegrees(); 106 *rotation += primitiveValue->computeDegrees();
107 } else { 107 } else {
108 return false; 108 return false;
109 } 109 }
110 } 110 }
111 return true; 111 return true;
112 } 112 }
113 113
114 } // namespace 114 } // namespace
115 115
(...skipping 26 matching lines...) Expand all
142 || startRotationType != endRotationType) 142 || startRotationType != endRotationType)
143 return nullptr; 143 return nullptr;
144 144
145 return adoptRefWillBeNoop(new DoubleStyleInterpolation( 145 return adoptRefWillBeNoop(new DoubleStyleInterpolation(
146 motionRotationToInterpolableValue(start), 146 motionRotationToInterpolableValue(start),
147 motionRotationToInterpolableValue(end), 147 motionRotationToInterpolableValue(end),
148 id, true, InterpolationRange::RangeAll, startRotationType == MotionRotat ionAuto)); 148 id, true, InterpolationRange::RangeAll, startRotationType == MotionRotat ionAuto));
149 } 149 }
150 150
151 } 151 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698