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

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp

Issue 2697743002: Reduce strictness of length animation DCHECK (Closed)
Patch Set: _dcheckLengthApply Created 3 years, 10 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 | « third_party/WebKit/LayoutTests/animations/length-zero-percent-crash.html ('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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 "core/animation/CSSLengthInterpolationType.h" 5 #include "core/animation/CSSLengthInterpolationType.h"
6 6
7 #include "core/animation/LengthInterpolationFunctions.h" 7 #include "core/animation/LengthInterpolationFunctions.h"
8 #include "core/animation/LengthPropertyFunctions.h" 8 #include "core/animation/LengthPropertyFunctions.h"
9 #include "core/animation/css/CSSAnimatableValueFactory.h" 9 #include "core/animation/css/CSSAnimatableValueFactory.h"
10 #include "core/css/CSSCalculationValue.h" 10 #include "core/css/CSSCalculationValue.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 #if DCHECK_IS_ON() 151 #if DCHECK_IS_ON()
152 // Assert that setting the length on ComputedStyle directly is identical to 152 // Assert that setting the length on ComputedStyle directly is identical to
153 // the StyleBuilder code path. This check is useful for catching differences 153 // the StyleBuilder code path. This check is useful for catching differences
154 // in clamping behaviour. 154 // in clamping behaviour.
155 Length before; 155 Length before;
156 Length after; 156 Length after;
157 DCHECK(LengthPropertyFunctions::getLength(cssProperty(), style, before)); 157 DCHECK(LengthPropertyFunctions::getLength(cssProperty(), style, before));
158 StyleBuilder::applyProperty(cssProperty(), state, 158 StyleBuilder::applyProperty(cssProperty(), state,
159 *CSSValue::create(length, zoom)); 159 *CSSValue::create(length, zoom));
160 DCHECK(LengthPropertyFunctions::getLength(cssProperty(), style, after)); 160 DCHECK(LengthPropertyFunctions::getLength(cssProperty(), style, after));
161 DCHECK_EQ(before.type(), after.type()); 161 DCHECK(before.isSpecified());
162 if (before.isSpecified()) { 162 DCHECK(after.isSpecified());
163 const float kSlack = 0.1; 163 const float kSlack = 0.1;
164 float delta = 164 float delta =
165 floatValueForLength(after, 100) - floatValueForLength(before, 100); 165 floatValueForLength(after, 100) - floatValueForLength(before, 100);
166 DCHECK_LT(std::abs(delta), kSlack); 166 DCHECK_LT(std::abs(delta), kSlack);
167 }
168 #endif 167 #endif
169 return; 168 return;
170 } 169 }
171 StyleBuilder::applyProperty(cssProperty(), state, 170 StyleBuilder::applyProperty(cssProperty(), state,
172 *CSSValue::create(length, zoom)); 171 *CSSValue::create(length, zoom));
173 } 172 }
174 173
175 } // namespace blink 174 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/length-zero-percent-crash.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698