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

Unified Diff: third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html

Issue 2606143002: Fix RGBA alpha parsing and serialization to adhere to W3 standard. (Closed)
Patch Set: fix blending Created 3 years, 12 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/LayoutTests/css-parser/serialize-css-alpha-value.html
diff --git a/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html b/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html
new file mode 100644
index 0000000000000000000000000000000000000000..25c9a95aa1e6772b35b2fd34b56111de86cfd065
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css-parser/serialize-css-alpha-value.html
@@ -0,0 +1,16 @@
+<!DOCTYPE html>
+<title>Harness Test: Floating point alpha values of numbers to two decimial places are serialized and returned correctly.</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<script>
+ document.body = document.createElement('body');
sashab 2017/01/02 23:04:15 Just put all this in a <body> tag
ktyliu 2017/01/03 02:14:22 Thanks for the tip Done
+ for (var i = 0.0; i <= 1.0; i += 0.01) {
+ var rgba = 'rgba(0, 0, 0, ' + parseFloat(i.toFixed(2)) + ')';
+ document.body.style.color = rgba;
sashab 2017/01/02 23:04:15 Move all this inside the test() body
ktyliu 2017/01/03 02:14:22 Done noted that putting test at top means that th
+ test(function() {
+ assert_equals(document.body.style.color, rgba);
+ assert_equals(getComputedStyle(document.body).color, rgba);
+ });
+ }
+</script>
+

Powered by Google App Engine
This is Rietveld 408576698