Title: [205926] trunk/Source/WebCore
Revision
205926
Author
[email protected]
Date
2016-09-14 13:46:28 -0700 (Wed, 14 Sep 2016)

Log Message

Switch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
https://bugs.webkit.org/show_bug.cgi?id=161983

Reviewed by David Hyatt.

Towards switching to the new CSS parser keyword properties validation logic,
switch over the old CSS parser logic for determining a keyword property to
use the analogous logic in the new CSS parser.

A side benefit of this change is that it is a step towards unifying CSS- and
SVG CSS- keyword properties. The new CSS parser does not make a distinction
between these kinds of properties and will allow us to have a shared code path
for validating a keyword property.

No functionality was changed. So, no new tests.

* css/parser/CSSParser.cpp: Include header CSSParserFastPaths.h.
(WebCore::isValidKeywordPropertyAndValue): Validate SVG CSS keyword properties. This
logic was moved from CSSParser::parseSVGValue(). In subsequent patches we will switch
the old CSS parser from this function to CSSParserFastPaths::isValidKeywordPropertyAndValue().
(WebCore::parseKeywordValue): Modified to call CSSParserFastPaths::isKeywordPropertyID().
(WebCore::CSSParser::parseValue): Ditto.
(WebCore::isKeywordPropertyID): Deleted. Incorporated its functionality into
CSSParserFastPaths::isKeywordPropertyID().
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isKeywordPropertyID): Incorporates the functionality
of WebCore::isKeywordPropertyID().
* css/parser/SVGCSSParser.cpp:
(WebCore::CSSParser::parseSVGValue): Move properties that can be processed as
keyword properties from here to WebCore::isValidKeywordPropertyAndValue().

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (205925 => 205926)


--- trunk/Source/WebCore/ChangeLog	2016-09-14 20:41:31 UTC (rev 205925)
+++ trunk/Source/WebCore/ChangeLog	2016-09-14 20:46:28 UTC (rev 205926)
@@ -1,3 +1,36 @@
+2016-09-14  Daniel Bates  <[email protected]>
+
+        Switch CSSParser to use CSSParserFastPaths::isKeywordPropertyID()
+        https://bugs.webkit.org/show_bug.cgi?id=161983
+
+        Reviewed by David Hyatt.
+
+        Towards switching to the new CSS parser keyword properties validation logic,
+        switch over the old CSS parser logic for determining a keyword property to
+        use the analogous logic in the new CSS parser.
+
+        A side benefit of this change is that it is a step towards unifying CSS- and
+        SVG CSS- keyword properties. The new CSS parser does not make a distinction
+        between these kinds of properties and will allow us to have a shared code path
+        for validating a keyword property.
+
+        No functionality was changed. So, no new tests.
+
+        * css/parser/CSSParser.cpp: Include header CSSParserFastPaths.h.
+        (WebCore::isValidKeywordPropertyAndValue): Validate SVG CSS keyword properties. This
+        logic was moved from CSSParser::parseSVGValue(). In subsequent patches we will switch
+        the old CSS parser from this function to CSSParserFastPaths::isValidKeywordPropertyAndValue().
+        (WebCore::parseKeywordValue): Modified to call CSSParserFastPaths::isKeywordPropertyID().
+        (WebCore::CSSParser::parseValue): Ditto.
+        (WebCore::isKeywordPropertyID): Deleted. Incorporated its functionality into
+        CSSParserFastPaths::isKeywordPropertyID().
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isKeywordPropertyID): Incorporates the functionality
+        of WebCore::isKeywordPropertyID().
+        * css/parser/SVGCSSParser.cpp:
+        (WebCore::CSSParser::parseSVGValue): Move properties that can be processed as
+        keyword properties from here to WebCore::isValidKeywordPropertyAndValue().
+
 2016-09-13  Dean Jackson  <[email protected]>
 
         Rename parseColorParameters and clean up conditional

Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (205925 => 205926)


--- trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-09-14 20:41:31 UTC (rev 205925)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp	2016-09-14 20:46:28 UTC (rev 205926)
@@ -55,6 +55,7 @@
 #include "CSSMediaRule.h"
 #include "CSSNamedImageValue.h"
 #include "CSSPageRule.h"
+#include "CSSParserFastPaths.h"
 #include "CSSPrimitiveValue.h"
 #include "CSSPrimitiveValueMappings.h"
 #include "CSSPropertySourceData.h"
@@ -1075,6 +1076,69 @@
         if (valueID == CSSValueAuto || valueID == CSSValueAvoid || valueID == CSSValueAvoidColumn || valueID == CSSValueAvoidPage || valueID == CSSValueAvoidRegion)
             return true;
         break;
+    // SVG CSS properties
+    case CSSPropertyAlignmentBaseline:
+        // auto | baseline | before-edge | text-before-edge | middle |
+        // central | after-edge | text-after-edge | ideographic | alphabetic |
+        // hanging | mathematical | inherit
+        if (valueID == CSSValueAuto || valueID == CSSValueBaseline || valueID == CSSValueMiddle || (valueID >= CSSValueBeforeEdge && valueID <= CSSValueMathematical))
+            return true;
+        break;
+    case CSSPropertyBufferedRendering:
+        if (valueID == CSSValueAuto || valueID == CSSValueDynamic || valueID == CSSValueStatic)
+            return true;
+        break;
+    case CSSPropertyClipRule:
+    case CSSPropertyFillRule:
+        if (valueID == CSSValueNonzero || valueID == CSSValueEvenodd)
+            return true;
+        break;
+    case CSSPropertyColorInterpolation:
+    case CSSPropertyColorInterpolationFilters:
+        if (valueID == CSSValueAuto || valueID == CSSValueSrgb || valueID == CSSValueLinearrgb)
+            return true;
+        break;
+    case CSSPropertyColorRendering:
+        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality)
+            return true;
+        break;
+    case CSSPropertyDominantBaseline:
+        // auto | use-script | no-change | reset-size | ideographic |
+        // alphabetic | hanging | mathematical | central | middle |
+        // text-after-edge | text-before-edge | inherit
+        if (valueID == CSSValueAuto || valueID == CSSValueMiddle
+            || (valueID >= CSSValueUseScript && valueID <= CSSValueResetSize)
+            || (valueID >= CSSValueCentral && valueID <= CSSValueMathematical))
+            return true;
+        break;
+    case CSSPropertyMaskType:
+        if (valueID == CSSValueLuminance || valueID == CSSValueAlpha)
+            return true;
+        break;
+    case CSSPropertyShapeRendering:
+        if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueCrispedges || valueID == CSSValueGeometricprecision)
+            return true;
+        break;
+    case CSSPropertyStrokeLinecap:
+        if (valueID == CSSValueButt || valueID == CSSValueRound || valueID == CSSValueSquare)
+            return true;
+        break;
+    case CSSPropertyStrokeLinejoin:
+        if (valueID == CSSValueMiter || valueID == CSSValueRound || valueID == CSSValueBevel)
+            return true;
+        break;
+    case CSSPropertyTextAnchor:
+        if (valueID == CSSValueStart || valueID == CSSValueMiddle || valueID == CSSValueEnd)
+            return true;
+        break;
+    case CSSPropertyVectorEffect:
+        if (valueID == CSSValueNone || valueID == CSSValueNonScalingStroke)
+            return true;
+        break;
+    case CSSPropertyWritingMode:
+        if (valueID == CSSValueLrTb || valueID == CSSValueRlTb || valueID == CSSValueTbRl || valueID == CSSValueLr || valueID == CSSValueRl || valueID == CSSValueTb)
+            return true;
+        break;
     default:
         ASSERT_NOT_REACHED();
         return false;
@@ -1085,160 +1149,6 @@
     return false;
 }
 
-static inline bool isKeywordPropertyID(CSSPropertyID propertyId)
-{
-    switch (propertyId) {
-    case CSSPropertyBorderBottomStyle:
-    case CSSPropertyBorderCollapse:
-    case CSSPropertyBorderLeftStyle:
-    case CSSPropertyBorderRightStyle:
-    case CSSPropertyBorderTopStyle:
-    case CSSPropertyBoxSizing:
-    case CSSPropertyBreakAfter:
-    case CSSPropertyBreakBefore:
-    case CSSPropertyBreakInside:
-    case CSSPropertyCaptionSide:
-    case CSSPropertyClear:
-    case CSSPropertyColumnFill:
-    case CSSPropertyColumnProgression:
-    case CSSPropertyColumnRuleStyle:
-    case CSSPropertyDirection:
-    case CSSPropertyDisplay:
-    case CSSPropertyEmptyCells:
-    case CSSPropertyFlexDirection:
-    case CSSPropertyFlexWrap:
-    case CSSPropertyFloat:
-    case CSSPropertyFontStretch:
-    case CSSPropertyFontStyle:
-    case CSSPropertyFontVariantAlternates:
-    case CSSPropertyFontVariantCaps:
-    case CSSPropertyFontVariantPosition:
-    case CSSPropertyImageRendering:
-    case CSSPropertyListStylePosition:
-    case CSSPropertyListStyleType:
-    case CSSPropertyObjectFit:
-    case CSSPropertyOutlineStyle:
-    case CSSPropertyOverflowWrap:
-    case CSSPropertyOverflowX:
-    case CSSPropertyOverflowY:
-    case CSSPropertyPageBreakAfter:
-    case CSSPropertyPageBreakBefore:
-    case CSSPropertyPageBreakInside:
-    case CSSPropertyPointerEvents:
-    case CSSPropertyPosition:
-    case CSSPropertyResize:
-    case CSSPropertySpeak:
-    case CSSPropertyTableLayout:
-    case CSSPropertyTextAlign:
-    case CSSPropertyTextLineThroughMode:
-    case CSSPropertyTextLineThroughStyle:
-    case CSSPropertyTextOverflow:
-    case CSSPropertyTextOverlineMode:
-    case CSSPropertyTextOverlineStyle:
-    case CSSPropertyTextRendering:
-    case CSSPropertyTextTransform:
-    case CSSPropertyTextUnderlineMode:
-    case CSSPropertyTextUnderlineStyle:
-    case CSSPropertyTransformStyle:
-    case CSSPropertyUnicodeBidi:
-    case CSSPropertyVisibility:
-    case CSSPropertyWebkitAppearance:
-    case CSSPropertyWebkitBackfaceVisibility:
-    case CSSPropertyWebkitBorderAfterStyle:
-    case CSSPropertyWebkitBorderBeforeStyle:
-    case CSSPropertyWebkitBorderEndStyle:
-    case CSSPropertyWebkitBorderFit:
-    case CSSPropertyWebkitBorderStartStyle:
-    case CSSPropertyWebkitBoxAlign:
-    case CSSPropertyWebkitBoxDirection:
-    case CSSPropertyWebkitBoxLines:
-    case CSSPropertyWebkitBoxOrient:
-    case CSSPropertyWebkitBoxPack:
-    case CSSPropertyWebkitColumnAxis:
-    case CSSPropertyWebkitColumnBreakAfter:
-    case CSSPropertyWebkitColumnBreakBefore:
-    case CSSPropertyWebkitColumnBreakInside:
-    case CSSPropertyWebkitFontKerning:
-    case CSSPropertyWebkitFontSmoothing:
-    case CSSPropertyWebkitHyphens:
-    case CSSPropertyWebkitLineAlign:
-    case CSSPropertyWebkitLineBreak:
-    case CSSPropertyWebkitLineSnap:
-    case CSSPropertyWebkitMarginAfterCollapse:
-    case CSSPropertyWebkitMarginBeforeCollapse:
-    case CSSPropertyWebkitMarginBottomCollapse:
-    case CSSPropertyWebkitMarginTopCollapse:
-    case CSSPropertyWebkitMarqueeDirection:
-    case CSSPropertyWebkitMarqueeStyle:
-    case CSSPropertyWebkitNbspMode:
-    case CSSPropertyWebkitPrintColorAdjust:
-    case CSSPropertyWebkitRtlOrdering:
-    case CSSPropertyWebkitRubyPosition:
-    case CSSPropertyWebkitTextCombine:
-    case CSSPropertyWebkitTextDecorationStyle:
-    case CSSPropertyWebkitTextOrientation:
-    case CSSPropertyWebkitTextSecurity:
-    case CSSPropertyWebkitTextZoom:
-    case CSSPropertyWebkitTransformStyle:
-    case CSSPropertyWebkitUserDrag:
-    case CSSPropertyWebkitUserModify:
-    case CSSPropertyWebkitUserSelect:
-    case CSSPropertyWebkitWritingMode:
-    case CSSPropertyWhiteSpace:
-    case CSSPropertyWordBreak:
-    case CSSPropertyWordWrap:
-#if ENABLE(CSS_TRAILING_WORD)
-    case CSSPropertyAppleTrailingWord:
-#endif
-#if ENABLE(CSS_COMPOSITING)
-    case CSSPropertyIsolation:
-    case CSSPropertyMixBlendMode:
-#endif
-#if ENABLE(TOUCH_EVENTS)
-    case CSSPropertyTouchAction:
-#endif
-#if ENABLE(CSS_BOX_DECORATION_BREAK)
-    case CSSPropertyWebkitBoxDecorationBreak:
-#endif
-#if ENABLE(CURSOR_VISIBILITY)
-    case CSSPropertyWebkitCursorVisibility:
-#endif
-#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
-    case CSSPropertyWebkitOverflowScrolling:
-#endif
-#if ENABLE(CSS_REGIONS)
-    case CSSPropertyWebkitRegionBreakAfter:
-    case CSSPropertyWebkitRegionBreakBefore:
-    case CSSPropertyWebkitRegionBreakInside:
-    case CSSPropertyWebkitRegionFragment:
-#endif
-#if ENABLE(CSS3_TEXT)
-    case CSSPropertyWebkitTextAlignLast:
-    case CSSPropertyWebkitTextJustify:
-#endif
-#if PLATFORM(IOS)
-    // Apple specific property. These will never be standardized and is purely to
-    // support custom WebKit-based Apple applications.
-    case CSSPropertyWebkitTouchCallout:
-#endif
-#if ENABLE(CSS_SCROLL_SNAP)
-    case CSSPropertyWebkitScrollSnapType:
-#endif
-        return true;
-    case CSSPropertyJustifyContent:
-    case CSSPropertyAlignContent:
-    case CSSPropertyAlignItems:
-    case CSSPropertyAlignSelf:
-#if ENABLE(CSS_GRID_LAYOUT)
-        return !RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
-#else
-        return true;
-#endif
-    default:
-        return false;
-    }
-}
-
 static bool isUniversalKeyword(const String& string)
 {
     // These keywords can be used for all properties.
@@ -1252,7 +1162,7 @@
 {
     ASSERT(!string.isEmpty());
 
-    if (!isKeywordPropertyID(propertyId)) {
+    if (!CSSParserFastPaths::isKeywordPropertyID(propertyId)) {
         if (!isUniversalKeyword(string))
             return CSSParser::ParseResult::Error;
 
@@ -1964,7 +1874,7 @@
     if (propId == CSSPropertyAll)
         return false; // "all" doesn't allow you to specify anything other than inherit/initial/unset.
 
-    if (isKeywordPropertyID(propId)) {
+    if (CSSParserFastPaths::isKeywordPropertyID(propId)) {
         if (!isValidKeywordPropertyAndValue(propId, id, m_context, m_styleSheet))
             return false;
         if (m_valueList->next() && !inShorthand())

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (205925 => 205926)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-09-14 20:41:31 UTC (rev 205925)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2016-09-14 20:46:28 UTC (rev 205926)
@@ -742,16 +742,11 @@
         return false;
     }
 }
+*/
 
 bool CSSParserFastPaths::isKeywordPropertyID(CSSPropertyID propertyId)
 {
     switch (propertyId) {
-    case CSSPropertyAlignmentBaseline:
-    case CSSPropertyAll:
-    case CSSPropertyMixBlendMode:
-    case CSSPropertyIsolation:
-    case CSSPropertyBackgroundRepeatX:
-    case CSSPropertyBackgroundRepeatY:
     case CSSPropertyBorderBottomStyle:
     case CSSPropertyBorderCollapse:
     case CSSPropertyBorderLeftStyle:
@@ -758,108 +753,192 @@
     case CSSPropertyBorderRightStyle:
     case CSSPropertyBorderTopStyle:
     case CSSPropertyBoxSizing:
-    case CSSPropertyBufferedRendering:
+    case CSSPropertyBreakAfter:
+    case CSSPropertyBreakBefore:
+    case CSSPropertyBreakInside:
     case CSSPropertyCaptionSide:
     case CSSPropertyClear:
-    case CSSPropertyClipRule:
-    case CSSPropertyColorInterpolation:
-    case CSSPropertyColorInterpolationFilters:
-    case CSSPropertyColorRendering:
+    case CSSPropertyColumnFill:
+    case CSSPropertyColumnProgression:
+    case CSSPropertyColumnRuleStyle:
     case CSSPropertyDirection:
     case CSSPropertyDisplay:
-    case CSSPropertyDominantBaseline:
     case CSSPropertyEmptyCells:
-    case CSSPropertyFillRule:
+    case CSSPropertyFlexDirection:
+    case CSSPropertyFlexWrap:
     case CSSPropertyFloat:
+    case CSSPropertyFontStretch:
     case CSSPropertyFontStyle:
-    case CSSPropertyFontStretch:
-    case CSSPropertyHyphens:
+    case CSSPropertyFontVariantAlternates:
+    case CSSPropertyFontVariantCaps:
+    case CSSPropertyFontVariantPosition:
     case CSSPropertyImageRendering:
     case CSSPropertyListStylePosition:
     case CSSPropertyListStyleType:
-    case CSSPropertyMaskType:
     case CSSPropertyObjectFit:
     case CSSPropertyOutlineStyle:
-    case CSSPropertyOverflowAnchor:
     case CSSPropertyOverflowWrap:
     case CSSPropertyOverflowX:
     case CSSPropertyOverflowY:
-    case CSSPropertyBreakAfter:
-    case CSSPropertyBreakBefore:
-    case CSSPropertyBreakInside:
+    case CSSPropertyPageBreakAfter:
+    case CSSPropertyPageBreakBefore:
+    case CSSPropertyPageBreakInside:
     case CSSPropertyPointerEvents:
     case CSSPropertyPosition:
     case CSSPropertyResize:
-    case CSSPropertyScrollBehavior:
-    case CSSPropertyShapeRendering:
     case CSSPropertySpeak:
-    case CSSPropertyStrokeLinecap:
-    case CSSPropertyStrokeLinejoin:
     case CSSPropertyTableLayout:
     case CSSPropertyTextAlign:
-    case CSSPropertyTextAlignLast:
-    case CSSPropertyTextAnchor:
-    case CSSPropertyTextCombineUpright:
-    case CSSPropertyTextDecorationStyle:
-    case CSSPropertyTextJustify:
-    case CSSPropertyTextOrientation:
-    case CSSPropertyWebkitTextOrientation:
+    case CSSPropertyTextLineThroughMode:
+    case CSSPropertyTextLineThroughStyle:
     case CSSPropertyTextOverflow:
+    case CSSPropertyTextOverlineMode:
+    case CSSPropertyTextOverlineStyle:
     case CSSPropertyTextRendering:
     case CSSPropertyTextTransform:
+    case CSSPropertyTextUnderlineMode:
+    case CSSPropertyTextUnderlineStyle:
+    case CSSPropertyTransformStyle:
     case CSSPropertyUnicodeBidi:
-    case CSSPropertyVectorEffect:
     case CSSPropertyVisibility:
     case CSSPropertyWebkitAppearance:
-    case CSSPropertyBackfaceVisibility:
+    case CSSPropertyWebkitBackfaceVisibility:
     case CSSPropertyWebkitBorderAfterStyle:
     case CSSPropertyWebkitBorderBeforeStyle:
     case CSSPropertyWebkitBorderEndStyle:
+    case CSSPropertyWebkitBorderFit:
     case CSSPropertyWebkitBorderStartStyle:
     case CSSPropertyWebkitBoxAlign:
-    case CSSPropertyWebkitBoxDecorationBreak:
     case CSSPropertyWebkitBoxDirection:
     case CSSPropertyWebkitBoxLines:
     case CSSPropertyWebkitBoxOrient:
     case CSSPropertyWebkitBoxPack:
-    case CSSPropertyColumnFill:
-    case CSSPropertyColumnRuleStyle:
-    case CSSPropertyFlexDirection:
-    case CSSPropertyFlexWrap:
-    case CSSPropertyFontKerning:
+    case CSSPropertyWebkitColumnAxis:
+    case CSSPropertyWebkitColumnBreakAfter:
+    case CSSPropertyWebkitColumnBreakBefore:
+    case CSSPropertyWebkitColumnBreakInside:
+    case CSSPropertyWebkitFontKerning:
     case CSSPropertyWebkitFontSmoothing:
+    case CSSPropertyWebkitHyphens:
+    case CSSPropertyWebkitLineAlign:
     case CSSPropertyWebkitLineBreak:
+    case CSSPropertyWebkitLineSnap:
     case CSSPropertyWebkitMarginAfterCollapse:
     case CSSPropertyWebkitMarginBeforeCollapse:
     case CSSPropertyWebkitMarginBottomCollapse:
     case CSSPropertyWebkitMarginTopCollapse:
+    case CSSPropertyWebkitMarqueeDirection:
+    case CSSPropertyWebkitMarqueeStyle:
+    case CSSPropertyWebkitNbspMode:
     case CSSPropertyWebkitPrintColorAdjust:
     case CSSPropertyWebkitRtlOrdering:
     case CSSPropertyWebkitRubyPosition:
     case CSSPropertyWebkitTextCombine:
-    case CSSPropertyWebkitTextEmphasisPosition:
+    case CSSPropertyWebkitTextDecorationStyle:
+    case CSSPropertyWebkitTextOrientation:
     case CSSPropertyWebkitTextSecurity:
-    case CSSPropertyTransformStyle:
+    case CSSPropertyWebkitTextZoom:
+    case CSSPropertyWebkitTransformStyle:
     case CSSPropertyWebkitUserDrag:
     case CSSPropertyWebkitUserModify:
-    case CSSPropertyUserSelect:
+    case CSSPropertyWebkitUserSelect:
     case CSSPropertyWebkitWritingMode:
     case CSSPropertyWhiteSpace:
     case CSSPropertyWordBreak:
     case CSSPropertyWordWrap:
+
+    // SVG CSS properties from SVG 1.1, Appendix N: Property Index.
+    case CSSPropertyAlignmentBaseline:
+    case CSSPropertyBufferedRendering:
+    case CSSPropertyClipRule:
+    case CSSPropertyColorInterpolation:
+    case CSSPropertyColorInterpolationFilters:
+    case CSSPropertyColorRendering:
+    case CSSPropertyDominantBaseline:
+    case CSSPropertyFillRule:
+    case CSSPropertyMaskType:
+    case CSSPropertyShapeRendering:
+    case CSSPropertyStrokeLinecap:
+    case CSSPropertyStrokeLinejoin:
+    case CSSPropertyTextAnchor:
+    case CSSPropertyVectorEffect:
     case CSSPropertyWritingMode:
-    case CSSPropertyScrollSnapType:
+
+    // FIXME-NEWPARSER: Treat all as a keyword property.
+    // case CSSPropertyAll:
+
+    // FIXME-NEWPARSER: Treat the following properties as keyword properties:
+    // case CSSPropertyBackgroundRepeatX:
+    // case CSSPropertyBackgroundRepeatY:
+    // case CSSPropertyWebkitTextEmphasisPosition:
+
+    // FIXME-NEWPARSER: Add the following unprefixed properties:
+    // case CSSPropertyBackfaceVisibility:
+    // case CSSPropertyFontKerning:
+    // case CSSPropertyHyphens:
+    // case CSSPropertyOverflowAnchor:
+    // case CSSPropertyScrollBehavior:
+    // case CSSPropertyScrollSnapType:
+    // case CSSPropertyTextAlignLast:
+    // case CSSPropertyTextCombineUpright:
+    // case CSSPropertyTextDecorationStyle:
+    // case CSSPropertyTextJustify:
+    // case CSSPropertyTextOrientation:
+    // case CSSPropertyUserSelect:
+#if ENABLE(CSS_TRAILING_WORD)
+    case CSSPropertyAppleTrailingWord:
+#endif
+#if ENABLE(CSS_COMPOSITING)
+    case CSSPropertyIsolation:
+    case CSSPropertyMixBlendMode:
+#endif
+#if ENABLE(TOUCH_EVENTS)
+    case CSSPropertyTouchAction:
+#endif
+#if ENABLE(CSS_BOX_DECORATION_BREAK)
+    case CSSPropertyWebkitBoxDecorationBreak:
+#endif
+#if ENABLE(CURSOR_VISIBILITY)
+    case CSSPropertyWebkitCursorVisibility:
+#endif
+#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
+    case CSSPropertyWebkitOverflowScrolling:
+#endif
+#if ENABLE(CSS_REGIONS)
+    case CSSPropertyWebkitRegionBreakAfter:
+    case CSSPropertyWebkitRegionBreakBefore:
+    case CSSPropertyWebkitRegionBreakInside:
+    case CSSPropertyWebkitRegionFragment:
+#endif
+#if ENABLE(CSS3_TEXT)
+    case CSSPropertyWebkitTextAlignLast:
+    case CSSPropertyWebkitTextJustify:
+#endif
+#if PLATFORM(IOS)
+    // Apple specific property. This will never be standardized and is purely to
+    // support custom WebKit-based Apple applications.
+    case CSSPropertyWebkitTouchCallout:
+#endif
+#if ENABLE(CSS_SCROLL_SNAP)
+    case CSSPropertyWebkitScrollSnapType:
+#endif
         return true;
     case CSSPropertyJustifyContent:
     case CSSPropertyAlignContent:
     case CSSPropertyAlignItems:
     case CSSPropertyAlignSelf:
-        return !RuntimeEnabledFeatures::cssGridLayoutEnabled();
+#if ENABLE(CSS_GRID_LAYOUT)
+        return !RuntimeEnabledFeatures::sharedFeatures().isCSSGridLayoutEnabled();
+#else
+        return true;
+#endif
     default:
         return false;
     }
 }
 
+/* FIXME-NEWPARSER: Turn off for now.
+
 static CSSValue* parseKeywordValue(CSSPropertyID propertyId, const String& string, CSSParserMode parserMode)
 {
     ASSERT(!string.isEmpty());

Modified: trunk/Source/WebCore/css/parser/SVGCSSParser.cpp (205925 => 205926)


--- trunk/Source/WebCore/css/parser/SVGCSSParser.cpp	2016-09-14 20:41:31 UTC (rev 205925)
+++ trunk/Source/WebCore/css/parser/SVGCSSParser.cpp	2016-09-14 20:46:28 UTC (rev 205926)
@@ -52,15 +52,6 @@
     switch (propId) {
     /* The comment to the right defines all valid value of these
      * properties as defined in SVG 1.1, Appendix N. Property index */
-    case CSSPropertyAlignmentBaseline:
-    // auto | baseline | before-edge | text-before-edge | middle |
-    // central | after-edge | text-after-edge | ideographic | alphabetic |
-    // hanging | mathematical | inherit
-        if (id == CSSValueAuto || id == CSSValueBaseline || id == CSSValueMiddle ||
-          (id >= CSSValueBeforeEdge && id <= CSSValueMathematical))
-            valid_primitive = true;
-        break;
-
     case CSSPropertyBaselineShift:
     // baseline | super | sub | <percentage> | <length> | inherit
         if (id == CSSValueBaseline || id == CSSValueSub ||
@@ -70,16 +61,6 @@
             valid_primitive = validateUnit(valueWithCalculation, FLength | FPercent, SVGAttributeMode);
         break;
 
-    case CSSPropertyDominantBaseline:
-    // auto | use-script | no-change | reset-size | ideographic |
-    // alphabetic | hanging | mathematical | central | middle |
-    // text-after-edge | text-before-edge | inherit
-        if (id == CSSValueAuto || id == CSSValueMiddle ||
-          (id >= CSSValueUseScript && id <= CSSValueResetSize) ||
-          (id >= CSSValueCentral && id <= CSSValueMathematical))
-            valid_primitive = true;
-        break;
-
     case CSSPropertyEnableBackground:
     // accumulate | new [x] [y] [width] [height] | inherit
         if (id == CSSValueAccumulate) // TODO : new
@@ -99,26 +80,10 @@
         }
         break;
 
-    case CSSPropertyClipRule:            // nonzero | evenodd | inherit
-    case CSSPropertyFillRule:
-        if (id == CSSValueNonzero || id == CSSValueEvenodd)
-            valid_primitive = true;
-        break;
-
     case CSSPropertyStrokeMiterlimit:   // <miterlimit> | inherit
         valid_primitive = validateUnit(valueWithCalculation, FNumber | FNonNeg, SVGAttributeMode);
         break;
 
-    case CSSPropertyStrokeLinejoin:   // miter | round | bevel | inherit
-        if (id == CSSValueMiter || id == CSSValueRound || id == CSSValueBevel)
-            valid_primitive = true;
-        break;
-
-    case CSSPropertyStrokeLinecap:    // butt | round | square | inherit
-        if (id == CSSValueButt || id == CSSValueRound || id == CSSValueSquare)
-            valid_primitive = true;
-        break;
-
     case CSSPropertyStrokeOpacity:   // <opacity-value> | inherit
     case CSSPropertyFillOpacity:
     case CSSPropertyStopOpacity:
@@ -126,44 +91,15 @@
         valid_primitive = (!id && validateUnit(valueWithCalculation, FNumber | FPercent, SVGAttributeMode));
         break;
 
-    case CSSPropertyShapeRendering:
-    // auto | optimizeSpeed | crispEdges | geometricPrecision | inherit
-        if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
-            id == CSSValueCrispedges || id == CSSValueGeometricprecision)
-            valid_primitive = true;
-        break;
-
-    case CSSPropertyColorRendering: // auto | optimizeSpeed | optimizeQuality | inherit
-        if (id == CSSValueAuto || id == CSSValueOptimizespeed ||
-            id == CSSValueOptimizequality)
-            valid_primitive = true;
-        break;
-
-    case CSSPropertyBufferedRendering: // auto | dynamic | static
-        if (id == CSSValueAuto || id == CSSValueDynamic || id == CSSValueStatic)
-            valid_primitive = true;
-        break;
-
     case CSSPropertyColorProfile: // auto | sRGB | <name> | <uri> inherit
         if (id == CSSValueAuto || id == CSSValueSrgb)
             valid_primitive = true;
         break;
 
-    case CSSPropertyColorInterpolation:   // auto | sRGB | linearRGB | inherit
-    case CSSPropertyColorInterpolationFilters:
-        if (id == CSSValueAuto || id == CSSValueSrgb || id == CSSValueLinearrgb)
-            valid_primitive = true;
-        break;
-
     /* Start of supported CSS properties with validation. This is needed for parseShortHand to work
      * correctly and allows optimization in applyRule(..)
      */
 
-    case CSSPropertyTextAnchor:    // start | middle | end | inherit
-        if (id == CSSValueStart || id == CSSValueMiddle || id == CSSValueEnd)
-            valid_primitive = true;
-        break;
-
     case CSSPropertyGlyphOrientationVertical: // auto | <angle> | inherit
         if (id == CSSValueAuto) {
             valid_primitive = true;
@@ -228,17 +164,6 @@
 
         break;
 
-    case CSSPropertyVectorEffect: // none | non-scaling-stroke | inherit
-        if (id == CSSValueNone || id == CSSValueNonScalingStroke)
-            valid_primitive = true;
-        break;
-
-    case CSSPropertyWritingMode:
-    // lr-tb | rl_tb | tb-rl | lr | rl | tb | inherit
-        if (id == CSSValueLrTb || id == CSSValueRlTb || id == CSSValueTbRl || id == CSSValueLr || id == CSSValueRl || id == CSSValueTb)
-            valid_primitive = true;
-        break;
-
     case CSSPropertyStrokeWidth:         // <length> | inherit
     case CSSPropertyStrokeDashoffset:
         valid_primitive = validateUnit(valueWithCalculation, FLength | FPercent, SVGAttributeMode);
@@ -282,11 +207,6 @@
         }
         break;
 
-    case CSSPropertyMaskType: // luminance | alpha | inherit
-        if (id == CSSValueLuminance || id == CSSValueAlpha)
-            valid_primitive = true;
-        break;
-
     /* shorthand properties */
     case CSSPropertyMarker:
     {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to