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

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

Issue 832873002: Animation: Remove ASSERT_NOT_REACHED from LengthStyleInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 | « Source/core/animation/InterpolableValue.cpp ('k') | 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/LengthStyleInterpolation.h" 6 #include "core/animation/LengthStyleInterpolation.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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 unsigned unitTypeCount = 0; 88 unsigned unitTypeCount = 0;
89 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) { 89 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) {
90 const InterpolableNumber* subType = toInterpolableNumber(listOfTypes->ge t(i)); 90 const InterpolableNumber* subType = toInterpolableNumber(listOfTypes->ge t(i));
91 if (subType->value()) { 91 if (subType->value()) {
92 unitTypeCount++; 92 unitTypeCount++;
93 } 93 }
94 } 94 }
95 95
96 switch (unitTypeCount) { 96 switch (unitTypeCount) {
97 case 0: 97 case 0:
98 ASSERT_NOT_REACHED(); 98 return CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX);
dstockwell 2015/01/04 23:54:16 Shouldn't we leave the ASSERT_NOT_REACHED here?
dstockwell 2015/01/04 23:54:16 Shouldn't we leave the ASSERT_NOT_REACHED here?
evemj (not active) 2015/01/05 02:28:47 Done.
evemj (not active) 2015/01/05 02:28:48 Done.
Eric Willigers 2015/01/05 02:32:22 Doug may have intended the following:- ASSERT_N
evemj (not active) 2015/01/05 04:36:57 Done.
99 case 1: 99 case 1:
100 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) { 100 for (size_t i = 0; i < CSSPrimitiveValue::LengthUnitTypeCount; i++) {
101 const InterpolableNumber *subValueType = toInterpolableNumber(listOf Types->get(i)); 101 const InterpolableNumber *subValueType = toInterpolableNumber(listOf Types->get(i));
102 if (subValueType->value()) { 102 if (subValueType->value()) {
103 double value = toInterpolableNumber(listOfValues->get(i))->value (); 103 double value = toInterpolableNumber(listOfValues->get(i))->value ();
104 if (range == ValueRangeNonNegative && value < 0) 104 if (range == ValueRangeNonNegative && value < 0)
105 value = 0; 105 value = 0;
106 return CSSPrimitiveValue::create(value, toUnitType(i)); 106 return CSSPrimitiveValue::create(value, toUnitType(i));
107 } 107 }
108 } 108 }
109 ASSERT_NOT_REACHED(); 109 ASSERT_NOT_REACHED();
110 default: 110 default:
111 return CSSPrimitiveValue::create(CSSCalcValue::create(constructCalcExpre ssion(nullptr, listOfValuesAndTypes, 0), range)); 111 return CSSPrimitiveValue::create(CSSCalcValue::create(constructCalcExpre ssion(nullptr, listOfValuesAndTypes, 0), range));
112 } 112 }
113 } 113 }
114 114
115 void LengthStyleInterpolation::apply(StyleResolverState& state) const 115 void LengthStyleInterpolation::apply(StyleResolverState& state) const
116 { 116 {
117 StyleBuilder::applyProperty(m_id, state, interpolableValueToLength(m_cachedV alue.get(), m_range).get()); 117 StyleBuilder::applyProperty(m_id, state, interpolableValueToLength(m_cachedV alue.get(), m_range).get());
118 } 118 }
119 119
120 void LengthStyleInterpolation::trace(Visitor* visitor) 120 void LengthStyleInterpolation::trace(Visitor* visitor)
121 { 121 {
122 StyleInterpolation::trace(visitor); 122 StyleInterpolation::trace(visitor);
123 } 123 }
124 124
125 } 125 }
OLDNEW
« no previous file with comments | « Source/core/animation/InterpolableValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698