Modified: trunk/Source/WebCore/ChangeLog (205887 => 205888)
--- trunk/Source/WebCore/ChangeLog 2016-09-13 23:27:47 UTC (rev 205887)
+++ trunk/Source/WebCore/ChangeLog 2016-09-14 00:10:21 UTC (rev 205888)
@@ -1,3 +1,32 @@
+2016-09-13 Daniel Bates <[email protected]>
+
+ Treat some CSS properties as keyword properties
+ https://bugs.webkit.org/show_bug.cgi?id=161934
+
+ Reviewed by Simon Fraser.
+
+ Move validation of the following CSS keyword properties from CSSParser::parseValue() to
+ WebCore::isValidKeywordPropertyAndValue():
+
+ CSSPropertyColumnProgression
+ CSSPropertyFontStretch
+ CSSPropertyTextAlign
+ CSSPropertyUnicodeBidi
+ CSSPropertyWebkitColumnAxis
+ CSSPropertyWebkitCursorVisibility
+ CSSPropertyWebkitTextDecorationStyle
+ CSSPropertyWebkitTextOrientation
+ CSSPropertyWebkitTextZoom
+ CSSPropertyWebkitTouchCallout
+
+ Among other benefits, this will make it more straightforward to migrate from CSSParser::is{KeywordPropertyID, ValidKeywordPropertyAndValue}()
+ to CSSParserFastPaths::is{KeywordPropertyID, ValidKeywordPropertyAndValue}(), respectively.
+
+ * css/parser/CSSParser.cpp:
+ (WebCore::isValidKeywordPropertyAndValue):
+ (WebCore::isKeywordPropertyID):
+ (WebCore::CSSParser::parseValue):
+
2016-09-13 Chris Dumez <[email protected]>
Merge Element::ScrollToOptions and DOMWindow::ScrollToOptions
Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (205887 => 205888)
--- trunk/Source/WebCore/css/parser/CSSParser.cpp 2016-09-13 23:27:47 UTC (rev 205887)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp 2016-09-14 00:10:21 UTC (rev 205888)
@@ -653,6 +653,8 @@
if (valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique)
return true;
break;
+ case CSSPropertyFontStretch:
+ return false;
case CSSPropertyImageRendering: // auto | optimizeSpeed | optimizeQuality | -webkit-crisp-edges | -webkit-optimize-contrast | crisp-edges | pixelated
// optimizeSpeed and optimizeQuality are deprecated; a user agent must accept them as valid values but must treat them as having the same behavior as pixelated and auto respectively.
if (valueID == CSSValueAuto || valueID == CSSValueOptimizespeed || valueID == CSSValueOptimizequality
@@ -736,6 +738,12 @@
if (valueID == CSSValueAuto || valueID == CSSValueFixed)
return true;
break;
+ case CSSPropertyTextAlign:
+ // left | right | center | justify | -webkit-left | -webkit-right | -webkit-center | -webkit-match-parent
+ // | start | end | inherit | -webkit-auto (converted to start)
+ if ((valueID >= CSSValueWebkitAuto && valueID <= CSSValueWebkitMatchParent) || valueID == CSSValueStart || valueID == CSSValueEnd)
+ return true;
+ break;
case CSSPropertyTextLineThroughMode:
case CSSPropertyTextOverlineMode:
case CSSPropertyTextUnderlineMode:
@@ -760,6 +768,11 @@
if ((valueID >= CSSValueCapitalize && valueID <= CSSValueLowercase) || valueID == CSSValueNone)
return true;
break;
+ case CSSPropertyUnicodeBidi:
+ if (valueID == CSSValueNormal || valueID == CSSValueEmbed || valueID == CSSValueBidiOverride || valueID == CSSValueWebkitIsolate
+ || valueID == CSSValueWebkitIsolateOverride || valueID == CSSValueWebkitPlaintext)
+ return true;
+ break;
case CSSPropertyVisibility: // visible | hidden | collapse | inherit
if (valueID == CSSValueVisible || valueID == CSSValueHidden || valueID == CSSValueCollapse)
return true;
@@ -815,10 +828,24 @@
if (valueID == CSSValueStart || valueID == CSSValueEnd || valueID == CSSValueCenter || valueID == CSSValueJustify)
return true;
break;
+#if ENABLE(CURSOR_VISIBILITY)
+ case CSSPropertyWebkitCursorVisibility:
+ if (valueID == CSSValueAuto || valueID == CSSValueAutoHide)
+ return true;
+ break;
+#endif
+ case CSSPropertyWebkitColumnAxis:
+ if (valueID == CSSValueHorizontal || valueID == CSSValueVertical || valueID == CSSValueAuto)
+ return true;
+ break;
case CSSPropertyColumnFill:
if (valueID == CSSValueAuto || valueID == CSSValueBalance)
return true;
break;
+ case CSSPropertyColumnProgression:
+ if (valueID == CSSValueNormal || valueID == CSSValueReverse)
+ return true;
+ break;
case CSSPropertyAlignContent:
// FIXME: Per CSS alignment, this property should accept an optional <overflow-position>. We should share this parsing code with 'justify-self'.
// FIXME: For now, we will do it behind the GRID_LAYOUT compile flag.
@@ -937,6 +964,10 @@
if (valueID == CSSValueNone || valueID == CSSValueHorizontal)
return true;
break;
+ case CSSPropertyWebkitTextDecorationStyle:
+ if (valueID == CSSValueSolid || valueID == CSSValueDouble || valueID == CSSValueDotted || valueID == CSSValueDashed || valueID == CSSValueWavy)
+ return true;
+ break;
#if ENABLE(CSS3_TEXT)
case CSSPropertyWebkitTextJustify:
// auto | none | inter-word | distribute
@@ -944,11 +975,20 @@
return true;
break;
#endif // CSS3_TEXT
+ case CSSPropertyWebkitTextOrientation:
+ if (valueID == CSSValueSideways || valueID == CSSValueSidewaysRight || valueID == CSSValueVerticalRight
+ || valueID == CSSValueMixed || valueID == CSSValueUpright)
+ return true;
+ break;
case CSSPropertyWebkitTextSecurity:
// disc | circle | square | none | inherit
if (valueID == CSSValueDisc || valueID == CSSValueCircle || valueID == CSSValueSquare || valueID == CSSValueNone)
return true;
break;
+ case CSSPropertyWebkitTextZoom:
+ if (valueID == CSSValueNormal || valueID == CSSValueReset)
+ return true;
+ break;
#if ENABLE(IOS_TEXT_AUTOSIZING)
case CSSPropertyWebkitTextSizeAdjust:
if (!parserContext.textAutosizingEnabled)
@@ -958,6 +998,14 @@
return true;
break;
#endif
+#if PLATFORM(IOS)
+ // Apple specific property. These will never be standardized and is purely to
+ // support custom WebKit-based Apple applications.
+ case CSSPropertyWebkitTouchCallout:
+ if (valueID == CSSValueDefault || valueID == CSSValueNone)
+ return true;
+ break;
+#endif
case CSSPropertyTransformStyle:
case CSSPropertyWebkitTransformStyle:
if (valueID == CSSValueFlat || valueID == CSSValuePreserve3d)
@@ -1052,6 +1100,7 @@
case CSSPropertyCaptionSide:
case CSSPropertyClear:
case CSSPropertyColumnFill:
+ case CSSPropertyColumnProgression:
case CSSPropertyColumnRuleStyle:
case CSSPropertyDirection:
case CSSPropertyDisplay:
@@ -1059,6 +1108,7 @@
case CSSPropertyFlexDirection:
case CSSPropertyFlexWrap:
case CSSPropertyFloat:
+ case CSSPropertyFontStretch:
case CSSPropertyFontStyle:
case CSSPropertyFontVariantAlternates:
case CSSPropertyFontVariantCaps:
@@ -1079,6 +1129,7 @@
case CSSPropertyResize:
case CSSPropertySpeak:
case CSSPropertyTableLayout:
+ case CSSPropertyTextAlign:
case CSSPropertyTextLineThroughMode:
case CSSPropertyTextLineThroughStyle:
case CSSPropertyTextOverflow:
@@ -1089,6 +1140,7 @@
case CSSPropertyTextUnderlineMode:
case CSSPropertyTextUnderlineStyle:
case CSSPropertyTransformStyle:
+ case CSSPropertyUnicodeBidi:
case CSSPropertyVisibility:
case CSSPropertyWebkitAppearance:
case CSSPropertyWebkitBackfaceVisibility:
@@ -1102,6 +1154,7 @@
case CSSPropertyWebkitBoxLines:
case CSSPropertyWebkitBoxOrient:
case CSSPropertyWebkitBoxPack:
+ case CSSPropertyWebkitColumnAxis:
case CSSPropertyWebkitColumnBreakAfter:
case CSSPropertyWebkitColumnBreakBefore:
case CSSPropertyWebkitColumnBreakInside:
@@ -1122,7 +1175,10 @@
case CSSPropertyWebkitRtlOrdering:
case CSSPropertyWebkitRubyPosition:
case CSSPropertyWebkitTextCombine:
+ case CSSPropertyWebkitTextDecorationStyle:
+ case CSSPropertyWebkitTextOrientation:
case CSSPropertyWebkitTextSecurity:
+ case CSSPropertyWebkitTextZoom:
case CSSPropertyWebkitTransformStyle:
case CSSPropertyWebkitUserDrag:
case CSSPropertyWebkitUserModify:
@@ -1144,6 +1200,9 @@
#if ENABLE(CSS_BOX_DECORATION_BREAK)
case CSSPropertyWebkitBoxDecorationBreak:
#endif
+#if ENABLE(CURSOR_VISIBILITY)
+ case CSSPropertyWebkitCursorVisibility:
+#endif
#if ENABLE(ACCELERATED_OVERFLOW_SCROLLING)
case CSSPropertyWebkitOverflowScrolling:
#endif
@@ -1157,6 +1216,11 @@
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
@@ -1980,15 +2044,6 @@
else
return parseQuotes(propId, important);
break;
- case CSSPropertyUnicodeBidi: // normal | embed | bidi-override | isolate | isolate-override | plaintext | inherit
- if (id == CSSValueNormal
- || id == CSSValueEmbed
- || id == CSSValueBidiOverride
- || id == CSSValueWebkitIsolate
- || id == CSSValueWebkitIsolateOverride
- || id == CSSValueWebkitPlaintext)
- validPrimitive = true;
- break;
case CSSPropertyContent: // [ <string> | <uri> | <counter> | attr(X) | open-quote |
// close-quote | no-open-quote | no-close-quote ]+ | inherit
@@ -2026,14 +2081,6 @@
return true;
}
- case CSSPropertyTextAlign:
- // left | right | center | justify | -webkit-left | -webkit-right | -webkit-center | -webkit-match-parent
- // | start | end | inherit | -webkit-auto (converted to start)
- // NOTE: <string> is not supported.
- if ((id >= CSSValueWebkitAuto && id <= CSSValueWebkitMatchParent) || id == CSSValueStart || id == CSSValueEnd)
- validPrimitive = true;
- break;
-
case CSSPropertyFontWeight: { // normal | bold | bolder | lighter | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 | inherit
if (m_valueList->size() != 1)
return false;
@@ -2184,13 +2231,6 @@
break;
}
-#if ENABLE(CURSOR_VISIBILITY)
- case CSSPropertyWebkitCursorVisibility:
- if (id == CSSValueAuto || id == CSSValueAutoHide)
- validPrimitive = true;
- break;
-#endif
-
case CSSPropertyBackgroundAttachment:
case CSSPropertyBackgroundBlendMode:
case CSSPropertyBackgroundClip:
@@ -2404,12 +2444,6 @@
// none | [ underline || overline || line-through || blink ] | inherit
return parseTextDecoration(propId, important);
- case CSSPropertyWebkitTextDecorationStyle:
- // solid | double | dotted | dashed | wavy
- if (id == CSSValueSolid || id == CSSValueDouble || id == CSSValueDotted || id == CSSValueDashed || id == CSSValueWavy)
- validPrimitive = true;
- break;
-
case CSSPropertyWebkitTextDecorationSkip:
// none | [ objects || spaces || ink || edges || box-decoration ]
return parseTextDecorationSkip(important);
@@ -2425,12 +2459,6 @@
else
validPrimitive = (!id && validateUnit(valueWithCalculation, FNumber | FPercent | FNonNeg, HTMLStandardMode));
break;
-
- case CSSPropertyWebkitTextZoom:
- // normal | reset
- if (id == CSSValueNormal || id == CSSValueReset)
- validPrimitive = true;
- break;
case CSSPropertySrc: // Only used within @font-face and @-webkit-filter, so cannot use inherit | initial or be !important. This is a list of urls or local references.
return parseFontFaceSrc();
@@ -2594,14 +2622,6 @@
return true;
}
break;
-#if ENABLE(CSS_COMPOSITING)
- case CSSPropertyMixBlendMode:
- validPrimitive = true;
- break;
- case CSSPropertyIsolation:
- validPrimitive = true;
- break;
-#endif
case CSSPropertyFlex: {
ShorthandScope scope(this, propId);
if (id == CSSValueNone) {
@@ -2852,14 +2872,6 @@
else
validPrimitive = validateUnit(valueWithCalculation, FLength | FNonNeg);
break;
- case CSSPropertyWebkitColumnAxis:
- if (id == CSSValueHorizontal || id == CSSValueVertical || id == CSSValueAuto)
- validPrimitive = true;
- break;
- case CSSPropertyColumnProgression:
- if (id == CSSValueNormal || id == CSSValueReverse)
- validPrimitive = true;
- break;
case CSSPropertyColumnSpan: // none | all | 1 (will be dropped in the unprefixed property)
if (id == CSSValueAll || id == CSSValueNone)
validPrimitive = true;
@@ -2954,12 +2966,6 @@
break;
#endif
-#if PLATFORM(IOS)
- case CSSPropertyWebkitTouchCallout:
- if (id == CSSValueDefault || id == CSSValueNone)
- validPrimitive = true;
- break;
-#endif
#if ENABLE(TOUCH_EVENTS)
case CSSPropertyWebkitTapHighlightColor:
if (isValidSystemColorValue(id) || id == CSSValueMenu
@@ -3063,7 +3069,6 @@
return false;
case CSSPropertyPage:
return parsePage(propId, important);
- case CSSPropertyFontStretch:
case CSSPropertyTextLineThrough:
case CSSPropertyTextOverline:
case CSSPropertyTextUnderline:
@@ -3078,11 +3083,6 @@
case CSSPropertyWebkitTextEmphasisPosition:
return parseTextEmphasisPosition(important);
- case CSSPropertyWebkitTextOrientation:
- if (id == CSSValueSideways || id == CSSValueSidewaysRight || id == CSSValueVerticalRight || id == CSSValueMixed || id == CSSValueUpright)
- validPrimitive = true;
- break;
-
case CSSPropertyHangingPunctuation:
return parseHangingPunctuation(important);
case CSSPropertyWebkitLineBoxContain: