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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.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
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index 47e3e7b36bbdef90ad76504bf7207eb87f7d7657..db39c3eaca40f85384c49d0e208ce588c82f3ab8 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -305,10 +305,13 @@ bool CSSPropertyParser::consumeCSSWideKeyword(CSSPropertyID unresolvedProperty,
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
const StylePropertyShorthand& shorthand = shorthandForProperty(property);
- if (!shorthand.length())
+ if (!shorthand.length()) {
+ if (CSSPropertyMetadata::isDescriptorOnly(unresolvedProperty))
+ return false;
addProperty(property, CSSPropertyInvalid, value, important);
- else
+ } else {
addExpandedPropertyForValue(property, value, important);
+ }
m_range = rangeCopy;
return true;
}
@@ -3970,6 +3973,11 @@ CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty,
}
}
+static CSSPrimitiveValue* consumeFontDisplay(CSSParserTokenRange& range)
+{
+ return consumeIdent<CSSValueAuto, CSSValueBlock, CSSValueSwap, CSSValueFallback, CSSValueOptional>(range);
+}
+
static CSSValueList* consumeFontFaceUnicodeRange(CSSParserTokenRange& range)
{
CSSValueList* values = CSSValueList::createCommaSeparated();
@@ -4063,6 +4071,8 @@ bool CSSPropertyParser::parseFontFaceDescriptor(CSSPropertyID propId)
parsedValue = consumeFontFaceUnicodeRange(m_range);
break;
case CSSPropertyFontDisplay:
+ parsedValue = consumeFontDisplay(m_range);
+ break;
case CSSPropertyFontStretch:
case CSSPropertyFontStyle: {
CSSValueID id = m_range.consumeIncludingWhitespace().id();
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698