Index: Source/core/css/parser/CSSPropertyParser.cpp |
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
index 4b3b4acb72fba29fb124eb6843920f22f6f6e976..7cc5f9a6fdb34e495578fb5337ecd9bd3036dbfc 100644 |
--- a/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -5185,14 +5185,12 @@ static inline bool fastParseColorInternal(RGBA32& rgb, const CharacterType* char |
{ |
CSSPrimitiveValue::UnitTypes expect = CSSPrimitiveValue::CSS_UNKNOWN; |
+ if (length >= 4 && characters[0] == '#') |
+ return Color::parseHexColor(characters + 1, length - 1, rgb); |
+ |
if (!strict && length >= 3) { |
- if (characters[0] == '#') { |
- if (Color::parseHexColor(characters + 1, length - 1, rgb)) |
- return true; |
- } else { |
- if (Color::parseHexColor(characters, length, rgb)) |
- return true; |
- } |
+ if (Color::parseHexColor(characters, length, rgb)) |
+ return true; |
} |
// Try rgba() syntax. |