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

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

Issue 2378113005: Change isCSSWideKeyword() to take a StringView instead of a CSSValueID (Closed)
Patch Set: Created 4 years, 3 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/CSSPropertyParserHelpers.h ('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/CSSPropertyParserHelpers.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
index 41a388f7daa05ab64448a17919a73dbf409a6cd4..ce08752b343afb1db20b13f87687c154164cbc08 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -313,7 +313,7 @@ CSSPrimitiveValue* consumeIdentRange(CSSParserTokenRange& range, CSSValueID lowe
CSSCustomIdentValue* consumeCustomIdent(CSSParserTokenRange& range)
{
- if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().id()))
+ if (range.peek().type() != IdentToken || isCSSWideKeyword(range.peek().value()))
return nullptr;
return CSSCustomIdentValue::create(range.consumeIncludingWhitespace().value().toAtomicString());
}
@@ -1110,6 +1110,14 @@ CSSValue* consumeImage(CSSParserTokenRange& range, CSSParserContext context, Con
return nullptr;
}
+bool isCSSWideKeyword(StringView keyword)
+{
+ return equalIgnoringASCIICase(keyword, "initial")
+ || equalIgnoringASCIICase(keyword, "inherit")
+ || equalIgnoringASCIICase(keyword, "unset")
+ || equalIgnoringASCIICase(keyword, "default");
+}
+
} // namespace CSSPropertyParserHelpers
} // namespace blink
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698