OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2003 Lars Knoll (knoll@kde.org) |
3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. | 4 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc.
All rights reserved. |
5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> | 5 * Copyright (C) 2007 Nicholas Shanks <webkit@nickshanks.com> |
6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> | 6 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> |
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) | 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo
bile.com/) |
8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. | 8 * Copyright (C) 2012 Adobe Systems Incorporated. All rights reserved. |
9 * Copyright (C) 2012 Intel Corporation. All rights reserved. | 9 * Copyright (C) 2012 Intel Corporation. All rights reserved. |
10 * | 10 * |
(...skipping 1116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1127 if (parseTransformOrigin(propId, propId1, propId2, propId3, val1, val2,
val3)) { | 1127 if (parseTransformOrigin(propId, propId1, propId2, propId3, val1, val2,
val3)) { |
1128 addProperty(propId1, val1.release(), important); | 1128 addProperty(propId1, val1.release(), important); |
1129 if (val2) | 1129 if (val2) |
1130 addProperty(propId2, val2.release(), important); | 1130 addProperty(propId2, val2.release(), important); |
1131 if (val3) | 1131 if (val3) |
1132 addProperty(propId3, val3.release(), important); | 1132 addProperty(propId3, val3.release(), important); |
1133 return true; | 1133 return true; |
1134 } | 1134 } |
1135 return false; | 1135 return false; |
1136 } | 1136 } |
| 1137 case CSSPropertyPerspective: |
| 1138 if (id == CSSValueNone) { |
| 1139 validPrimitive = true; |
| 1140 } else if (validUnit(value, FLength | FNonNeg)) { |
| 1141 addProperty(propId, createPrimitiveNumericValue(value), important); |
| 1142 return true; |
| 1143 } |
| 1144 break; |
1137 case CSSPropertyWebkitPerspective: | 1145 case CSSPropertyWebkitPerspective: |
1138 if (id == CSSValueNone) | 1146 if (id == CSSValueNone) { |
1139 validPrimitive = true; | 1147 validPrimitive = true; |
1140 else { | 1148 } else if (validUnit(value, FNumber | FLength | FNonNeg)) { |
1141 // Accepting valueless numbers is a quirk of the -webkit prefixed ve
rsion of the property. | 1149 // Accepting valueless numbers is a quirk of the -webkit prefixed ve
rsion of the property. |
1142 if (validUnit(value, FNumber | FLength | FNonNeg)) { | 1150 addProperty(propId, createPrimitiveNumericValue(value), important); |
1143 RefPtrWillBeRawPtr<CSSValue> val = createPrimitiveNumericValue(v
alue); | 1151 return true; |
1144 if (val) { | |
1145 addProperty(propId, val.release(), important); | |
1146 return true; | |
1147 } | |
1148 return false; | |
1149 } | |
1150 } | 1152 } |
1151 break; | 1153 break; |
1152 case CSSPropertyWebkitPerspectiveOrigin: | 1154 case CSSPropertyWebkitPerspectiveOrigin: |
1153 case CSSPropertyWebkitPerspectiveOriginX: | 1155 case CSSPropertyWebkitPerspectiveOriginX: |
1154 case CSSPropertyWebkitPerspectiveOriginY: { | 1156 case CSSPropertyWebkitPerspectiveOriginY: { |
1155 RefPtrWillBeRawPtr<CSSValue> val1 = nullptr; | 1157 RefPtrWillBeRawPtr<CSSValue> val1 = nullptr; |
1156 RefPtrWillBeRawPtr<CSSValue> val2 = nullptr; | 1158 RefPtrWillBeRawPtr<CSSValue> val2 = nullptr; |
1157 CSSPropertyID propId1, propId2; | 1159 CSSPropertyID propId1, propId2; |
1158 if (parsePerspectiveOrigin(propId, propId1, propId2, val1, val2)) { | 1160 if (parsePerspectiveOrigin(propId, propId1, propId2, val1, val2)) { |
1159 addProperty(propId1, val1.release(), important); | 1161 addProperty(propId1, val1.release(), important); |
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1608 // Properties below are validated inside parseViewportProperty, because we | 1610 // Properties below are validated inside parseViewportProperty, because we |
1609 // check for parser state. We need to invalidate if someone adds them outsid
e | 1611 // check for parser state. We need to invalidate if someone adds them outsid
e |
1610 // a @viewport rule. | 1612 // a @viewport rule. |
1611 case CSSPropertyMaxZoom: | 1613 case CSSPropertyMaxZoom: |
1612 case CSSPropertyMinZoom: | 1614 case CSSPropertyMinZoom: |
1613 case CSSPropertyOrientation: | 1615 case CSSPropertyOrientation: |
1614 case CSSPropertyUserZoom: | 1616 case CSSPropertyUserZoom: |
1615 validPrimitive = false; | 1617 validPrimitive = false; |
1616 break; | 1618 break; |
1617 // FIXME: crbug.com/154772 Unimplemented css-transforms properties | 1619 // FIXME: crbug.com/154772 Unimplemented css-transforms properties |
1618 case CSSPropertyPerspective: | |
1619 case CSSPropertyPerspectiveOrigin: | 1620 case CSSPropertyPerspectiveOrigin: |
1620 case CSSPropertyTransform: | 1621 case CSSPropertyTransform: |
1621 case CSSPropertyTransformOrigin: | 1622 case CSSPropertyTransformOrigin: |
1622 return false; | 1623 return false; |
1623 default: | 1624 default: |
1624 return parseSVGValue(propId, important); | 1625 return parseSVGValue(propId, important); |
1625 } | 1626 } |
1626 | 1627 |
1627 if (validPrimitive) { | 1628 if (validPrimitive) { |
1628 parsedValue = parseValidPrimitive(id, value); | 1629 parsedValue = parseValidPrimitive(id, value); |
(...skipping 6616 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
8245 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8246 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
8246 if (!seenStroke) | 8247 if (!seenStroke) |
8247 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8248 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
8248 if (!seenMarkers) | 8249 if (!seenMarkers) |
8249 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8250 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
8250 | 8251 |
8251 return parsedValues.release(); | 8252 return parsedValues.release(); |
8252 } | 8253 } |
8253 | 8254 |
8254 } // namespace WebCore | 8255 } // namespace WebCore |
OLD | NEW |