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 13 matching lines...) Expand all Loading... |
24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 24 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
25 */ | 25 */ |
26 | 26 |
27 #ifndef StyleBuilderConverter_h | 27 #ifndef StyleBuilderConverter_h |
28 #define StyleBuilderConverter_h | 28 #define StyleBuilderConverter_h |
29 | 29 |
30 #include "core/css/CSSValue.h" | 30 #include "core/css/CSSValue.h" |
31 #include "core/css/resolver/StyleResolverState.h" | 31 #include "core/css/resolver/StyleResolverState.h" |
32 #include "core/rendering/RenderView.h" | 32 #include "core/rendering/RenderView.h" |
33 #include "core/rendering/style/ShadowList.h" | 33 #include "core/rendering/style/ShadowList.h" |
| 34 #include "core/rendering/style/StyleNavigationValue.h" |
34 #include "core/svg/SVGLength.h" | 35 #include "core/svg/SVGLength.h" |
35 #include "platform/LengthSize.h" | 36 #include "platform/LengthSize.h" |
36 | 37 |
37 namespace WebCore { | 38 namespace WebCore { |
38 | 39 |
39 // Note that we assume the parser only allows valid CSSValue types. | 40 // Note that we assume the parser only allows valid CSSValue types. |
40 | 41 |
41 class StyleBuilderConverter { | 42 class StyleBuilderConverter { |
42 public: | 43 public: |
43 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); | 44 static AtomicString convertFragmentIdentifier(StyleResolverState&, CSSValue*
); |
44 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); | 45 template <typename T> static T convertComputedLength(StyleResolverState&, CS
SValue*); |
45 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); | 46 template <typename T> static T convertLineWidth(StyleResolverState&, CSSValu
e*); |
46 static Length convertLength(StyleResolverState&, CSSValue*); | 47 static Length convertLength(StyleResolverState&, CSSValue*); |
47 static Length convertLengthOrAuto(StyleResolverState&, CSSValue*); | 48 static Length convertLengthOrAuto(StyleResolverState&, CSSValue*); |
48 static Length convertLengthSizing(StyleResolverState&, CSSValue*); | 49 static Length convertLengthSizing(StyleResolverState&, CSSValue*); |
49 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); | 50 static Length convertLengthMaxSizing(StyleResolverState&, CSSValue*); |
50 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); | 51 static LengthPoint convertLengthPoint(StyleResolverState&, CSSValue*); |
51 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); | 52 static float convertNumberOrPercentage(StyleResolverState&, CSSValue*); |
52 static LengthSize convertRadius(StyleResolverState&, CSSValue*); | 53 static LengthSize convertRadius(StyleResolverState&, CSSValue*); |
53 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); | 54 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, CSSValue*); |
54 static float convertSpacing(StyleResolverState&, CSSValue*); | 55 static float convertSpacing(StyleResolverState&, CSSValue*); |
55 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); | 56 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, CSSValue*); |
56 static PassRefPtr<SVGLength> convertSVGLength(StyleResolverState&, CSSValue*
); | 57 static PassRefPtr<SVGLength> convertSVGLength(StyleResolverState&, CSSValue*
); |
| 58 static StyleNavigationValue convertStyleNavigationValue(StyleResolverState&,
CSSValue*); |
57 }; | 59 }; |
58 | 60 |
59 template <typename T> | 61 template <typename T> |
60 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) | 62 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, CSSVal
ue* value) |
61 { | 63 { |
62 return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConvers
ionData()); | 64 return toCSSPrimitiveValue(value)->computeLength<T>(state.cssToLengthConvers
ionData()); |
63 } | 65 } |
64 | 66 |
65 template <typename T> | 67 template <typename T> |
66 T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* v
alue) | 68 T StyleBuilderConverter::convertLineWidth(StyleResolverState& state, CSSValue* v
alue) |
(...skipping 26 matching lines...) Expand all Loading... |
93 { | 95 { |
94 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); | 96 CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value); |
95 if (primitiveValue->getValueID() == IdForNone) | 97 if (primitiveValue->getValueID() == IdForNone) |
96 return nullAtom; | 98 return nullAtom; |
97 return AtomicString(primitiveValue->getStringValue()); | 99 return AtomicString(primitiveValue->getStringValue()); |
98 } | 100 } |
99 | 101 |
100 } // namespace WebCore | 102 } // namespace WebCore |
101 | 103 |
102 #endif | 104 #endif |
OLD | NEW |