OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
3 * | 3 * |
4 * * Redistributions of source code must retain the above copyright | 4 * * Redistributions of source code must retain the above copyright |
5 * notice, this list of conditions and the following disclaimer. | 5 * notice, this list of conditions and the following disclaimer. |
6 * * Redistributions in binary form must reproduce the above | 6 * * Redistributions in binary form must reproduce the above |
7 * copyright notice, this list of conditions and the following disclaimer | 7 * copyright notice, this list of conditions and the following disclaimer |
8 * in the documentation and/or other materials provided with the | 8 * in the documentation and/or other materials provided with the |
9 * distribution. | 9 * distribution. |
10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 float em = state.parentStyle()->specifiedFontSize(); | 203 float em = state.parentStyle()->specifiedFontSize(); |
204 float rem = state.rootElementStyle() ? state.rootElementStyle()->specifiedFo ntSize() : 1.0f; | 204 float rem = state.rootElementStyle() ? state.rootElementStyle()->specifiedFo ntSize() : 1.0f; |
205 CSSToLengthConversionData::FontSizes fontSizes(em, rem, &state.parentStyle() ->font()); | 205 CSSToLengthConversionData::FontSizes fontSizes(em, rem, &state.parentStyle() ->font()); |
206 CSSToLengthConversionData::ViewportSize viewportSize(state.document().layout View()); | 206 CSSToLengthConversionData::ViewportSize viewportSize(state.document().layout View()); |
207 | 207 |
208 CSSToLengthConversionData conversionData(state.style(), fontSizes, viewportS ize, 1.0f); | 208 CSSToLengthConversionData conversionData(state.style(), fontSizes, viewportS ize, 1.0f); |
209 if (primitiveValue.isLength()) | 209 if (primitiveValue.isLength()) |
210 return primitiveValue.computeLength<float>(conversionData); | 210 return primitiveValue.computeLength<float>(conversionData); |
211 if (primitiveValue.isCalculatedPercentageWithLength()) | 211 if (primitiveValue.isCalculatedPercentageWithLength()) |
212 return primitiveValue.cssCalcValue()->toCalcValue(conversionData)->evalu ate(parentSize.value); | 212 return primitiveValue.cssCalcValue()->toCalcValue(conversionData)->evalu ate(parentSize.value); |
213 if (primitiveValue.isNumber()) | |
Timothy Loh
2015/11/04 00:33:44
Don't think this is needed, probably left in from
Stephen Chennney
2015/11/04 18:04:47
Done.
| |
214 return primitiveValue.getFloatValue(); | |
213 | 215 |
214 ASSERT_NOT_REACHED(); | 216 ASSERT_NOT_REACHED(); |
215 return 0; | 217 return 0; |
216 } | 218 } |
217 | 219 |
218 FontDescription::Size StyleBuilderConverter::convertFontSize(StyleResolverState& state, const CSSValue& value) | 220 FontDescription::Size StyleBuilderConverter::convertFontSize(StyleResolverState& state, const CSSValue& value) |
219 { | 221 { |
220 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 222 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
221 | 223 |
222 FontDescription::Size parentSize(0, 0.0f, false); | 224 FontDescription::Size parentSize(0, 0.0f, false); |
(...skipping 724 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
947 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); | 949 return ScaleTransformOperation::create(sx, sy, sz, TransformOperation::Scale 3D); |
948 } | 950 } |
949 | 951 |
950 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, const CSSValue& value) | 952 RespectImageOrientationEnum StyleBuilderConverter::convertImageOrientation(Style ResolverState& state, const CSSValue& value) |
951 { | 953 { |
952 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 954 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
953 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation; | 955 return primitiveValue.getValueID() == CSSValueFromImage ? RespectImageOrient ation : DoNotRespectImageOrientation; |
954 } | 956 } |
955 | 957 |
956 } // namespace blink | 958 } // namespace blink |
OLD | NEW |