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

Unified Diff: third_party/WebKit/Source/platform/graphics/Color.cpp

Issue 2629163002: Revert of Fix RGBA alpha parsing and serialization to adhere to W3 standard. (Closed)
Patch Set: fix conflicts Created 3 years, 11 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/platform/graphics/Color.cpp
diff --git a/third_party/WebKit/Source/platform/graphics/Color.cpp b/third_party/WebKit/Source/platform/graphics/Color.cpp
index 3b406bf1a1addf7976e8fa71e0d6b7eb4ab519bc..3ad2e4d84d59cb85ee67ae9928e4615f93b9b2ee 100644
--- a/third_party/WebKit/Source/platform/graphics/Color.cpp
+++ b/third_party/WebKit/Source/platform/graphics/Color.cpp
@@ -210,16 +210,7 @@ String Color::serializedAsCSSComponentValue() const {
result.appendNumber(static_cast<unsigned char>(blue()));
if (colorHasAlpha) {
result.append(", ");
- // See <alphavalue> section in
- // http://dev.w3.org/csswg/cssom/#serializing-css-values
- int alphavalue = alpha();
- float rounded = round(alphavalue * 100 / 255.0f) / 100;
- if (round(rounded * 255) == alphavalue) {
- result.appendNumber(rounded, 2);
- } else {
- rounded = round(alphavalue * 1000 / 255.0f) / 1000;
- result.appendNumber(rounded, 3);
- }
+ result.appendNumber(alpha() / 255.0f, 6);
}
result.append(')');

Powered by Google App Engine
This is Rietveld 408576698