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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 float em = state.parentStyle()->specifiedFontSize(); | 192 float em = state.parentStyle()->specifiedFontSize(); |
193 float rem = state.rootElementStyle() ? state.rootElementStyle()->specifiedFo
ntSize() : 1.0f; | 193 float rem = state.rootElementStyle() ? state.rootElementStyle()->specifiedFo
ntSize() : 1.0f; |
194 CSSToLengthConversionData::FontSizes fontSizes(em, rem, &state.parentStyle()
->font()); | 194 CSSToLengthConversionData::FontSizes fontSizes(em, rem, &state.parentStyle()
->font()); |
195 CSSToLengthConversionData::ViewportSize viewportSize(state.document().layout
View()); | 195 CSSToLengthConversionData::ViewportSize viewportSize(state.document().layout
View()); |
196 | 196 |
197 CSSToLengthConversionData conversionData(state.style(), fontSizes, viewportS
ize, 1.0f); | 197 CSSToLengthConversionData conversionData(state.style(), fontSizes, viewportS
ize, 1.0f); |
198 if (primitiveValue->isLength()) | 198 if (primitiveValue->isLength()) |
199 return primitiveValue->computeLength<float>(conversionData); | 199 return primitiveValue->computeLength<float>(conversionData); |
200 if (primitiveValue->isCalculatedPercentageWithLength()) | 200 if (primitiveValue->isCalculatedPercentageWithLength()) |
201 return primitiveValue->cssCalcValue()->toCalcValue(conversionData)->eval
uate(parentSize.value); | 201 return primitiveValue->cssCalcValue()->toCalcValue(conversionData)->eval
uate(parentSize.value); |
| 202 if (primitiveValue->isNumber()) |
| 203 return primitiveValue->getFloatValue(); |
202 | 204 |
203 ASSERT_NOT_REACHED(); | 205 ASSERT_NOT_REACHED(); |
204 return 0; | 206 return 0; |
205 } | 207 } |
206 | 208 |
207 FontDescription::Size StyleBuilderConverter::convertFontSize(StyleResolverState&
state, CSSValue* value) | 209 FontDescription::Size StyleBuilderConverter::convertFontSize(StyleResolverState&
state, CSSValue* value) |
208 { | 210 { |
209 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 211 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
210 | 212 |
211 FontDescription::Size parentSize(0, 0.0f, false); | 213 FontDescription::Size parentSize(0, 0.0f, false); |
(...skipping 683 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
895 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); | 897 CSSPrimitiveValue* primitiveValueZ = toCSSPrimitiveValue(list->item(2)); |
896 | 898 |
897 return TransformOrigin( | 899 return TransformOrigin( |
898 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX)
, | 900 convertOriginLength<CSSValueLeft, CSSValueRight>(state, primitiveValueX)
, |
899 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY)
, | 901 convertOriginLength<CSSValueTop, CSSValueBottom>(state, primitiveValueY)
, |
900 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu
eZ) | 902 StyleBuilderConverter::convertComputedLength<float>(state, primitiveValu
eZ) |
901 ); | 903 ); |
902 } | 904 } |
903 | 905 |
904 } // namespace blink | 906 } // namespace blink |
OLD | NEW |