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 15 matching lines...) Expand all Loading... |
26 | 26 |
27 #ifndef StyleBuilderConverter_h | 27 #ifndef StyleBuilderConverter_h |
28 #define StyleBuilderConverter_h | 28 #define StyleBuilderConverter_h |
29 | 29 |
30 #include "core/css/CSSStringValue.h" | 30 #include "core/css/CSSStringValue.h" |
31 #include "core/css/CSSValue.h" | 31 #include "core/css/CSSValue.h" |
32 #include "core/css/CSSValueList.h" | 32 #include "core/css/CSSValueList.h" |
33 #include "core/css/resolver/StyleResolverState.h" | 33 #include "core/css/resolver/StyleResolverState.h" |
34 #include "core/style/QuotesData.h" | 34 #include "core/style/QuotesData.h" |
35 #include "core/style/ShadowList.h" | 35 #include "core/style/ShadowList.h" |
36 #include "core/style/StyleMotionRotation.h" | 36 #include "core/style/StyleOffsetRotation.h" |
37 #include "core/style/StyleReflection.h" | 37 #include "core/style/StyleReflection.h" |
38 #include "core/style/StyleScrollSnapData.h" | 38 #include "core/style/StyleScrollSnapData.h" |
39 #include "core/style/TransformOrigin.h" | 39 #include "core/style/TransformOrigin.h" |
40 #include "platform/LengthSize.h" | 40 #include "platform/LengthSize.h" |
41 #include "platform/fonts/FontDescription.h" | 41 #include "platform/fonts/FontDescription.h" |
42 #include "platform/text/TabSize.h" | 42 #include "platform/text/TabSize.h" |
43 #include "platform/transforms/Rotation.h" | 43 #include "platform/transforms/Rotation.h" |
44 #include "wtf/Allocator.h" | 44 #include "wtf/Allocator.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 static Vector<GridTrackSize> convertGridTrackSizeList(StyleResolverState&, c
onst CSSValue&); | 80 static Vector<GridTrackSize> convertGridTrackSizeList(StyleResolverState&, c
onst CSSValue&); |
81 template <typename T> static T convertLineWidth(StyleResolverState&, const C
SSValue&); | 81 template <typename T> static T convertLineWidth(StyleResolverState&, const C
SSValue&); |
82 static Length convertLength(const StyleResolverState&, const CSSValue&); | 82 static Length convertLength(const StyleResolverState&, const CSSValue&); |
83 static UnzoomedLength convertUnzoomedLength(const StyleResolverState&, const
CSSValue&); | 83 static UnzoomedLength convertUnzoomedLength(const StyleResolverState&, const
CSSValue&); |
84 static Length convertLengthOrAuto(const StyleResolverState&, const CSSValue&
); | 84 static Length convertLengthOrAuto(const StyleResolverState&, const CSSValue&
); |
85 static Length convertLengthSizing(StyleResolverState&, const CSSValue&); | 85 static Length convertLengthSizing(StyleResolverState&, const CSSValue&); |
86 static Length convertLengthMaxSizing(StyleResolverState&, const CSSValue&); | 86 static Length convertLengthMaxSizing(StyleResolverState&, const CSSValue&); |
87 static TabSize convertLengthOrTabSpaces(StyleResolverState&, const CSSValue&
); | 87 static TabSize convertLengthOrTabSpaces(StyleResolverState&, const CSSValue&
); |
88 static Length convertLineHeight(StyleResolverState&, const CSSValue&); | 88 static Length convertLineHeight(StyleResolverState&, const CSSValue&); |
89 static float convertNumberOrPercentage(StyleResolverState&, const CSSValue&)
; | 89 static float convertNumberOrPercentage(StyleResolverState&, const CSSValue&)
; |
90 static StyleMotionRotation convertMotionRotation(StyleResolverState&, const
CSSValue&); | 90 static StyleOffsetRotation convertOffsetRotation(StyleResolverState&, const
CSSValue&); |
91 static LengthPoint convertPosition(StyleResolverState&, const CSSValue&); | 91 static LengthPoint convertPosition(StyleResolverState&, const CSSValue&); |
| 92 static LengthPoint convertPositionOrAuto(StyleResolverState&, const CSSValue
&); |
92 static float convertPerspective(StyleResolverState&, const CSSValue&); | 93 static float convertPerspective(StyleResolverState&, const CSSValue&); |
93 static Length convertQuirkyLength(StyleResolverState&, const CSSValue&); | 94 static Length convertQuirkyLength(StyleResolverState&, const CSSValue&); |
94 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, const CSSVa
lue&); | 95 static PassRefPtr<QuotesData> convertQuotes(StyleResolverState&, const CSSVa
lue&); |
95 static LengthSize convertRadius(StyleResolverState&, const CSSValue&); | 96 static LengthSize convertRadius(StyleResolverState&, const CSSValue&); |
96 static EPaintOrder convertPaintOrder(StyleResolverState&, const CSSValue&); | 97 static EPaintOrder convertPaintOrder(StyleResolverState&, const CSSValue&); |
97 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, const CSSVa
lue&); | 98 static PassRefPtr<ShadowList> convertShadow(StyleResolverState&, const CSSVa
lue&); |
98 static ShapeValue* convertShapeValue(StyleResolverState&, const CSSValue&); | 99 static ShapeValue* convertShapeValue(StyleResolverState&, const CSSValue&); |
99 static float convertSpacing(StyleResolverState&, const CSSValue&); | 100 static float convertSpacing(StyleResolverState&, const CSSValue&); |
100 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, const CSSValue&); | 101 template <CSSValueID IdForNone> static AtomicString convertString(StyleResol
verState&, const CSSValue&); |
101 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&,
const CSSValue&); | 102 static PassRefPtr<SVGDashArray> convertStrokeDasharray(StyleResolverState&,
const CSSValue&); |
102 static StyleColor convertStyleColor(StyleResolverState&, const CSSValue&, bo
ol forVisitedLink = false); | 103 static StyleColor convertStyleColor(StyleResolverState&, const CSSValue&, bo
ol forVisitedLink = false); |
103 static float convertTextStrokeWidth(StyleResolverState&, const CSSValue&); | 104 static float convertTextStrokeWidth(StyleResolverState&, const CSSValue&); |
104 static TextSizeAdjust convertTextSizeAdjust(StyleResolverState&, const CSSVa
lue&); | 105 static TextSizeAdjust convertTextSizeAdjust(StyleResolverState&, const CSSVa
lue&); |
105 static TransformOrigin convertTransformOrigin(StyleResolverState&, const CSS
Value&); | 106 static TransformOrigin convertTransformOrigin(StyleResolverState&, const CSS
Value&); |
106 | 107 |
107 static void convertGridTrackList(const CSSValue&, Vector<GridTrackSize>&, Na
medGridLinesMap&, OrderedNamedGridLines&, | 108 static void convertGridTrackList(const CSSValue&, Vector<GridTrackSize>&, Na
medGridLinesMap&, OrderedNamedGridLines&, |
108 Vector<GridTrackSize>& autoRepeatTrackSizes, NamedGridLinesMap&, Ordered
NamedGridLines&, | 109 Vector<GridTrackSize>& autoRepeatTrackSizes, NamedGridLinesMap&, Ordered
NamedGridLines&, |
109 size_t& autoRepeatInsertionPoint, AutoRepeatType&, StyleResolverState&); | 110 size_t& autoRepeatInsertionPoint, AutoRepeatType&, StyleResolverState&); |
110 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&
, NamedGridLinesMap&, GridTrackSizingDirection); | 111 static void createImplicitNamedGridLinesFromGridArea(const NamedGridAreaMap&
, NamedGridLinesMap&, GridTrackSizingDirection); |
111 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered
NamedGridLines&, NamedGridLinesMap&); | 112 static void convertOrderedNamedGridLinesMapToNamedGridLinesMap(const Ordered
NamedGridLines&, NamedGridLinesMap&); |
112 | 113 |
113 static ScrollSnapPoints convertSnapPoints(StyleResolverState&, const CSSValu
e&); | 114 static ScrollSnapPoints convertSnapPoints(StyleResolverState&, const CSSValu
e&); |
114 static Vector<LengthPoint> convertSnapCoordinates(StyleResolverState&, const
CSSValue&); | 115 static Vector<LengthPoint> convertSnapCoordinates(StyleResolverState&, const
CSSValue&); |
115 static LengthPoint convertSnapDestination(StyleResolverState&, const CSSValu
e&); | 116 static LengthPoint convertSnapDestination(StyleResolverState&, const CSSValu
e&); |
116 static PassRefPtr<TranslateTransformOperation> convertTranslate(StyleResolve
rState&, const CSSValue&); | 117 static PassRefPtr<TranslateTransformOperation> convertTranslate(StyleResolve
rState&, const CSSValue&); |
117 static PassRefPtr<RotateTransformOperation> convertRotate(StyleResolverState
&, const CSSValue&); | 118 static PassRefPtr<RotateTransformOperation> convertRotate(StyleResolverState
&, const CSSValue&); |
118 static PassRefPtr<ScaleTransformOperation> convertScale(StyleResolverState&,
const CSSValue&); | 119 static PassRefPtr<ScaleTransformOperation> convertScale(StyleResolverState&,
const CSSValue&); |
119 static RespectImageOrientationEnum convertImageOrientation(StyleResolverStat
e&, const CSSValue&); | 120 static RespectImageOrientationEnum convertImageOrientation(StyleResolverStat
e&, const CSSValue&); |
120 static PassRefPtr<StylePath> convertPathOrNone(StyleResolverState&, const CS
SValue&); | 121 static PassRefPtr<StylePath> convertPathOrNone(StyleResolverState&, const CS
SValue&); |
121 static StyleMotionRotation convertMotionRotation(const CSSValue&); | 122 static StyleOffsetRotation convertOffsetRotation(const CSSValue&); |
122 template <CSSValueID cssValueFor0, CSSValueID cssValueFor100> static Length
convertPositionLength(StyleResolverState&, const CSSValue&); | 123 template <CSSValueID cssValueFor0, CSSValueID cssValueFor100> static Length
convertPositionLength(StyleResolverState&, const CSSValue&); |
123 static Rotation convertRotation(const CSSValue&); | 124 static Rotation convertRotation(const CSSValue&); |
124 }; | 125 }; |
125 | 126 |
126 template <typename T> | 127 template <typename T> |
127 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, const
CSSValue& value) | 128 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, const
CSSValue& value) |
128 { | 129 { |
129 return toCSSPrimitiveValue(value).computeLength<T>(state.cssToLengthConversi
onData()); | 130 return toCSSPrimitiveValue(value).computeLength<T>(state.cssToLengthConversi
onData()); |
130 } | 131 } |
131 | 132 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 { | 172 { |
172 if (value.isStringValue()) | 173 if (value.isStringValue()) |
173 return AtomicString(toCSSStringValue(value).value()); | 174 return AtomicString(toCSSStringValue(value).value()); |
174 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); | 175 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); |
175 return nullAtom; | 176 return nullAtom; |
176 } | 177 } |
177 | 178 |
178 } // namespace blink | 179 } // namespace blink |
179 | 180 |
180 #endif | 181 #endif |
OLD | NEW |