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

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

Issue 1376573004: Split out Color from CSSPrimitiveValue (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@split_property
Patch Set: Rebase and review feedback Created 5 years, 2 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/CSSParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
index f3b84fa6ab4a2c1805301e41f9bcc352a29ddf64..9fc5d92d6c4668a658bd1c75510bb985145649c5 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParser.cpp
@@ -5,6 +5,7 @@
#include "config.h"
#include "core/css/parser/CSSParser.h"
+#include "core/css/CSSColorValue.h"
#include "core/css/CSSKeyframeRule.h"
#include "core/css/StyleColor.h"
#include "core/css/StylePropertySet.h"
@@ -126,14 +127,9 @@ bool CSSParser::parseColor(RGBA32& color, const String& string, bool strict)
if (!value)
value = parseSingleValue(CSSPropertyColor, string, strictCSSParserContext());
- if (!value || !value->isPrimitiveValue())
+ if (!value || !value->isColorValue())
return false;
-
- CSSPrimitiveValue* primitiveValue = toCSSPrimitiveValue(value.get());
- if (!primitiveValue->isRGBColor())
- return false;
-
- color = primitiveValue->getRGBA32Value();
+ color = toCSSColorValue(*value).value();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698