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

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.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/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 f963e93fd3eb57920355d5c20eceefdf9fe0bc3b..33a29e13cf63751eac303eef181606efce2df827 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPaths.cpp
@@ -387,7 +387,7 @@ static bool fastParseColorInternal(RGBA32& rgb, const CharacterType* characters,
if (length >= 4 && characters[0] == '#')
return Color::parseHexColor(characters + 1, length - 1, rgb);
- if (quirksMode && length >= 3) {
+ if (quirksMode && (length == 3 || length == 6)) {
if (Color::parseHexColor(characters, length, rgb))
return true;
}

Powered by Google App Engine
This is Rietveld 408576698