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 603 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
614 return true; | 614 return true; |
615 break; | 615 break; |
616 case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision | 616 case CSSPropertyTextRendering: // auto | optimizeSpeed | optimizeLegibility | geometricPrecision |
617 if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || value ID == CSSValueOptimizelegibility || valueID == CSSValueGeometricprecision) | 617 if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || value ID == CSSValueOptimizelegibility || valueID == CSSValueGeometricprecision) |
618 return true; | 618 return true; |
619 break; | 619 break; |
620 case CSSPropertyTextTransform: // capitalize | uppercase | lowercase | none | inherit | 620 case CSSPropertyTextTransform: // capitalize | uppercase | lowercase | none | inherit |
621 if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || v alueID == CSSValueNone) | 621 if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || v alueID == CSSValueNone) |
622 return true; | 622 return true; |
623 break; | 623 break; |
624 case CSSPropertyTouchAction: // auto | none | |
625 if (RuntimeEnabledFeatures::cssTouchActionEnabled() && (valueID == CSSVa lueAuto || valueID == CSSValueNone)) | |
626 return true; | |
627 break; | |
628 case CSSPropertyTouchActionDelay: // none | script | 624 case CSSPropertyTouchActionDelay: // none | script |
629 if (RuntimeEnabledFeatures::cssTouchActionEnabled() && (valueID == CSSVa lueScript || valueID == CSSValueNone)) | 625 if (RuntimeEnabledFeatures::cssTouchActionEnabled() && (valueID == CSSVa lueScript || valueID == CSSValueNone)) |
630 return true; | 626 return true; |
631 break; | 627 break; |
632 case CSSPropertyVisibility: // visible | hidden | collapse | inherit | 628 case CSSPropertyVisibility: // visible | hidden | collapse | inherit |
633 if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID = = CSSValueCollapse) | 629 if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID = = CSSValueCollapse) |
634 return true; | 630 return true; |
635 break; | 631 break; |
636 case CSSPropertyWebkitAppearance: | 632 case CSSPropertyWebkitAppearance: |
637 if ((valueID >= CSSValueCheckbox && valueID <= CSSValueTextarea) || valu eID == CSSValueNone) | 633 if ((valueID >= CSSValueCheckbox && valueID <= CSSValueTextarea) || valu eID == CSSValueNone) |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
875 case CSSPropertyTextJustify: | 871 case CSSPropertyTextJustify: |
876 case CSSPropertyTextLineThroughMode: | 872 case CSSPropertyTextLineThroughMode: |
877 case CSSPropertyTextLineThroughStyle: | 873 case CSSPropertyTextLineThroughStyle: |
878 case CSSPropertyTextOverflow: | 874 case CSSPropertyTextOverflow: |
879 case CSSPropertyTextOverlineMode: | 875 case CSSPropertyTextOverlineMode: |
880 case CSSPropertyTextOverlineStyle: | 876 case CSSPropertyTextOverlineStyle: |
881 case CSSPropertyTextRendering: | 877 case CSSPropertyTextRendering: |
882 case CSSPropertyTextTransform: | 878 case CSSPropertyTextTransform: |
883 case CSSPropertyTextUnderlineMode: | 879 case CSSPropertyTextUnderlineMode: |
884 case CSSPropertyTextUnderlineStyle: | 880 case CSSPropertyTextUnderlineStyle: |
885 case CSSPropertyTouchAction: | |
886 case CSSPropertyTouchActionDelay: | 881 case CSSPropertyTouchActionDelay: |
887 case CSSPropertyVisibility: | 882 case CSSPropertyVisibility: |
888 case CSSPropertyWebkitAppearance: | 883 case CSSPropertyWebkitAppearance: |
889 case CSSPropertyWebkitBackfaceVisibility: | 884 case CSSPropertyWebkitBackfaceVisibility: |
890 case CSSPropertyWebkitBorderAfterStyle: | 885 case CSSPropertyWebkitBorderAfterStyle: |
891 case CSSPropertyWebkitBorderBeforeStyle: | 886 case CSSPropertyWebkitBorderBeforeStyle: |
892 case CSSPropertyWebkitBorderEndStyle: | 887 case CSSPropertyWebkitBorderEndStyle: |
893 case CSSPropertyWebkitBorderFit: | 888 case CSSPropertyWebkitBorderFit: |
894 case CSSPropertyWebkitBorderStartStyle: | 889 case CSSPropertyWebkitBorderStartStyle: |
895 case CSSPropertyWebkitBoxAlign: | 890 case CSSPropertyWebkitBoxAlign: |
(...skipping 1803 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2699 m_valueList->next(); | 2694 m_valueList->next(); |
2700 } | 2695 } |
2701 break; | 2696 break; |
2702 case CSSPropertyShapeMargin: | 2697 case CSSPropertyShapeMargin: |
2703 case CSSPropertyShapePadding: | 2698 case CSSPropertyShapePadding: |
2704 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FLength | FNonNeg)); | 2699 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FLength | FNonNeg)); |
2705 break; | 2700 break; |
2706 case CSSPropertyShapeImageThreshold: | 2701 case CSSPropertyShapeImageThreshold: |
2707 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FNumber)); | 2702 validPrimitive = (RuntimeEnabledFeatures::cssShapesEnabled() && !id && v alidUnit(value, FNumber)); |
2708 break; | 2703 break; |
2704 | |
2705 case CSSPropertyTouchAction: | |
2706 // auto | none | [panX || panY] | |
Rick Byers
2013/12/12 15:30:35
still need to correct 'panX' to 'pan-x' etc.
gnana
2013/12/13 11:10:54
Done.
:-)
| |
2707 return parseTouchAction(propId, important); | |
2708 | |
2709 case CSSPropertyBorderBottomStyle: | 2709 case CSSPropertyBorderBottomStyle: |
2710 case CSSPropertyBorderCollapse: | 2710 case CSSPropertyBorderCollapse: |
2711 case CSSPropertyBorderLeftStyle: | 2711 case CSSPropertyBorderLeftStyle: |
2712 case CSSPropertyBorderRightStyle: | 2712 case CSSPropertyBorderRightStyle: |
2713 case CSSPropertyBorderTopStyle: | 2713 case CSSPropertyBorderTopStyle: |
2714 case CSSPropertyBoxSizing: | 2714 case CSSPropertyBoxSizing: |
2715 case CSSPropertyCaptionSide: | 2715 case CSSPropertyCaptionSide: |
2716 case CSSPropertyClear: | 2716 case CSSPropertyClear: |
2717 case CSSPropertyDirection: | 2717 case CSSPropertyDirection: |
2718 case CSSPropertyDisplay: | 2718 case CSSPropertyDisplay: |
(...skipping 20 matching lines...) Expand all Loading... | |
2739 case CSSPropertyTextJustify: | 2739 case CSSPropertyTextJustify: |
2740 case CSSPropertyTextLineThroughMode: | 2740 case CSSPropertyTextLineThroughMode: |
2741 case CSSPropertyTextLineThroughStyle: | 2741 case CSSPropertyTextLineThroughStyle: |
2742 case CSSPropertyTextOverflow: | 2742 case CSSPropertyTextOverflow: |
2743 case CSSPropertyTextOverlineMode: | 2743 case CSSPropertyTextOverlineMode: |
2744 case CSSPropertyTextOverlineStyle: | 2744 case CSSPropertyTextOverlineStyle: |
2745 case CSSPropertyTextRendering: | 2745 case CSSPropertyTextRendering: |
2746 case CSSPropertyTextTransform: | 2746 case CSSPropertyTextTransform: |
2747 case CSSPropertyTextUnderlineMode: | 2747 case CSSPropertyTextUnderlineMode: |
2748 case CSSPropertyTextUnderlineStyle: | 2748 case CSSPropertyTextUnderlineStyle: |
2749 case CSSPropertyTouchAction: | |
2750 case CSSPropertyTouchActionDelay: | 2749 case CSSPropertyTouchActionDelay: |
2751 case CSSPropertyVariable: | 2750 case CSSPropertyVariable: |
2752 case CSSPropertyVisibility: | 2751 case CSSPropertyVisibility: |
2753 case CSSPropertyWebkitAppearance: | 2752 case CSSPropertyWebkitAppearance: |
2754 case CSSPropertyWebkitBackfaceVisibility: | 2753 case CSSPropertyWebkitBackfaceVisibility: |
2755 case CSSPropertyWebkitBorderAfterStyle: | 2754 case CSSPropertyWebkitBorderAfterStyle: |
2756 case CSSPropertyWebkitBorderBeforeStyle: | 2755 case CSSPropertyWebkitBorderBeforeStyle: |
2757 case CSSPropertyWebkitBorderEndStyle: | 2756 case CSSPropertyWebkitBorderEndStyle: |
2758 case CSSPropertyWebkitBorderFit: | 2757 case CSSPropertyWebkitBorderFit: |
2759 case CSSPropertyWebkitBorderStartStyle: | 2758 case CSSPropertyWebkitBorderStartStyle: |
(...skipping 6247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
9007 break; | 9006 break; |
9008 } | 9007 } |
9009 default: | 9008 default: |
9010 ASSERT_NOT_REACHED(); | 9009 ASSERT_NOT_REACHED(); |
9011 return false; | 9010 return false; |
9012 } | 9011 } |
9013 | 9012 |
9014 return value; | 9013 return value; |
9015 } | 9014 } |
9016 | 9015 |
9016 bool CSSParser::parseTouchAction(CSSPropertyID propId, bool important) | |
9017 { | |
9018 if (propId == CSSPropertyTouchAction | |
9019 && !RuntimeEnabledFeatures::cssTouchActionEnabled()) | |
9020 return false; | |
9021 | |
9022 CSSParserValue* value = m_valueList->current(); | |
9023 RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated(); | |
9024 if (m_valueList->size() == 1 && value && (value->id == CSSValueAuto || value ->id == CSSValueNone)) { | |
9025 list->append(cssValuePool().createIdentifierValue(value->id)); | |
9026 addProperty(propId, list.release(), important); | |
9027 m_valueList->next(); | |
9028 return true; | |
9029 } | |
9030 | |
9031 bool isValid = true; | |
9032 while (isValid && value) { | |
9033 switch (value->id) { | |
9034 case CSSValuePanX: | |
9035 case CSSValuePanY: { | |
9036 RefPtr<CSSValue> panValue = cssValuePool().createIdentifierValue(va lue->id); | |
Rick Byers
2013/12/12 15:30:35
nit: remove one of the two spaces after '='
gnana
2013/12/13 11:10:54
Done.
| |
9037 if (list->hasValue(panValue.get())) { | |
9038 isValid = false; | |
9039 break; | |
9040 } | |
9041 list->append(panValue.release()); | |
9042 break; | |
9043 } | |
9044 default: | |
9045 isValid = false; | |
9046 break; | |
9047 } | |
9048 if (isValid) | |
9049 value = m_valueList->next(); | |
9050 } | |
9051 | |
9052 if (list->length() && isValid) { | |
9053 addProperty(propId, list.release(), important); | |
9054 return true; | |
9055 } | |
9056 | |
9057 return false; | |
9058 } | |
9059 | |
9017 void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa lue> value, bool important) | 9060 void CSSParser::addTextDecorationProperty(CSSPropertyID propId, PassRefPtr<CSSVa lue> value, bool important) |
9018 { | 9061 { |
9019 // The text-decoration-line property takes priority over text-decoration, un less the latter has important priority set. | 9062 // The text-decoration-line property takes priority over text-decoration, un less the latter has important priority set. |
9020 if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) { | 9063 if (propId == CSSPropertyTextDecoration && !important && !inShorthand()) { |
9021 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { | 9064 for (unsigned i = 0; i < m_parsedProperties.size(); ++i) { |
9022 if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine) | 9065 if (m_parsedProperties[i].id() == CSSPropertyTextDecorationLine) |
9023 return; | 9066 return; |
9024 } | 9067 } |
9025 } | 9068 } |
9026 addProperty(propId, value, important); | 9069 addProperty(propId, value, important); |
(...skipping 1387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
10414 { | 10457 { |
10415 // The tokenizer checks for the construct of an+b. | 10458 // The tokenizer checks for the construct of an+b. |
10416 // However, since the {ident} rule precedes the {nth} rule, some of those | 10459 // However, since the {ident} rule precedes the {nth} rule, some of those |
10417 // tokens are identified as string literal. Furthermore we need to accept | 10460 // tokens are identified as string literal. Furthermore we need to accept |
10418 // "odd" and "even" which does not match to an+b. | 10461 // "odd" and "even" which does not match to an+b. |
10419 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") | 10462 return equalIgnoringCase(token, "odd") || equalIgnoringCase(token, "even") |
10420 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); | 10463 || equalIgnoringCase(token, "n") || equalIgnoringCase(token, "-n"); |
10421 } | 10464 } |
10422 | 10465 |
10423 } | 10466 } |
OLD | NEW |