Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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_EQ(before.isSpecified(), after.isSpecified()); |
|
suzyh_UTC10 (ex-contributor)
2017/02/14 04:38:51
I'm not very familiar with LengthType. I think thi
alancutter (OOO until 2018)
2017/02/14 04:46:12
Good point, added type check back for that case.
| |
| 162 if (before.isSpecified()) { | 162 if (before.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 } | 167 } |
| 168 #endif | 168 #endif |
| 169 return; | 169 return; |
| 170 } | 170 } |
| 171 StyleBuilder::applyProperty(cssProperty(), state, | 171 StyleBuilder::applyProperty(cssProperty(), state, |
| 172 *CSSValue::create(length, zoom)); | 172 *CSSValue::create(length, zoom)); |
| 173 } | 173 } |
| 174 | 174 |
| 175 } // namespace blink | 175 } // namespace blink |
| OLD | NEW |