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

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1122293002: Disallow hashless hex color quirk for non integer <number> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add test Created 5 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 | « LayoutTests/fast/css/parsing-color-quirk.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index d10f8b9cc0dfbe0e304264c470ff4129231d77ae..2cf259ef1eda10ecd30556e698a9c8ea93c97696 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -5289,6 +5289,8 @@ bool CSSPropertyParser::parseColorFromValue(CSSParserValue* value, RGBA32& c, bo
{
if (acceptQuirkyColors && value->unit == CSSPrimitiveValue::CSS_NUMBER
&& value->fValue >= 0. && value->fValue < 1000000.) {
+ if (!value->isInt)
+ return false;
String str = String::format("%06d", static_cast<int>((value->fValue+.5)));
if (!fastParseColor(c, str, !acceptQuirkyColors))
return false;
« no previous file with comments | « LayoutTests/fast/css/parsing-color-quirk.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698