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

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSFontWeightInterpolationType.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 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/CSSFontWeightInterpolationType.h" 5 #include "core/animation/CSSFontWeightInterpolationType.h"
6 6
7 #include "core/css/CSSPrimitiveValueMappings.h" 7 #include "core/css/CSSPrimitiveValueMappings.h"
8 #include "core/css/resolver/StyleResolverState.h" 8 #include "core/css/resolver/StyleResolverState.h"
9 #include "wtf/PtrUtil.h" 9 #include "wtf/PtrUtil.h"
10 #include <memory> 10 #include <memory>
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 return createFontWeightValue(FontDescription::lighterWeight(inheritedFon tWeight)); 122 return createFontWeightValue(FontDescription::lighterWeight(inheritedFon tWeight));
123 } 123 }
124 124
125 default: 125 default:
126 return createFontWeightValue(primitiveValue.convertTo<FontWeight>()); 126 return createFontWeightValue(primitiveValue.convertTo<FontWeight>());
127 } 127 }
128 } 128 }
129 129
130 InterpolationValue CSSFontWeightInterpolationType::maybeConvertUnderlyingValue(c onst InterpolationEnvironment& environment) const 130 InterpolationValue CSSFontWeightInterpolationType::maybeConvertUnderlyingValue(c onst InterpolationEnvironment& environment) const
131 { 131 {
132 return createFontWeightValue(environment.state().style()->fontWeight()); 132 return createFontWeightValue(environment.style().fontWeight());
133 } 133 }
134 134
135 void CSSFontWeightInterpolationType::apply(const InterpolableValue& interpolable Value, const NonInterpolableValue*, InterpolationEnvironment& environment) const 135 void CSSFontWeightInterpolationType::apply(const InterpolableValue& interpolable Value, const NonInterpolableValue*, InterpolationEnvironment& environment) const
136 { 136 {
137 environment.state().fontBuilder().setWeight(doubleToFontWeight(toInterpolabl eNumber(interpolableValue).value())); 137 environment.state().fontBuilder().setWeight(doubleToFontWeight(toInterpolabl eNumber(interpolableValue).value()));
138 } 138 }
139 139
140 } // namespace blink 140 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698