| 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 688 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 699 | 699 |
| 700 float StyleBuilderConverter::convertPerspective(StyleResolverState& state, const
CSSValue& value) | 700 float StyleBuilderConverter::convertPerspective(StyleResolverState& state, const
CSSValue& value) |
| 701 { | 701 { |
| 702 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); | 702 const CSSPrimitiveValue& primitiveValue = toCSSPrimitiveValue(value); |
| 703 | 703 |
| 704 if (primitiveValue.getValueID() == CSSValueNone) | 704 if (primitiveValue.getValueID() == CSSValueNone) |
| 705 return ComputedStyle::initialPerspective(); | 705 return ComputedStyle::initialPerspective(); |
| 706 return convertPerspectiveLength(state, primitiveValue); | 706 return convertPerspectiveLength(state, primitiveValue); |
| 707 } | 707 } |
| 708 | 708 |
| 709 template <CSSValueID cssValueFor0, CSSValueID cssValueFor100> | |
| 710 static Length convertOriginLength(StyleResolverState& state, const CSSPrimitiveV
alue& primitiveValue) | |
| 711 { | |
| 712 if (primitiveValue.isValueID()) { | |
| 713 switch (primitiveValue.getValueID()) { | |
| 714 case cssValueFor0: | |
| 715 return Length(0, Percent); | |
| 716 case cssValueFor100: | |
| 717 return Length(100, Percent); | |
| 718 case CSSValueCenter: | |
| 719 return Length(50, Percent); | |
| 720 default: | |
| 721 ASSERT_NOT_REACHED(); | |
| 722 } | |
| 723 } | |
| 724 | |
| 725 return StyleBuilderConverter::convertLength(state, primitiveValue); | |
| 726 } | |
| 727 | |
| 728 EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, const
CSSValue& cssPaintOrder) | 709 EPaintOrder StyleBuilderConverter::convertPaintOrder(StyleResolverState&, const
CSSValue& cssPaintOrder) |
| 729 { | 710 { |
| 730 if (cssPaintOrder.isValueList()) { | 711 if (cssPaintOrder.isValueList()) { |
| 731 const CSSValueList& orderTypeList = toCSSValueList(cssPaintOrder); | 712 const CSSValueList& orderTypeList = toCSSValueList(cssPaintOrder); |
| 732 switch (toCSSPrimitiveValue(orderTypeList.item(0))->getValueID()) { | 713 switch (toCSSPrimitiveValue(orderTypeList.item(0))->getValueID()) { |
| 733 case CSSValueFill: | 714 case CSSValueFill: |
| 734 return orderTypeList.length() > 1 ? PaintOrderFillMarkersStroke : Pa
intOrderFillStrokeMarkers; | 715 return orderTypeList.length() > 1 ? PaintOrderFillMarkersStroke : Pa
intOrderFillStrokeMarkers; |
| 735 case CSSValueStroke: | 716 case CSSValueStroke: |
| 736 return orderTypeList.length() > 1 ? PaintOrderStrokeMarkersFill : Pa
intOrderStrokeFillMarkers; | 717 return orderTypeList.length() > 1 ? PaintOrderStrokeMarkersFill : Pa
intOrderStrokeFillMarkers; |
| 737 case CSSValueMarkers: | 718 case CSSValueMarkers: |
| (...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 982 | 963 |
| 983 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) | 964 PassRefPtr<StylePath> StyleBuilderConverter::convertPathOrNone(StyleResolverStat
e& state, const CSSValue& value) |
| 984 { | 965 { |
| 985 if (value.isPathValue()) | 966 if (value.isPathValue()) |
| 986 return convertPath(state, value); | 967 return convertPath(state, value); |
| 987 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); | 968 ASSERT(value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() =
= CSSValueNone); |
| 988 return nullptr; | 969 return nullptr; |
| 989 } | 970 } |
| 990 | 971 |
| 991 } // namespace blink | 972 } // namespace blink |
| OLD | NEW |