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

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

Issue 1936913002: [CSS] Accept 8 (#RRGGBBAA) and 4 (#RGBA) value hex colors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add quirks mode fastParseColorInternal() test cases. 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/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 0fe218a71e5f9fa77ac5318125288cde0d22eb9b..49b1abb42138a4ef1369528973876cc8971d16e8 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -416,6 +416,9 @@ static bool parseHexColor(CSSParserTokenRange& range, RGBA32& result, bool accep
while (color.length() < 6)
color = "0" + color;
} else if (token.type() == IdentToken) { // e.g. FF0000
+ unsigned length = token.value().length();
+ if (length != 3 && length != 6)
+ return false;
color = token.value();
}
}
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp ('k') | third_party/WebKit/Source/core/html/HTMLElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698