Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp

Issue 1386733003: Do not accept CSS-wide keywords for descriptors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
index 476ed2f100053b44706e2b0ca260b7b1dc16f534..500b3437e716612f9101f43ebbb3850f1b9a99de 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -528,8 +528,6 @@ bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId
return valueID == CSSValueShow || valueID == CSSValueHide;
case CSSPropertyFloat: // left | right | none
return valueID == CSSValueLeft || valueID == CSSValueRight || valueID == CSSValueNone;
- case CSSPropertyFontDisplay: // auto | block | swap | fallback | optional
- return valueID == CSSValueAuto || valueID == CSSValueBlock || valueID == CSSValueSwap || valueID == CSSValueFallback || valueID == CSSValueOptional;
case CSSPropertyFontStyle: // normal | italic | oblique
return valueID == CSSValueNormal || valueID == CSSValueItalic || valueID == CSSValueOblique;
case CSSPropertyFontStretch: // normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded
@@ -842,6 +840,10 @@ static CSSValue* parseKeywordValue(CSSPropertyID propertyId, const String& strin
// Parse initial/inherit shorthands using the CSSPropertyParser.
if (shorthandForProperty(propertyId).length())
return nullptr;
+
+ // Descriptors do not support css wide keywords.
+ if (CSSPropertyMetadata::isDescriptorOnly(propertyId))
+ return nullptr;
}
CSSParserString cssString;

Powered by Google App Engine
This is Rietveld 408576698