OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/CSSFontSizeInterpolationType.h" | 5 #include "core/animation/CSSFontSizeInterpolationType.h" |
6 | 6 |
7 #include "core/animation/CSSLengthInterpolationType.h" | 7 #include "core/animation/CSSLengthInterpolationType.h" |
8 #include "core/css/CSSPrimitiveValue.h" | 8 #include "core/css/CSSPrimitiveValue.h" |
9 #include "core/css/resolver/StyleResolverState.h" | 9 #include "core/css/resolver/StyleResolverState.h" |
10 #include "platform/LengthFunctions.h" | 10 #include "platform/LengthFunctions.h" |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 return InterpolationValue(std::move(result)); | 104 return InterpolationValue(std::move(result)); |
105 | 105 |
106 if (!value.isPrimitiveValue() || !toCSSPrimitiveValue(value).isValueID()) | 106 if (!value.isPrimitiveValue() || !toCSSPrimitiveValue(value).isValueID()) |
107 return nullptr; | 107 return nullptr; |
108 | 108 |
109 return maybeConvertKeyword(toCSSPrimitiveValue(value).getValueID(), state, c
onversionCheckers); | 109 return maybeConvertKeyword(toCSSPrimitiveValue(value).getValueID(), state, c
onversionCheckers); |
110 } | 110 } |
111 | 111 |
112 InterpolationValue CSSFontSizeInterpolationType::maybeConvertUnderlyingValue(con
st InterpolationEnvironment& environment) const | 112 InterpolationValue CSSFontSizeInterpolationType::maybeConvertUnderlyingValue(con
st InterpolationEnvironment& environment) const |
113 { | 113 { |
114 return convertFontSize(environment.state().style()->specifiedFontSize()); | 114 return convertFontSize(environment.style().specifiedFontSize()); |
115 } | 115 } |
116 | 116 |
117 void CSSFontSizeInterpolationType::apply(const InterpolableValue& interpolableVa
lue, const NonInterpolableValue*, InterpolationEnvironment& environment) const | 117 void CSSFontSizeInterpolationType::apply(const InterpolableValue& interpolableVa
lue, const NonInterpolableValue*, InterpolationEnvironment& environment) const |
118 { | 118 { |
119 const FontDescription& parentFont = environment.state().parentFontDescriptio
n(); | 119 const FontDescription& parentFont = environment.state().parentFontDescriptio
n(); |
120 Length fontSizeLength = CSSLengthInterpolationType::resolveInterpolableLengt
h(interpolableValue, nullptr, environment.state().fontSizeConversionData(), Valu
eRangeNonNegative); | 120 Length fontSizeLength = CSSLengthInterpolationType::resolveInterpolableLengt
h(interpolableValue, nullptr, environment.state().fontSizeConversionData(), Valu
eRangeNonNegative); |
121 float fontSize = floatValueForLength(fontSizeLength, parentFont.getSize().va
lue); | 121 float fontSize = floatValueForLength(fontSizeLength, parentFont.getSize().va
lue); |
122 environment.state().fontBuilder().setSize(FontDescription::Size(0, fontSize,
!fontSizeLength.hasPercent() || parentFont.isAbsoluteSize())); | 122 environment.state().fontBuilder().setSize(FontDescription::Size(0, fontSize,
!fontSizeLength.hasPercent() || parentFont.isAbsoluteSize())); |
123 } | 123 } |
124 | 124 |
125 } // namespace blink | 125 } // namespace blink |
OLD | NEW |