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

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

Issue 1992793002: Fix hashless-hex-color.html quirks-mode test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Keep win7 debug entry 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/LayoutTests/TestExpectations ('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 3d678d73a50c6ba9d7abf3f442380782b632241d..75c8d85484e7599fb680799ea2d9e743f5a1f75f 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParserHelpers.cpp
@@ -404,7 +404,9 @@ static bool parseHexColor(CSSParserTokenRange& range, RGBA32& result, bool accep
{
const CSSParserToken& token = range.peek();
String color;
- if (acceptQuirkyColors) {
+ if (token.type() == HashToken) {
+ color = token.value();
+ } else if (acceptQuirkyColors) {
if (token.type() == NumberToken || token.type() == DimensionToken) {
if (token.numericValueType() != IntegerValueType
|| token.numericValue() < 0. || token.numericValue() >= 1000000.)
@@ -416,14 +418,12 @@ 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();
}
+ unsigned length = color.length();
+ if (length != 3 && length != 6)
+ return false;
}
- if (token.type() == HashToken)
- color = token.value();
if (!Color::parseHexColor(color, result))
return false;
range.consumeIncludingWhitespace();
« no previous file with comments | « third_party/WebKit/LayoutTests/TestExpectations ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698