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 <memory> |
7 #include "core/animation/LengthInterpolationFunctions.h" | 8 #include "core/animation/LengthInterpolationFunctions.h" |
8 #include "core/css/CSSIdentifierValue.h" | 9 #include "core/css/CSSIdentifierValue.h" |
9 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
10 #include "platform/LengthFunctions.h" | 11 #include "platform/LengthFunctions.h" |
11 #include "platform/fonts/FontDescription.h" | 12 #include "platform/fonts/FontDescription.h" |
12 #include "wtf/PtrUtil.h" | 13 #include "wtf/PtrUtil.h" |
13 #include <memory> | |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 namespace { | 17 namespace { |
18 | 18 |
19 class IsMonospaceChecker : public InterpolationType::ConversionChecker { | 19 class IsMonospaceChecker : public InterpolationType::ConversionChecker { |
20 public: | 20 public: |
21 static std::unique_ptr<IsMonospaceChecker> create(bool isMonospace) { | 21 static std::unique_ptr<IsMonospaceChecker> create(bool isMonospace) { |
22 return WTF::wrapUnique(new IsMonospaceChecker(isMonospace)); | 22 return WTF::wrapUnique(new IsMonospaceChecker(isMonospace)); |
23 } | 23 } |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 interpolableValue, nullptr, state.fontSizeConversionData(), | 142 interpolableValue, nullptr, state.fontSizeConversionData(), |
143 ValueRangeNonNegative); | 143 ValueRangeNonNegative); |
144 float fontSize = | 144 float fontSize = |
145 floatValueForLength(fontSizeLength, parentFont.getSize().value); | 145 floatValueForLength(fontSizeLength, parentFont.getSize().value); |
146 state.fontBuilder().setSize(FontDescription::Size( | 146 state.fontBuilder().setSize(FontDescription::Size( |
147 0, fontSize, | 147 0, fontSize, |
148 !fontSizeLength.isPercentOrCalc() || parentFont.isAbsoluteSize())); | 148 !fontSizeLength.isPercentOrCalc() || parentFont.isAbsoluteSize())); |
149 } | 149 } |
150 | 150 |
151 } // namespace blink | 151 } // namespace blink |
OLD | NEW |