OLD | NEW |
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/animation/css/CSSAnimatableValueFactory.h" | 8 #include "core/animation/css/CSSAnimatableValueFactory.h" |
9 #include "core/css/CSSCalculationValue.h" | 9 #include "core/css/CSSCalculationValue.h" |
10 #include "core/css/resolver/StyleBuilder.h" | 10 #include "core/css/resolver/StyleBuilder.h" |
11 #include "core/css/resolver/StyleResolverState.h" | 11 #include "core/css/resolver/StyleResolverState.h" |
12 #include "platform/CalculationValue.h" | 12 #include "platform/CalculationValue.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 | 15 |
16 namespace { | 16 namespace { |
17 | 17 |
18 bool pixelsForKeyword(CSSPropertyID property, CSSValueID valueID, double& result
) | 18 bool pixelsForKeyword(CSSPropertyID property, CSSValueID valueID, double& result
) |
19 { | 19 { |
20 switch (property) { | 20 switch (property) { |
21 case CSSPropertyBorderBottomWidth: | 21 case CSSPropertyBorderBottomWidth: |
22 case CSSPropertyBorderLeftWidth: | 22 case CSSPropertyBorderLeftWidth: |
23 case CSSPropertyBorderRightWidth: | 23 case CSSPropertyBorderRightWidth: |
24 case CSSPropertyBorderTopWidth: | 24 case CSSPropertyBorderTopWidth: |
25 case CSSPropertyWebkitColumnRuleWidth: | 25 case CSSPropertyColumnRuleWidth: |
26 case CSSPropertyOutlineWidth: | 26 case CSSPropertyOutlineWidth: |
27 if (valueID == CSSValueThin) { | 27 if (valueID == CSSValueThin) { |
28 result = 1; | 28 result = 1; |
29 return true; | 29 return true; |
30 } | 30 } |
31 if (valueID == CSSValueMedium) { | 31 if (valueID == CSSValueMedium) { |
32 result = 3; | 32 result = 3; |
33 return true; | 33 return true; |
34 } | 34 } |
35 if (valueID == CSSValueThick) { | 35 if (valueID == CSSValueThick) { |
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 case CSSPropertyBorderTopWidth: | 202 case CSSPropertyBorderTopWidth: |
203 case CSSPropertyFontSize: | 203 case CSSPropertyFontSize: |
204 case CSSPropertyLetterSpacing: | 204 case CSSPropertyLetterSpacing: |
205 case CSSPropertyOutlineOffset: | 205 case CSSPropertyOutlineOffset: |
206 case CSSPropertyOutlineWidth: | 206 case CSSPropertyOutlineWidth: |
207 case CSSPropertyPerspective: | 207 case CSSPropertyPerspective: |
208 case CSSPropertyStrokeWidth: | 208 case CSSPropertyStrokeWidth: |
209 case CSSPropertyVerticalAlign: | 209 case CSSPropertyVerticalAlign: |
210 case CSSPropertyWebkitBorderHorizontalSpacing: | 210 case CSSPropertyWebkitBorderHorizontalSpacing: |
211 case CSSPropertyWebkitBorderVerticalSpacing: | 211 case CSSPropertyWebkitBorderVerticalSpacing: |
212 case CSSPropertyWebkitColumnGap: | 212 case CSSPropertyColumnGap: |
213 case CSSPropertyWebkitColumnRuleWidth: | 213 case CSSPropertyColumnRuleWidth: |
214 case CSSPropertyWebkitColumnWidth: | 214 case CSSPropertyColumnWidth: |
215 case CSSPropertyWebkitTransformOriginZ: | 215 case CSSPropertyWebkitTransformOriginZ: |
216 case CSSPropertyWordSpacing: | 216 case CSSPropertyWordSpacing: |
217 return nullptr; | 217 return nullptr; |
218 default: | 218 default: |
219 ASSERT_NOT_REACHED(); | 219 ASSERT_NOT_REACHED(); |
220 return nullptr; | 220 return nullptr; |
221 } | 221 } |
222 } | 222 } |
223 | 223 |
224 namespace { | 224 namespace { |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cached
Value, m_range).get()); | 326 StyleBuilder::applyProperty(m_id, state, fromInterpolableValue(*m_cached
Value, m_range).get()); |
327 } | 327 } |
328 } | 328 } |
329 | 329 |
330 DEFINE_TRACE(LengthStyleInterpolation) | 330 DEFINE_TRACE(LengthStyleInterpolation) |
331 { | 331 { |
332 StyleInterpolation::trace(visitor); | 332 StyleInterpolation::trace(visitor); |
333 } | 333 } |
334 | 334 |
335 } | 335 } |
OLD | NEW |