| 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 796 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 807 | 807 |
| 808 LengthPoint StyleBuilderConverter::convertPosition(StyleResolverState& state, co
nst CSSValue& value) | 808 LengthPoint StyleBuilderConverter::convertPosition(StyleResolverState& state, co
nst CSSValue& value) |
| 809 { | 809 { |
| 810 const CSSValuePair& pair = toCSSValuePair(value); | 810 const CSSValuePair& pair = toCSSValuePair(value); |
| 811 return LengthPoint( | 811 return LengthPoint( |
| 812 convertPositionLength<CSSValueLeft, CSSValueRight>(state, pair.first()), | 812 convertPositionLength<CSSValueLeft, CSSValueRight>(state, pair.first()), |
| 813 convertPositionLength<CSSValueTop, CSSValueBottom>(state, pair.second()) | 813 convertPositionLength<CSSValueTop, CSSValueBottom>(state, pair.second()) |
| 814 ); | 814 ); |
| 815 } | 815 } |
| 816 | 816 |
| 817 LengthPoint StyleBuilderConverter::convertPositionOrAuto(StyleResolverState& sta
te, const CSSValue& value) |
| 818 { |
| 819 if (value.isValuePair()) |
| 820 return convertPosition(state, value); |
| 821 DCHECK(toCSSPrimitiveValue(value).getValueID() == CSSValueAuto); |
| 822 return LengthPoint(Length(Auto), Length(Auto)); |
| 823 } |
| 824 |
| 817 static float convertPerspectiveLength(StyleResolverState& state, const CSSPrimit
iveValue& primitiveValue) | 825 static float convertPerspectiveLength(StyleResolverState& state, const CSSPrimit
iveValue& primitiveValue) |
| 818 { | 826 { |
| 819 return std::max(primitiveValue.computeLength<float>(state.cssToLengthConvers
ionData()), 0.0f); | 827 return std::max(primitiveValue.computeLength<float>(state.cssToLengthConvers
ionData()), 0.0f); |
| 820 } | 828 } |
| 821 | 829 |
| 822 float StyleBuilderConverter::convertPerspective(StyleResolverState& state, const
CSSValue& value) | 830 float StyleBuilderConverter::convertPerspective(StyleResolverState& state, const
CSSValue& value) |
| 823 { | 831 { |
| 824 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 832 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 825 | 833 |
| 826 if (primitiveValue.getValueID() == CSSValueNone) | 834 if (primitiveValue.getValueID() == CSSValueNone) |
| (...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 return nullptr; | 1109 return nullptr; |
| 1102 } | 1110 } |
| 1103 | 1111 |
| 1104 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl
eResolverState& state, const CSSValue& value) | 1112 const CSSValue& StyleBuilderConverter::convertRegisteredPropertyValue(const Styl
eResolverState& state, const CSSValue& value) |
| 1105 { | 1113 { |
| 1106 // TODO(timloh): Resolve ems, etc. | 1114 // TODO(timloh): Resolve ems, etc. |
| 1107 return value; | 1115 return value; |
| 1108 } | 1116 } |
| 1109 | 1117 |
| 1110 } // namespace blink | 1118 } // namespace blink |
| OLD | NEW |