| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); | 46 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); |
| 47 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); | 47 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); |
| 48 static LengthSize convertRadius(StyleResolverState&, CSSValue*); | 48 static LengthSize convertRadius(StyleResolverState&, CSSValue*); |
| 49 static float convertSpacing(StyleResolverState&, CSSValue*); | 49 static float convertSpacing(StyleResolverState&, CSSValue*); |
| 50 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); | 50 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); |
| 51 }; | 51 }; |
| 52 | 52 |
| 53 template <typename T> | 53 template <typename T> |
| 54 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) | 54 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) |
| 55 { | 55 { |
| 56 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | |
| 57 float zoom = state.style()->effectiveZoom(); | 56 float zoom = state.style()->effectiveZoom(); |
| 58 return primitiveValue->computeLength<T>(state.style(), state.rootElementStyl
e(), zoom); | 57 return toCSSPrimitiveValue(value)->computeLength<T>(state.style(), state.roo
tElementStyle(), zoom); |
| 59 } | 58 } |
| 60 | 59 |
| 61 template <typename T> | 60 template <typename T> |
| 62 T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* v
alue) | 61 T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* v
alue) |
| 63 { | 62 { |
| 64 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 63 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 65 CSSValueID valueID = primitiveValue->getValueID(); | 64 CSSValueID valueID = primitiveValue->getValueID(); |
| 66 if (valueID == CSSValueThin) | 65 if (valueID == CSSValueThin) |
| 67 return 1; | 66 return 1; |
| 68 if (valueID == CSSValueMedium) | 67 if (valueID == CSSValueMedium) |
| (...skipping 21 matching lines...) Expand all Loading... |
| 90 { | 89 { |
| 91 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 90 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
| 92 if (primitiveValue->getValueID() == IdForNone) | 91 if (primitiveValue->getValueID() == IdForNone) |
| 93 return nullAtom; | 92 return nullAtom; |
| 94 return primitiveValue->getStringValue(); | 93 return primitiveValue->getStringValue(); |
| 95 } | 94 } |
| 96 | 95 |
| 97 } // namespace WebCore | 96 } // namespace WebCore |
| 98 | 97 |
| 99 #endif | 98 #endif |
| OLD | NEW |