| 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 1593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 return false; | 1604 return false; |
| 1605 // Properties below are validated inside parseViewportProperty, because we | 1605 // Properties below are validated inside parseViewportProperty, because we |
| 1606 // check for parser state. We need to invalidate if someone adds them outsid
e | 1606 // check for parser state. We need to invalidate if someone adds them outsid
e |
| 1607 // a @viewport rule. | 1607 // a @viewport rule. |
| 1608 case CSSPropertyMaxZoom: | 1608 case CSSPropertyMaxZoom: |
| 1609 case CSSPropertyMinZoom: | 1609 case CSSPropertyMinZoom: |
| 1610 case CSSPropertyOrientation: | 1610 case CSSPropertyOrientation: |
| 1611 case CSSPropertyUserZoom: | 1611 case CSSPropertyUserZoom: |
| 1612 validPrimitive = false; | 1612 validPrimitive = false; |
| 1613 break; | 1613 break; |
| 1614 |
| 1615 case CSSPropertyAll: |
| 1616 if (id == CSSValueInitial || id == CSSValueInherit || id == CSSValueUnse
t) { |
| 1617 validPrimitive = true; |
| 1618 break; |
| 1619 } |
| 1620 return false; |
| 1621 |
| 1614 default: | 1622 default: |
| 1615 return parseSVGValue(propId, important); | 1623 return parseSVGValue(propId, important); |
| 1616 } | 1624 } |
| 1617 | 1625 |
| 1618 if (validPrimitive) { | 1626 if (validPrimitive) { |
| 1619 parsedValue = parseValidPrimitive(id, value); | 1627 parsedValue = parseValidPrimitive(id, value); |
| 1620 m_valueList->next(); | 1628 m_valueList->next(); |
| 1621 } | 1629 } |
| 1622 ASSERT(!m_parsedCalculation); | 1630 ASSERT(!m_parsedCalculation); |
| 1623 if (parsedValue) { | 1631 if (parsedValue) { |
| (...skipping 1441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3065 if (value->id == CSSValueRunning || value->id == CSSValuePaused) | 3073 if (value->id == CSSValueRunning || value->id == CSSValuePaused) |
| 3066 return cssValuePool().createIdentifierValue(value->id); | 3074 return cssValuePool().createIdentifierValue(value->id); |
| 3067 return nullptr; | 3075 return nullptr; |
| 3068 } | 3076 } |
| 3069 | 3077 |
| 3070 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty() | 3078 PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseAnimationProperty() |
| 3071 { | 3079 { |
| 3072 CSSParserValue* value = m_valueList->current(); | 3080 CSSParserValue* value = m_valueList->current(); |
| 3073 if (value->unit != CSSPrimitiveValue::CSS_IDENT) | 3081 if (value->unit != CSSPrimitiveValue::CSS_IDENT) |
| 3074 return nullptr; | 3082 return nullptr; |
| 3083 // Since all is valid css property keyword, cssPropertyID for all |
| 3084 // returns non-null value. We need to check "all" before |
| 3085 // cssPropertyID check. |
| 3086 if (equalIgnoringCase(value, "all")) |
| 3087 return cssValuePool().createIdentifierValue(CSSValueAll); |
| 3075 CSSPropertyID result = cssPropertyID(value->string); | 3088 CSSPropertyID result = cssPropertyID(value->string); |
| 3076 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) | 3089 if (result && RuntimeCSSEnabled::isCSSPropertyEnabled(result)) |
| 3077 return cssValuePool().createIdentifierValue(result); | 3090 return cssValuePool().createIdentifierValue(result); |
| 3078 if (equalIgnoringCase(value, "all")) | |
| 3079 return cssValuePool().createIdentifierValue(CSSValueAll); | |
| 3080 if (equalIgnoringCase(value, "none")) | 3091 if (equalIgnoringCase(value, "none")) |
| 3081 return cssValuePool().createIdentifierValue(CSSValueNone); | 3092 return cssValuePool().createIdentifierValue(CSSValueNone); |
| 3082 return nullptr; | 3093 return nullptr; |
| 3083 } | 3094 } |
| 3084 | 3095 |
| 3085 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) | 3096 bool CSSPropertyParser::parseWebkitTransformOriginShorthand(RefPtrWillBeRawPtr<C
SSValue>& value1, RefPtrWillBeRawPtr<CSSValue>& value2, RefPtrWillBeRawPtr<CSSVa
lue>& value3) |
| 3086 { | 3097 { |
| 3087 parse2ValuesFillPosition(m_valueList.get(), value1, value2); | 3098 parse2ValuesFillPosition(m_valueList.get(), value1, value2); |
| 3088 | 3099 |
| 3089 // now get z | 3100 // now get z |
| (...skipping 4080 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7170 expectComma = false; | 7181 expectComma = false; |
| 7171 m_valueList->next(); | 7182 m_valueList->next(); |
| 7172 continue; | 7183 continue; |
| 7173 } | 7184 } |
| 7174 | 7185 |
| 7175 if (currentValue->unit != CSSPrimitiveValue::CSS_IDENT) | 7186 if (currentValue->unit != CSSPrimitiveValue::CSS_IDENT) |
| 7176 return false; | 7187 return false; |
| 7177 | 7188 |
| 7178 CSSPropertyID property = cssPropertyID(currentValue->string); | 7189 CSSPropertyID property = cssPropertyID(currentValue->string); |
| 7179 if (property && RuntimeCSSEnabled::isCSSPropertyEnabled(property)) { | 7190 if (property && RuntimeCSSEnabled::isCSSPropertyEnabled(property)) { |
| 7180 if (property == CSSPropertyWillChange) | 7191 // Now "all" is used by both CSSValue and CSSPropertyValue. |
| 7192 // Need to return false when currentValue is CSSPropertyAll. |
| 7193 if (property == CSSPropertyWillChange || property == CSSPropertyAll) |
| 7181 return false; | 7194 return false; |
| 7182 values->append(cssValuePool().createIdentifierValue(property)); | 7195 values->append(cssValuePool().createIdentifierValue(property)); |
| 7183 } else { | 7196 } else { |
| 7184 switch (currentValue->id) { | 7197 switch (currentValue->id) { |
| 7185 case CSSValueNone: | 7198 case CSSValueNone: |
| 7186 case CSSValueAll: | 7199 case CSSValueAll: |
| 7187 case CSSValueAuto: | 7200 case CSSValueAuto: |
| 7188 case CSSValueDefault: | 7201 case CSSValueDefault: |
| 7189 case CSSValueInitial: | 7202 case CSSValueInitial: |
| 7190 case CSSValueInherit: | 7203 case CSSValueInherit: |
| (...skipping 1226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 8417 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); | 8430 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueFill)); |
| 8418 if (!seenStroke) | 8431 if (!seenStroke) |
| 8419 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); | 8432 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueStroke)
); |
| 8420 if (!seenMarkers) | 8433 if (!seenMarkers) |
| 8421 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); | 8434 parsedValues->append(CSSPrimitiveValue::createIdentifier(CSSValueMarkers
)); |
| 8422 | 8435 |
| 8423 return parsedValues.release(); | 8436 return parsedValues.release(); |
| 8424 } | 8437 } |
| 8425 | 8438 |
| 8426 } // namespace WebCore | 8439 } // namespace WebCore |
| OLD | NEW |