| 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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 static ScrollSnapPoints convertSnapPoints(StyleResolverState&, const CSSValu
e&); | 103 static ScrollSnapPoints convertSnapPoints(StyleResolverState&, const CSSValu
e&); |
| 104 static Vector<LengthPoint> convertSnapCoordinates(StyleResolverState&, const
CSSValue&); | 104 static Vector<LengthPoint> convertSnapCoordinates(StyleResolverState&, const
CSSValue&); |
| 105 static LengthPoint convertSnapDestination(StyleResolverState&, const CSSValu
e&); | 105 static LengthPoint convertSnapDestination(StyleResolverState&, const CSSValu
e&); |
| 106 static PassRefPtr<TranslateTransformOperation> convertTranslate(StyleResolve
rState&, const CSSValue&); | 106 static PassRefPtr<TranslateTransformOperation> convertTranslate(StyleResolve
rState&, const CSSValue&); |
| 107 static PassRefPtr<RotateTransformOperation> convertRotate(StyleResolverState
&, const CSSValue&); | 107 static PassRefPtr<RotateTransformOperation> convertRotate(StyleResolverState
&, const CSSValue&); |
| 108 static PassRefPtr<ScaleTransformOperation> convertScale(StyleResolverState&,
const CSSValue&); | 108 static PassRefPtr<ScaleTransformOperation> convertScale(StyleResolverState&,
const CSSValue&); |
| 109 static RespectImageOrientationEnum convertImageOrientation(StyleResolverStat
e&, const CSSValue&); | 109 static RespectImageOrientationEnum convertImageOrientation(StyleResolverStat
e&, const CSSValue&); |
| 110 static PassRefPtr<StylePath> convertPath(StyleResolverState&, const CSSValue
&); | 110 static PassRefPtr<StylePath> convertPath(StyleResolverState&, const CSSValue
&); |
| 111 static PassRefPtr<StylePath> convertPathOrNone(StyleResolverState&, const CS
SValue&); | 111 static PassRefPtr<StylePath> convertPathOrNone(StyleResolverState&, const CS
SValue&); |
| 112 static StyleMotionRotation convertMotionRotation(const CSSValue&); | 112 static StyleMotionRotation convertMotionRotation(const CSSValue&); |
| 113 template <CSSValueID cssValueFor0, CSSValueID cssValueFor100> static Length
convertOriginLength(StyleResolverState&, const CSSPrimitiveValue&); |
| 113 }; | 114 }; |
| 114 | 115 |
| 115 template <typename T> | 116 template <typename T> |
| 116 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, const
CSSValue& value) | 117 T StyleBuilderConverter::convertComputedLength(StyleResolverState& state, const
CSSValue& value) |
| 117 { | 118 { |
| 118 return toCSSPrimitiveValue(value).computeLength<T>(state.cssToLengthConversi
onData()); | 119 return toCSSPrimitiveValue(value).computeLength<T>(state.cssToLengthConversi
onData()); |
| 119 } | 120 } |
| 120 | 121 |
| 121 template <typename T> | 122 template <typename T> |
| 122 T StyleBuilderConverter::convertFlags(StyleResolverState& state, const CSSValue&
value) | 123 T StyleBuilderConverter::convertFlags(StyleResolverState& state, const CSSValue&
value) |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 | 158 |
| 158 template <CSSValueID IdForNone> | 159 template <CSSValueID IdForNone> |
| 159 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS
Value& value) | 160 AtomicString StyleBuilderConverter::convertString(StyleResolverState&, const CSS
Value& value) |
| 160 { | 161 { |
| 161 if (value.isStringValue()) | 162 if (value.isStringValue()) |
| 162 return AtomicString(toCSSStringValue(value).value()); | 163 return AtomicString(toCSSStringValue(value).value()); |
| 163 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); | 164 ASSERT(toCSSPrimitiveValue(value).getValueID() == IdForNone); |
| 164 return nullAtom; | 165 return nullAtom; |
| 165 } | 166 } |
| 166 | 167 |
| 168 template <CSSValueID cssValueFor0, CSSValueID cssValueFor100> |
| 169 Length StyleBuilderConverter::convertOriginLength(StyleResolverState& state, con
st CSSPrimitiveValue& primitiveValue) |
| 170 { |
| 171 if (primitiveValue.isValueID()) { |
| 172 switch (primitiveValue.getValueID()) { |
| 173 case cssValueFor0: |
| 174 return Length(0, Percent); |
| 175 case cssValueFor100: |
| 176 return Length(100, Percent); |
| 177 case CSSValueCenter: |
| 178 return Length(50, Percent); |
| 179 default: |
| 180 ASSERT_NOT_REACHED(); |
| 181 } |
| 182 } |
| 183 |
| 184 return StyleBuilderConverter::convertLength(state, primitiveValue); |
| 185 } |
| 186 |
| 167 } // namespace blink | 187 } // namespace blink |
| 168 | 188 |
| 169 #endif | 189 #endif |
| OLD | NEW |