aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2017-12-02 00:07:52 +0100
committerEmilio Cobos Álvarez <emilio@crisal.io>2017-12-05 10:06:24 +0100
commit23d69ea77ddb26df872ba560fed6c07553576e15 (patch)
tree3683e42b876784b7dc51b6741b567c538dbf8352 /tests
parente91c9ec7fedd832da2b7974096850b84d22373e8 (diff)
downloadservo-23d69ea77ddb26df872ba560fed6c07553576e15.tar.gz
servo-23d69ea77ddb26df872ba560fed6c07553576e15.zip
style: Support calc() in color functions.
Diffstat (limited to 'tests')
-rw-r--r--tests/wpt/metadata/MANIFEST.json10
-rw-r--r--tests/wpt/web-platform-tests/css/css-values/calc-in-color-001.html25
2 files changed, 35 insertions, 0 deletions
diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index 68306f7ae97..e58fa12d536 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -303223,6 +303223,12 @@
{}
]
],
+ "css/css-values/calc-in-color-001.html": [
+ [
+ "/css/css-values/calc-in-color-001.html",
+ {}
+ ]
+ ],
"css/css-values/calc-serialization.html": [
[
"/css/css-values/calc-serialization.html",
@@ -503720,6 +503726,10 @@
"be08a1510714e8b4fbc4d35582db5708924d06b2",
"reftest"
],
+ "css/css-values/calc-in-color-001.html": [
+ "32a0face898f08b854ac392c75368282d718be32",
+ "testharness"
+ ],
"css/css-values/calc-in-media-queries-001.html": [
"f8fdd8373eaca7a03d6a089b4faf71825c8bfaf2",
"reftest"
diff --git a/tests/wpt/web-platform-tests/css/css-values/calc-in-color-001.html b/tests/wpt/web-platform-tests/css/css-values/calc-in-color-001.html
new file mode 100644
index 00000000000..e87719b4fe7
--- /dev/null
+++ b/tests/wpt/web-platform-tests/css/css-values/calc-in-color-001.html
@@ -0,0 +1,25 @@
+<!doctype html>
+<meta charset="utf-8">
+<title>CSS Test: calc() function in &lt;color&gt;</title>
+<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
+<link rel="help" href="https://drafts.csswg.org/css-values/#funcdef-calc">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<div id="testNode"></div>
+<script>
+const div = document.querySelector("#testNode");
+const TESTS = {
+ // specified -> expected
+ "rgb(calc(0), calc(255 + 0), calc(140 - 139 - 1))": "rgb(0, 255, 0)",
+ "rgba(calc(0%) calc(100%) calc(0%) / calc(10% * 10))": "rgb(0, 255, 0)",
+ "hsl(calc(5deg * (360 / 5)), calc(10% * 10), calc(10% * 10))": "rgb(255, 255, 255)"
+}
+
+test(function() {
+ for (let test in TESTS) {
+ div.style.backgroundColor = "";
+ div.style.backgroundColor = test;
+ assert_equals(getComputedStyle(div).backgroundColor, TESTS[test], test);
+ }
+}, "calc() in color functions");
+</script>