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

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

Issue 1885353004: Add ComputedStyle constructor and getter to InterpolationEnvironment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@_transformInterpolationType
Patch Set: Rebased Created 4 years, 4 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
OLDNEW
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698