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

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

Issue 2588293004: Clamp rgba(...) alpha value in the CSS fast-path parser (Closed)
Patch Set: Created 4 years 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/CSSParserFastPathsTest.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp b/third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp
index a464c2d836963e2442208589a77dff27f825e96a..250a2619677fc1bc1e6a1bb8f7187a88662c9b8c 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSParserFastPathsTest.cpp
@@ -4,6 +4,7 @@
#include "core/css/parser/CSSParserFastPaths.h"
+#include "core/css/CSSColorValue.h"
#include "core/css/CSSIdentifierValue.h"
#include "core/css/CSSValueList.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -98,4 +99,12 @@ TEST(CSSParserFastPathsTest, ParseInvalidTransform) {
ASSERT_EQ(nullptr, value);
}
+TEST(CSSParserFastPathsTest, ParseColorWithLargeAlpha) {
+ CSSValue* value = CSSParserFastPaths::parseColor("rgba(0,0,0,1893205797.13)",
+ HTMLStandardMode);
+ EXPECT_NE(nullptr, value);
+ EXPECT_TRUE(value->isColorValue());
+ EXPECT_EQ(Color::black, toCSSColorValue(*value).value());
+}
+
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698