diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /testing/web-platform/tests/2dcontext/fill-and-stroke-styles | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'testing/web-platform/tests/2dcontext/fill-and-stroke-styles')
314 files changed, 7948 insertions, 0 deletions
diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/.gitkeep b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/.gitkeep new file mode 100644 index 000000000..e69de29bb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/.gitkeep diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.default.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.default.html new file mode 100644 index 000000000..a14475d7d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.default.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.default</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.default</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +_assertSame(ctx.fillStyle, '#000000', "ctx.fillStyle", "'#000000'"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html new file mode 100644 index 000000000..d8a1d4178 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.get.semitransparent</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.get.semitransparent</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(255,255,255,0.45)'; +assert_regexp_match(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.solid.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.solid.html new file mode 100644 index 000000000..8fc44b1c8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.solid.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.get.solid</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.get.solid</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#fa0'; +_assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.transparent.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.transparent.html new file mode 100644 index 000000000..3775cf3f9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.get.transparent.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.get.transparent</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.get.transparent</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = 'rgba(0,0,0,0)'; +_assertSame(ctx.fillStyle, 'rgba(0, 0, 0, 0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0)'"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidstring.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidstring.html new file mode 100644 index 000000000..eaa50dd02 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidstring.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.invalidstring</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.invalidstring</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = 'invalid'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidtype.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidtype.html new file mode 100644 index 000000000..fb778cbfb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.invalidtype.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.invalidtype</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.invalidtype</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillStyle = null; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html new file mode 100644 index 000000000..3dbda598b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120 100.0% 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html new file mode 100644 index 000000000..25e98dc79 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120 100.0% 50.0% / 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html new file mode 100644 index 000000000..de600d94b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html new file mode 100644 index 000000000..52d917c6c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html new file mode 100644 index 000000000..4f65b3dea --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html new file mode 100644 index 000000000..19aa5974f --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html new file mode 100644 index 000000000..d9b6a3c98 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-7</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-7</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-7.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(133.33333333grad, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html new file mode 100644 index 000000000..24e2b5183 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-8</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-8</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-8.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(2.0943951024rad, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html new file mode 100644 index 000000000..9da548f3e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsl-9</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsl-9</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsl-9.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(0.3333333333turn, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html new file mode 100644 index 000000000..65881eeb1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120 100.0% 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html new file mode 100644 index 000000000..91f5e3459 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120 100.0% 50.0% / 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html new file mode 100644 index 000000000..eb6c69526 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html new file mode 100644 index 000000000..ce5bdef7a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html new file mode 100644 index 000000000..47b426daf --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html new file mode 100644 index 000000000..6dc5e7aef --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html new file mode 100644 index 000000000..a1069fea9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-7</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-7</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-7.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(133.33333333grad, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html new file mode 100644 index 000000000..7d04b1ca5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-8</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-8</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-8.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(2.0943951024rad, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html new file mode 100644 index 000000000..0a10c6e61 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-hsla-9</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-hsla-9</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-hsla-9.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(0.3333333333turn, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html new file mode 100644 index 000000000..fd6376e1a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0, 255.0, 0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html new file mode 100644 index 000000000..ec0f62344 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0, 255, 0, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html new file mode 100644 index 000000000..980abef36 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0, 255, 0, 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html new file mode 100644 index 000000000..a2543b566 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0 255 0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html new file mode 100644 index 000000000..6b310d763 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0 255 0 / 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html new file mode 100644 index 000000000..d38f7e0ac --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgb-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgb-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgb-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0 255 0 / 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html new file mode 100644 index 000000000..83dfb2f86 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255.0, 0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html new file mode 100644 index 000000000..390d0bd0f --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html new file mode 100644 index 000000000..f0fd88ee6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html new file mode 100644 index 000000000..bd3e8edb2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0 255 0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html new file mode 100644 index 000000000..0287ef693 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0 255 0 / 0.2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html new file mode 100644 index 000000000..09042c877 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.css-color-4-rgba-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.css-color-4-rgba-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.css-color-4-rgba-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0 255 0 / 20%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,51, "50,25", "0,255,0,51"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.png Binary files differnew file mode 100644 index 000000000..c5661de82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.basic.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.basic.html new file mode 100644 index 000000000..271adfd8b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.basic.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.current.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.current.basic</h1> +<p class="desc">currentColor is computed from the canvas element</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("currentColor is computed from the canvas element"); +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.changed.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.changed.html new file mode 100644 index 000000000..591b6d256 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.changed.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.current.changed</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.current.changed</h1> +<p class="desc">currentColor is computed when the attribute is set, not when it is painted</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("currentColor is computed when the attribute is set, not when it is painted"); +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0'); +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'currentColor'; +canvas.setAttribute('style', 'color: #f00'); +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.notrendered.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.notrendered.html new file mode 100644 index 000000000..3e8f007f9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.notrendered.html @@ -0,0 +1,33 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.current.notrendered</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.current.basic</h1> +<p class="desc">currentColor is computed from the canvas element</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("currentColor is computed from the canvas element even when element is not rendered"); +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #0f0;'); +canvas.style.display = 'none'; +canvas.offsetTop; +ctx.fillStyle = 'currentColor'; +canvas.style.display = 'inline'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.html new file mode 100644 index 000000000..a46e9c975 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.current.removed</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.current.removed</h1> +<p class="desc">currentColor is solid black when the canvas element is not in a document</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.current.removed.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("currentColor is solid black when the canvas element is not in a document"); +_addTest(function(canvas, ctx) { + +// Try not to let it undetectably incorrectly pick up opaque-black +// from other parts of the document: +document.body.parentNode.setAttribute('style', 'color: #f00'); +document.body.setAttribute('style', 'color: #f00'); +canvas.setAttribute('style', 'color: #f00'); + +var canvas2 = document.createElement('canvas'); +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillStyle = 'currentColor'; +ctx2.fillRect(0, 0, 100, 50); +ctx.drawImage(canvas2, 0, 0); + +document.body.parentNode.removeAttribute('style'); +document.body.removeAttribute('style'); + +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.png Binary files differnew file mode 100644 index 000000000..d638d0338 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.current.removed.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html new file mode 100644 index 000000000..635a59a72 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hex3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hex3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html new file mode 100644 index 000000000..8462248e8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hex4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hex4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#0f0f'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html new file mode 100644 index 000000000..37a420800 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hex6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hex6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#00fF00'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html new file mode 100644 index 000000000..36ade5748 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hex8</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hex8</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex8.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = '#00ff00ff'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hex8.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html new file mode 100644 index 000000000..53b1f5d40 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html new file mode 100644 index 000000000..39790e979 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html new file mode 100644 index 000000000..2befaab2e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(360120, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html new file mode 100644 index 000000000..9f8e7cac1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html new file mode 100644 index 000000000..881bc0492 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html new file mode 100644 index 000000000..f2636336c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(+120, +100%, +50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html new file mode 100644 index 000000000..a2fce10dc --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-clamp-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 200%, 50%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html new file mode 100644 index 000000000..0a245a4df --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-clamp-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.png Binary files differnew file mode 100644 index 000000000..88fd82798 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html new file mode 100644 index 000000000..ed14332f8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-clamp-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, 200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.png Binary files differnew file mode 100644 index 000000000..bf48767a8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html new file mode 100644 index 000000000..a27379c5e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsl-clamp-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsl(120, 100%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.png Binary files differnew file mode 100644 index 000000000..d638d0338 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html new file mode 100644 index 000000000..2e835a8b3 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.png Binary files differnew file mode 100644 index 000000000..2aa6265f0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html new file mode 100644 index 000000000..a7db6ac10 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html new file mode 100644 index 000000000..13652aab1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html new file mode 100644 index 000000000..98f2505a5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.png Binary files differnew file mode 100644 index 000000000..88fd82798 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html new file mode 100644 index 000000000..0aa08807a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.png Binary files differnew file mode 100644 index 000000000..bf48767a8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html new file mode 100644 index 000000000..ab5da396c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.png Binary files differnew file mode 100644 index 000000000..d638d0338 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html new file mode 100644 index 000000000..a64f89303 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-5</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html new file mode 100644 index 000000000..60b464a62 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.hsla-clamp-6</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-6.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.png Binary files differnew file mode 100644 index 000000000..eeedd0ff0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.html new file mode 100644 index 000000000..3dd7d37eb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.html4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.html4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.html4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'limE'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.html4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html new file mode 100644 index 000000000..25bab97b0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsl-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 50% / 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html new file mode 100644 index 000000000..f4a47f5d8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsl-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0 100% 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html new file mode 100644 index 000000000..490c66f36 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsl-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100% 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html new file mode 100644 index 000000000..a3ab91c16 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsl-4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0 100% 50% /)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html new file mode 100644 index 000000000..a437cd99c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsl-5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 50% /)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html new file mode 100644 index 000000000..5f71de330 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsla-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 100%, 50% / 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html new file mode 100644 index 000000000..36c9fd1a6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsla-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0 100% 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html new file mode 100644 index 000000000..049ad397e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-hsla-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 100% 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html new file mode 100644 index 000000000..7a2534ceb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgb-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0, 0 / 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html new file mode 100644 index 000000000..ca5a591ef --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgb-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255 0 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html new file mode 100644 index 000000000..e34ddfdf9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgb-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html new file mode 100644 index 000000000..682da31d2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgb-4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(0 0 0 /)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html new file mode 100644 index 000000000..75a11dc19 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgb-5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(0, 0, 0 /)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html new file mode 100644 index 000000000..778fa479c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgba-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0 / 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html new file mode 100644 index 000000000..14c83a569 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgba-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255 0 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html new file mode 100644 index 000000000..9647877b2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.css-color-4-rgba-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html new file mode 100644 index 000000000..36a9489e1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html new file mode 100644 index 000000000..5a1758fc5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#f0'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html new file mode 100644 index 000000000..f1ada9f19 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#g00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html new file mode 100644 index 000000000..36e312d63 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#fg00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html new file mode 100644 index 000000000..19abea32a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html new file mode 100644 index 000000000..c600b9831 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex6</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#fg0000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html new file mode 100644 index 000000000..cee88055e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex7</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex7</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#ff0000f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html new file mode 100644 index 000000000..e835d2da0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hex8</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hex8</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '#fg0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html new file mode 100644 index 000000000..3acee1f39 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0%, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html new file mode 100644 index 000000000..c2c34f524 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html new file mode 100644 index 000000000..616639a1e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html new file mode 100644 index 000000000..aaa2a8dc0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html new file mode 100644 index 000000000..0e3f85148 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100.%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html new file mode 100644 index 000000000..6343ab125 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-6</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsl-6</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsl(0, 100%, 50%,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html new file mode 100644 index 000000000..dbddb0f55 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsla-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsla-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html new file mode 100644 index 000000000..8a9643f88 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsla-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsla-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html new file mode 100644 index 000000000..698a6cb9a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.hsla-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.hsla-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'hsla(0, 0, 50%, 1,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html new file mode 100644 index 000000000..45dcfca0c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.name-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.name-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html new file mode 100644 index 000000000..a3016b2a1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.name-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.name-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html new file mode 100644 index 000000000..1d56151b6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.name-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.name-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html new file mode 100644 index 000000000..e2619ffa8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.name-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.name-4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '"red"'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html new file mode 100644 index 000000000..f515ff32e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.name-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.name-5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = '"red'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html new file mode 100644 index 000000000..66fb8e13d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgb-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html new file mode 100644 index 000000000..7f9457c82 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgb-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html new file mode 100644 index 000000000..2530569c2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgb-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html new file mode 100644 index 000000000..1dc343ad1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgba-1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html new file mode 100644 index 000000000..5f5bb7941 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgba-2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html new file mode 100644 index 000000000..67ed7f2a2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgba-3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1.)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html new file mode 100644 index 000000000..aea9725a2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgba-4</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, '; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html new file mode 100644 index 000000000..a149ed343 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.invalid.rgba-5</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#0f0'; +try { ctx.fillStyle = 'rgba(255, 0, 0, 1,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html new file mode 100644 index 000000000..807a4961b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-clamp-1</h1> +<p class="desc"></p> + +<p class="notes">Assumes colours are clamped to [0,255]. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html new file mode 100644 index 000000000..46b3b6daa --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-clamp-2</h1> +<p class="desc"></p> + +<p class="notes">Assumes colours are clamped to [0,255]. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html new file mode 100644 index 000000000..75dbe19c6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-clamp-3</h1> +<p class="desc"></p> + +<p class="notes">Assumes colours are clamped to [0,255]. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html new file mode 100644 index 000000000..4888816b6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-clamp-4</h1> +<p class="desc"></p> + +<p class="notes">Assumes colours are clamped to [0,255]. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html new file mode 100644 index 000000000..3f7a94433 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-5</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-clamp-5</h1> +<p class="desc"></p> + +<p class="notes">Assumes colours are clamped to [0,255]. +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-5.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html new file mode 100644 index 000000000..0d2833ceb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-eof</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-eof</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-eof.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0, 255, 0'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html new file mode 100644 index 000000000..85fc99280 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-num</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-num</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-num.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0,255,0)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html new file mode 100644 index 000000000..295e72b0d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgb-percent</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgb-percent</h1> +<p class="desc"></p> + +<p class="notes">CSS3 Color says "The integer value 255 corresponds to 100%". (In particular, it is not 254...) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-percent.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgb(0% ,100% ,0%)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html new file mode 100644 index 000000000..0ec2ea0a1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-clamp-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-clamp-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-clamp-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, -2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.png Binary files differnew file mode 100644 index 000000000..eeedd0ff0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html new file mode 100644 index 000000000..fe3520157 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-clamp-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-clamp-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-clamp-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 2)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html new file mode 100644 index 000000000..d8856813d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-eof</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-eof</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-eof.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0, 255, 0, 1'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html new file mode 100644 index 000000000..98dd9bf87 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-num-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-num-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-num-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.png Binary files differnew file mode 100644 index 000000000..2aa6265f0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html new file mode 100644 index 000000000..5cadec16c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-num-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-num-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-num-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.png Binary files differnew file mode 100644 index 000000000..2aa6265f0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html new file mode 100644 index 000000000..63f8c9ea9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-percent</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-percent</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-percent.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba(0%,100%,0%,0.499)'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.png Binary files differnew file mode 100644 index 000000000..2aa6265f0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html new file mode 100644 index 000000000..0d08a4921 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-solid-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-solid-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html new file mode 100644 index 000000000..2a9db38ed --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-solid-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-solid-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html new file mode 100644 index 000000000..81bf257cd --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-solid-3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-solid-3</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-3.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( 0 , 255 , 0 , +1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html new file mode 100644 index 000000000..82d450c01 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.rgba-solid-4</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.rgba-solid-4</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-4.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'rgba( -0 , 255 , +0 , 1 )'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.png Binary files differnew file mode 100644 index 000000000..2733836c9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html new file mode 100644 index 000000000..c49620f03 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.svg-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.svg-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.svg-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'gray'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.png Binary files differnew file mode 100644 index 000000000..5bc39cc69 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html new file mode 100644 index 000000000..3a7e3d97e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.svg-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.svg-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.svg-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'grey'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.png Binary files differnew file mode 100644 index 000000000..5bc39cc69 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.system.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.system.html new file mode 100644 index 000000000..9bb43c623 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.system.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.system</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.system</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'ThreeDDarkShadow'; +assert_regexp_match(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/); // test that it's not red + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html new file mode 100644 index 000000000..36cc80437 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.transparent-1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.transparent-1</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.transparent-1.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'transparent'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.png Binary files differnew file mode 100644 index 000000000..eeedd0ff0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html new file mode 100644 index 000000000..66e282598 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.fillStyle.parse.transparent-2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.fillStyle.parse.transparent-2</h1> +<p class="desc"></p> + +<p class="notes"> +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.transparent-2.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + + +ctx.fillStyle = '#f00'; +ctx.fillStyle = 'TrAnSpArEnT'; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.png Binary files differnew file mode 100644 index 000000000..eeedd0ff0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html new file mode 100644 index 000000000..e087f53c3 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.empty.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.empty</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.empty</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 0, 50); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html new file mode 100644 index 000000000..7bf486da4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.alpha</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.alpha</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.alpha.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#ff0'; +ctx.fillRect(0, 0, 100, 50); +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(0,0,255, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png Binary files differnew file mode 100644 index 000000000..67f344359 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html new file mode 100644 index 000000000..a5fd632b5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.colour</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.colour</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.colour.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3); +_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.png Binary files differnew file mode 100644 index 000000000..67f344359 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colour.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html new file mode 100644 index 000000000..ad18881da --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.colouralpha</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.colouralpha</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.colouralpha.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'rgba(255,255,0, 0)'); +g.addColorStop(1, 'rgba(0,0,255, 1)'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 25,25, 190,190,65,65, "25,25", "190,190,65,65", 3); +_assertPixelApprox(canvas, 50,25, 126,126,128,128, "50,25", "126,126,128,128", 3); +_assertPixelApprox(canvas, 75,25, 62,62,192,192, "75,25", "62,62,192,192", 3); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.png Binary files differnew file mode 100644 index 000000000..af6e50b7d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html new file mode 100644 index 000000000..b6b8de135 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.multiple</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.multiple</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.multiple.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.5, '#0ff'); +g.addColorStop(1, '#f0f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 50,25, 127,255,127,255, "50,25", "127,255,127,255", 3); +_assertPixelApprox(canvas, 100,25, 0,255,255,255, "100,25", "0,255,255,255", 3); +_assertPixelApprox(canvas, 150,25, 127,127,255,255, "150,25", "127,127,255,255", 3); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png Binary files differnew file mode 100644 index 000000000..8f31ec369 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html new file mode 100644 index 000000000..7577c95e3 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.outside.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.outside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.outside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(25, 0, 75, 0); +g.addColorStop(0.4, '#0f0'); +g.addColorStop(0.6, '#0f0'); + +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 20,25, 0,255,0,255, "20,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); +_assertPixelApprox(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255", 2); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html new file mode 100644 index 000000000..ad2152f12 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html @@ -0,0 +1,52 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.overlap</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.overlap</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.overlap.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +canvas.width = 200; +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0, '#ff0'); +g.addColorStop(0.25, '#00f'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.25, '#ff0'); +g.addColorStop(0.5, '#00f'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.75, '#00f'); +g.addColorStop(0.75, '#f00'); +g.addColorStop(0.75, '#ff0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.5, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 200, 50); +_assertPixelApprox(canvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 51,25, 255,255,0,255, "51,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 101,25, 255,255,0,255, "101,25", "255,255,0,255", 16); +_assertPixelApprox(canvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255", 16); +_assertPixelApprox(canvas, 151,25, 255,255,0,255, "151,25", "255,255,0,255", 16); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png Binary files differnew file mode 100644 index 000000000..7d4dad8de --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html new file mode 100644 index 000000000..7f99c1f32 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.overlap2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.overlap2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ]; +for (var p = 0; p < ps.length; ++p) +{ + g.addColorStop(ps[p], '#0f0'); + for (var i = 0; i < 15; ++i) + g.addColorStop(ps[p], '#f00'); + g.addColorStop(ps[p], '#0f0'); +} +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 30,25, 0,255,0,255, "30,25", "0,255,0,255"); +_assertPixel(canvas, 40,25, 0,255,0,255, "40,25", "0,255,0,255"); +_assertPixel(canvas, 60,25, 0,255,0,255, "60,25", "0,255,0,255"); +_assertPixel(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html new file mode 100644 index 000000000..46e53d326 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.solid.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.solid</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.solid</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html new file mode 100644 index 000000000..a4c3453cf --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.vertical</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.vertical</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.vertical.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 0, 50); +g.addColorStop(0, '#ff0'); +g.addColorStop(1, '#00f'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,12, 191,191,63,255, "50,12", "191,191,63,255", 10); +_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 5); +_assertPixelApprox(canvas, 50,37, 63,63,191,255, "50,37", "63,63,191,255", 10); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png Binary files differnew file mode 100644 index 000000000..1d895a18f --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html new file mode 100644 index 000000000..92777bfef --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.fill</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.fill</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.rect(0, 0, 100, 50); +ctx.fill(); +_assertPixel(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html new file mode 100644 index 000000000..98efeda7c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.fillRect</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.fillRect</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixel(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html new file mode 100644 index 000000000..93397b976 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.fillText</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.fillText</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.font = '100px sans-serif'; +ctx.fillText("AA", 0, 50); +_assertGreen(ctx, 100, 50); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html new file mode 100644 index 000000000..69e2de6f4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.stroke</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.stroke</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.strokeStyle = g; +ctx.rect(20, 20, 60, 10); +ctx.stroke(); +_assertPixel(canvas, 19,19, 0,255,0,255, "19,19", "0,255,0,255"); +_assertPixel(canvas, 20,19, 0,255,0,255, "20,19", "0,255,0,255"); +_assertPixel(canvas, 21,19, 0,255,0,255, "21,19", "0,255,0,255"); +_assertPixel(canvas, 19,20, 0,255,0,255, "19,20", "0,255,0,255"); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); +_assertPixel(canvas, 21,20, 0,255,0,255, "21,20", "0,255,0,255"); +_assertPixel(canvas, 19,21, 0,255,0,255, "19,21", "0,255,0,255"); +_assertPixel(canvas, 20,21, 0,255,0,255, "20,21", "0,255,0,255"); +_assertPixel(canvas, 21,21, 0,255,0,255, "21,21", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html new file mode 100644 index 000000000..7eff74d80 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.strokeRect</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.strokeRect</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.strokeStyle = g; +ctx.strokeRect(20, 20, 60, 10); +_assertPixel(canvas, 19,19, 0,255,0,255, "19,19", "0,255,0,255"); +_assertPixel(canvas, 20,19, 0,255,0,255, "20,19", "0,255,0,255"); +_assertPixel(canvas, 21,19, 0,255,0,255, "21,19", "0,255,0,255"); +_assertPixel(canvas, 19,20, 0,255,0,255, "19,20", "0,255,0,255"); +_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255"); +_assertPixel(canvas, 21,20, 0,255,0,255, "21,20", "0,255,0,255"); +_assertPixel(canvas, 19,21, 0,255,0,255, "19,21", "0,255,0,255"); +_assertPixel(canvas, 20,21, 0,255,0,255, "20,21", "0,255,0,255"); +_assertPixel(canvas, 21,21, 0,255,0,255, "21,21", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html new file mode 100644 index 000000000..d384cc01d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.interpolate.zerosize.strokeText</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.interpolate.zerosize.strokeText</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction) +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.strokeStyle = g; +ctx.font = '100px sans-serif'; +ctx.strokeText("AA", 0, 50); +_assertGreen(ctx, 100, 50); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html new file mode 100644 index 000000000..b60b30438 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.linear.nonfinite</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.linear.nonfinite</h1> +<p class="desc">createLinearGradient() throws TypeError if arguments are not finite</p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("createLinearGradient() throws TypeError if arguments are not finite"); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(NaN, 0, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, -Infinity, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, NaN, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, -Infinity, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, NaN, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, -Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, 1, NaN); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html new file mode 100644 index 000000000..3a4d24a39 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.1.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.linear.transform.1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.linear.transform.1</h1> +<p class="desc">Linear gradient coordinates are relative to the coordinate space at the time of filling</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Linear gradient coordinates are relative to the coordinate space at the time of filling"); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html new file mode 100644 index 000000000..56957a0a2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.2.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.linear.transform.2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.linear.transform.2</h1> +<p class="desc">Linear gradient coordinates are relative to the coordinate space at the time of filling</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Linear gradient coordinates are relative to the coordinate space at the time of filling"); +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-150, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html new file mode 100644 index 000000000..6cc2ead2f --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.linear.transform.3.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.linear.transform.3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.linear.transform.3</h1> +<p class="desc">Linear gradient transforms do not experience broken caching effects</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Linear gradient transforms do not experience broken caching effects"); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(0.25, '#0f0'); +g.addColorStop(0.75, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(-50, 0); +ctx.fillRect(50, 0, 100, 50); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.compare.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.compare.html new file mode 100644 index 000000000..67089a073 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.compare.html @@ -0,0 +1,31 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.compare</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.compare</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +var g2 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1, g2, "g1", "g2"); +ctx.fillStyle = g1; +_assertSame(ctx.fillStyle, g1, "ctx.fillStyle", "g1"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html new file mode 100644 index 000000000..95144c6af --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.crosscanvas</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.crosscanvas</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html new file mode 100644 index 000000000..35709cbd1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.html @@ -0,0 +1,37 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.current</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.current</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="2d.gradient.object.current.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +canvas.setAttribute('style', 'color: #f00'); + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createLinearGradient(0, 0, 100, 0); +g.addColorStop(0, 'currentColor'); +g.addColorStop(1, 'currentColor'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255", 2); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.png b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.png Binary files differnew file mode 100644 index 000000000..d638d0338 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.current.png diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidcolour.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidcolour.html new file mode 100644 index 000000000..7687d0b94 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidcolour.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.invalidcolour</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.invalidcolour</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +assert_throws("SYNTAX_ERR", function() { g.addColorStop(0, ""); }); +assert_throws("SYNTAX_ERR", function() { g.addColorStop(0, 'null'); }); +assert_throws("SYNTAX_ERR", function() { g.addColorStop(0, 'undefined'); }); +assert_throws("SYNTAX_ERR", function() { g.addColorStop(0, null); }); +assert_throws("SYNTAX_ERR", function() { g.addColorStop(0, undefined); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html new file mode 100644 index 000000000..2dce28b66 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html @@ -0,0 +1,32 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.invalidoffset</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.invalidoffset</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(0, 0, 100, 0); +assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(-1, '#000'); }); +assert_throws("INDEX_SIZE_ERR", function() { g.addColorStop(2, '#000'); }); +assert_throws(new TypeError(), function() { g.addColorStop(Infinity, '#000'); }); +assert_throws(new TypeError(), function() { g.addColorStop(-Infinity, '#000'); }); +assert_throws(new TypeError(), function() { g.addColorStop(NaN, '#000'); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html new file mode 100644 index 000000000..bcb4dc7af --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.return.html @@ -0,0 +1,35 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.return</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.return</h1> +<p class="desc">createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient"); +_addTest(function(canvas, ctx) { + +window.CanvasGradient.prototype.thisImplementsCanvasGradient = true; + +var g1 = ctx.createLinearGradient(0, 0, 100, 0); +_assertDifferent(g1.addColorStop, undefined, "g1.addColorStop", "undefined"); +_assertSame(g1.thisImplementsCanvasGradient, true, "g1.thisImplementsCanvasGradient", "true"); + +var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20); +_assertDifferent(g2.addColorStop, undefined, "g2.addColorStop", "undefined"); +_assertSame(g2.thisImplementsCanvasGradient, true, "g2.thisImplementsCanvasGradient", "true"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html new file mode 100644 index 000000000..27c91312c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.type.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.type</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.type</h1> +<p class="desc">window.CanvasGradient exists and has the right properties</p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("window.CanvasGradient exists and has the right properties"); +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasGradient, undefined, "window.CanvasGradient", "undefined"); +_assertDifferent(window.CanvasGradient.prototype.addColorStop, undefined, "window.CanvasGradient.prototype.addColorStop", "undefined"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.update.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.update.html new file mode 100644 index 000000000..8151c42f9 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.object.update.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.object.update</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.object.update</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var g = ctx.createLinearGradient(-100, 0, 200, 0); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +g.addColorStop(0.1, '#0f0'); +g.addColorStop(0.9, '#0f0'); +ctx.fillRect(0, 0, 100, 50); +_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html new file mode 100644 index 000000000..5bf367ea0 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.behind</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.behind</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html new file mode 100644 index 000000000..6c7dbaa2a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.beside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.beside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html new file mode 100644 index 000000000..362d23293 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.bottom</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.bottom</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html new file mode 100644 index 000000000..a2f189d83 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.cylinder</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.cylinder</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html new file mode 100644 index 000000000..3ed6190b2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.front.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.front</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.front</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html new file mode 100644 index 000000000..992c06805 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.shape1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.shape1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#f00'; +ctx.beginPath(); +ctx.moveTo(30+tol, 40); +ctx.lineTo(110, -20+tol); +ctx.lineTo(110, 100-tol); +ctx.fill(); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html new file mode 100644 index 000000000..cf9bd6d42 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html @@ -0,0 +1,53 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.shape2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.shape2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var tol = 1; // tolerance to avoid antialiasing artifacts + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.beginPath(); +ctx.moveTo(30-tol, 40); +ctx.lineTo(110, -20-tol); +ctx.lineTo(110, 100+tol); +ctx.fill(); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html new file mode 100644 index 000000000..fa60a0cfc --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.cone.top.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.cone.top</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.cone.top</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html new file mode 100644 index 000000000..f96b9761c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.equal.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.equal</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.equal</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html new file mode 100644 index 000000000..ab656ce27 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside1.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.inside1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.inside1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html new file mode 100644 index 000000000..30f4c49b8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside2.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.inside2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.inside2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html new file mode 100644 index 000000000..56c12a5b8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.inside3.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.inside3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.inside3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(0.993, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.negative.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.negative.html new file mode 100644 index 000000000..29242165f --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.negative.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.negative</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.negative</h1> +<p class="desc">createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative"); +_addTest(function(canvas, ctx) { + +assert_throws("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); }); +assert_throws("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); }); +assert_throws("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html new file mode 100644 index 000000000..e12d5142a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html @@ -0,0 +1,101 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.nonfinite</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.nonfinite</h1> +<p class="desc">createRadialGradient() throws TypeError if arguments are not finite</p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test("createRadialGradient() throws TypeError if arguments are not finite"); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); }); +assert_throws(new TypeError(), function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html new file mode 100644 index 000000000..e2c68d66b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside1.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.outside1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.outside1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#0f0'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html new file mode 100644 index 000000000..254db4574 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside2.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.outside2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.outside2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3.html new file mode 100644 index 000000000..4324bc717 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.outside3.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.outside3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.outside3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.001, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html new file mode 100644 index 000000000..5e42c4094 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch1.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.touch1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.touch1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html new file mode 100644 index 000000000..37dfd5ea8 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch2.html @@ -0,0 +1,46 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.touch2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.touch2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150); +g.addColorStop(0, '#f00'); +g.addColorStop(0.01, '#0f0'); +g.addColorStop(0.99, '#0f0'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html new file mode 100644 index 000000000..e401d19b4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.touch3.html @@ -0,0 +1,44 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.touch3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.touch3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50); +g.addColorStop(0, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html new file mode 100644 index 000000000..92355825e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.1.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.transform.1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.transform.1</h1> +<p class="desc">Radial gradient coordinates are relative to the coordinate space at the time of filling</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Radial gradient coordinates are relative to the coordinate space at the time of filling"); +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html new file mode 100644 index 000000000..ce7841f3b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.2.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.transform.2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.transform.2</h1> +<p class="desc">Radial gradient coordinates are relative to the coordinate space at the time of filling</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Radial gradient coordinates are relative to the coordinate space at the time of filling"); +_addTest(function(canvas, ctx) { + +ctx.translate(100, 0); +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.translate(-50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html new file mode 100644 index 000000000..ee9e6303b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.gradient.radial.transform.3.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.gradient.radial.transform.3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.gradient.radial.transform.3</h1> +<p class="desc">Radial gradient transforms do not experience broken caching effects</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Radial gradient transforms do not experience broken caching effects"); +_addTest(function(canvas, ctx) { + +var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2); +g.addColorStop(0, '#0f0'); +g.addColorStop(0.5, '#0f0'); +g.addColorStop(0.51, '#f00'); +g.addColorStop(1, '#f00'); +ctx.fillStyle = g; +ctx.fillRect(0, 0, 100, 50); +ctx.translate(50, 25); +ctx.scale(10, 10); +ctx.fillRect(-5, -2.5, 10, 5); +_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html new file mode 100644 index 000000000..c78ef377b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.animated.gif.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.animated.gif</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.animated.gif</h1> +<p class="desc">createPattern() of an animated GIF draws the first frame</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("createPattern() of an animated GIF draws the first frame"); +_addTest(function(canvas, ctx) { + +deferTest(); +setTimeout(function () { + var pattern = ctx.createPattern(document.getElementById('anim-gr.gif'), 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 50, 50); + setTimeout(t.step_func_done(function () { + ctx.fillRect(50, 0, 50, 50); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2); + }), 250); +}, 250); + + +}); +</script> +<img src="/images/anim-gr.gif" id="anim-gr.gif" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.canvas.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.canvas.html new file mode 100644 index 000000000..3bdc679c5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.canvas.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.basic.canvas</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.basic.canvas</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.image.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.image.html new file mode 100644 index 000000000..9ae64e4f5 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.image.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.basic.image</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.basic.image</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.nocontext.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.nocontext.html new file mode 100644 index 000000000..a24958702 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.nocontext.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.basic.nocontext</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.basic.nocontext</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.type.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.type.html new file mode 100644 index 000000000..07ca39923 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.type.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.basic.type</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.basic.type</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +_assertDifferent(window.CanvasPattern, undefined, "window.CanvasPattern", "undefined"); + +window.CanvasPattern.prototype.thisImplementsCanvasPattern = true; + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html new file mode 100644 index 000000000..aa393b8f7 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.basic.zerocanvas</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.basic.zerocanvas</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +canvas.width = 0; +canvas.height = 10; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 10, "canvas.height", "10"); +assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + +canvas.width = 10; +canvas.height = 0; +_assertSame(canvas.width, 10, "canvas.width", "10"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + +canvas.width = 0; +canvas.height = 0; +_assertSame(canvas.width, 0, "canvas.width", "0"); +_assertSame(canvas.height, 0, "canvas.height", "0"); +assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.crosscanvas.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.crosscanvas.html new file mode 100644 index 000000000..dc80720bb --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.crosscanvas.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.crosscanvas</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.crosscanvas</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); + +var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat'); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html new file mode 100644 index 000000000..31c8e8f2a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.broken.html @@ -0,0 +1,29 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.broken</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.broken</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('broken.png'); +assert_throws("INVALID_STATE_ERR", function() { ctx.createPattern(img, 'repeat'); }); + + +}); +</script> +<img src="/images/broken.png" id="broken.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.emptysrc.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.emptysrc.html new file mode 100644 index 000000000..23f453ac1 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.emptysrc.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.incomplete.emptysrc</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.incomplete.emptysrc</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('red.png'); +img.src = ""; +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); +</script> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.immediate.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.immediate.html new file mode 100644 index 000000000..176cf722a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.immediate.html @@ -0,0 +1,34 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.incomplete.immediate</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.incomplete.immediate</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = new Image(); +img.src = '../images/red.png'; +// This triggers the "update the image data" algorithm. +// The image will not go to the "completely available" state +// until a fetch task in the networking task source is processed, +// so the image must not be fully decodable yet: +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); +</script> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.nosrc.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.nosrc.html new file mode 100644 index 000000000..88b8801b2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.nosrc.html @@ -0,0 +1,28 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.incomplete.nosrc</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.incomplete.nosrc</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = new Image(); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.reload.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.reload.html new file mode 100644 index 000000000..095055c21 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.reload.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.incomplete.reload</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.incomplete.reload</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('yellow.png'); +img.src = '../images/red.png'; +// This triggers the "update the image data" algorithm, +// and resets the image to the "unavailable" state. +// The image will not go to the "completely available" state +// until a fetch task in the networking task source is processed, +// so the image must not be fully decodable yet: +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); +</script> +<img src="/images/yellow.png" id="yellow.png" class="resource"> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.removedsrc.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.removedsrc.html new file mode 100644 index 000000000..514f0609c --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.incomplete.removedsrc.html @@ -0,0 +1,30 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.incomplete.removedsrc</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.incomplete.removedsrc</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('red.png'); +img.removeAttribute('src'); +_assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); + + +}); +</script> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html new file mode 100644 index 000000000..5b8c68817 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.null.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.null</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.null</h1> +<p class="desc"></p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.createPattern(null, 'repeat'); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html new file mode 100644 index 000000000..834d92187 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.string.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.string</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.string</h1> +<p class="desc"></p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.createPattern('../images/red.png', 'repeat'); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html new file mode 100644 index 000000000..24f650d97 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.image.undefined.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.image.undefined</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.image.undefined</h1> +<p class="desc"></p> + +<p class="notes">Defined in "Web IDL" (draft) +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws(new TypeError(), function() { ctx.createPattern(undefined, 'repeat'); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas1.html new file mode 100644 index 000000000..f60da5bac --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas1.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.modify.canvas1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.modify.canvas1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas2.html new file mode 100644 index 000000000..db7a8b842 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.canvas2.html @@ -0,0 +1,49 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.modify.canvas2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.modify.canvas2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 0, 100, 50); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image1.html new file mode 100644 index 000000000..cfc8a965d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image1.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.modify.image1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.modify.image1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +deferTest(); +img.onload = t.step_func_done(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '/images/red.png'; + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image2.html new file mode 100644 index 000000000..c7f2ee3bf --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.modify.image2.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.modify.image2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.modify.image2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#00f'; +ctx.fillRect(0, 0, 100, 50); +deferTest(); +img.onload = t.step_func_done(function () +{ + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); + _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); + _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); + _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); +}); +img.src = '/images/red.png'; + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html new file mode 100644 index 000000000..431437e5b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.norepeat.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.norepeat.basic</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html new file mode 100644 index 000000000..a560fd8dc --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.norepeat.coord1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.norepeat.coord1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html new file mode 100644 index 000000000..9ae289872 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.norepeat.coord2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.norepeat.coord2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('green.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 50, 50); + +ctx.fillStyle = '#f00'; +ctx.fillRect(50, 0, 50, 50); + +ctx.fillStyle = pattern; +ctx.translate(50, 0); +ctx.fillRect(-50, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green.png" id="green.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html new file mode 100644 index 000000000..9c1b5ae6d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.norepeat.coord3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.norepeat.coord3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 50, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html new file mode 100644 index 000000000..3dce7a686 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.norepeat.outside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.norepeat.outside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = pattern; +ctx.fillRect(0, -50, 100, 50); +ctx.fillRect(-100, 0, 100, 50); +ctx.fillRect(0, 50, 100, 50); +ctx.fillRect(100, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red.png" id="red.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html new file mode 100644 index 000000000..70966e00a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html @@ -0,0 +1,48 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.orientation.canvas</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.orientation.canvas</h1> +<p class="desc">Canvas patterns do not get flipped when painted</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Canvas patterns do not get flipped when painted"); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var canvas2 = document.createElement('canvas'); +canvas2.width = 100; +canvas2.height = 50; +var ctx2 = canvas2.getContext('2d'); +ctx2.fillStyle = '#f00'; +ctx2.fillRect(0, 0, 100, 25); +ctx2.fillStyle = '#0f0'; +ctx2.fillRect(0, 25, 100, 25); + +var pattern = ctx.createPattern(canvas2, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html new file mode 100644 index 000000000..7d109c55a --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.orientation.image</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.orientation.image</h1> +<p class="desc">Image patterns do not get flipped when painted</p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test("Image patterns do not get flipped when painted"); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rrgg-256x256.png'); +var pattern = ctx.createPattern(img, 'no-repeat'); +ctx.fillStyle = pattern; +ctx.save(); +ctx.translate(0, -103); +ctx.fillRect(0, 103, 100, 50); +ctx.restore(); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 25); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/rrgg-256x256.png" id="rrgg-256x256.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html new file mode 100644 index 000000000..501fe67e4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeat.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeat.basic</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green-16x16.png" id="green-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html new file mode 100644 index 000000000..4aa75d155 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeat.coord1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeat.coord1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html new file mode 100644 index 000000000..0fe8b6a56 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html @@ -0,0 +1,36 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeat.coord2</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeat.coord2</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('ggrr-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/ggrr-256x256.png" id="ggrr-256x256.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html new file mode 100644 index 000000000..b361c91f2 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html @@ -0,0 +1,39 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeat.coord3</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeat.coord3</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +var img = document.getElementById('rgrg-256x256.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.translate(-128, -78); +ctx.fillRect(128, 78, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html new file mode 100644 index 000000000..68d2fe84e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html @@ -0,0 +1,40 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeat.outside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeat.outside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat'); +ctx.fillStyle = pattern; +ctx.translate(50, 25); +ctx.fillRect(-50, -25, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green-16x16.png" id="green-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html new file mode 100644 index 000000000..3cec292a4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeatx.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeatx.basic</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 16); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green-16x16.png" id="green-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html new file mode 100644 index 000000000..1e864a729 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeatx.coord1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeatx.coord1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.translate(0, 16); +ctx.fillRect(0, -16, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255"); +_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red-16x16.png" id="red-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html new file mode 100644 index 000000000..074c4afa4 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeatx.outside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeatx.outside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-x'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 16); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red-16x16.png" id="red-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html new file mode 100644 index 000000000..0da99d28d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeaty.basic</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeaty.basic</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 16, 50); + +var img = document.getElementById('green-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green-16x16.png" id="green-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html new file mode 100644 index 000000000..2f42a4e2d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeaty.coord1</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeaty.coord1</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.translate(48, 0); +ctx.fillRect(-48, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red-16x16.png" id="red-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html new file mode 100644 index 000000000..9ec618a9d --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html @@ -0,0 +1,42 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.paint.repeaty.outside</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.paint.repeaty.outside</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 100, 50); + +var img = document.getElementById('red-16x16.png'); +var pattern = ctx.createPattern(img, 'repeat-y'); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 100, 50); + +ctx.fillStyle = '#0f0'; +ctx.fillRect(0, 0, 16, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/red-16x16.png" id="red-16x16.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.case.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.case.html new file mode 100644 index 000000000..5a4bf344b --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.case.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.case</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.case</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws("SYNTAX_ERR", function() { ctx.createPattern(canvas, "Repeat"); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.empty.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.empty.html new file mode 100644 index 000000000..a71908721 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.empty.html @@ -0,0 +1,38 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.empty</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.empty</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> +<p class="output expectedtext">Expected output:<p><img src="/images/green-100x50.png" class="output expected" id="expected" alt=""> +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +ctx.fillStyle = '#f00'; +ctx.fillRect(0, 0, 100, 50); +var img = document.getElementById('green-1x1.png'); +var pattern = ctx.createPattern(img, ""); +ctx.fillStyle = pattern; +ctx.fillRect(0, 0, 200, 50); + +_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255"); +_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255"); +_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255"); +_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255"); + + +}); +</script> +<img src="/images/green-1x1.png" id="green-1x1.png" class="resource"> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.null.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.null.html new file mode 100644 index 000000000..25caf6c2e --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.null.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.null</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.null</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +_assert(ctx.createPattern(canvas, null) != null, "ctx.createPattern(canvas, null) != null"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html new file mode 100644 index 000000000..371304204 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.nullsuffix</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.nullsuffix</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws("SYNTAX_ERR", function() { ctx.createPattern(canvas, "repeat\0"); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.undefined.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.undefined.html new file mode 100644 index 000000000..74cd84b33 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.undefined.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.undefined</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.undefined</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws("SYNTAX_ERR", function() { ctx.createPattern(canvas, undefined); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html new file mode 100644 index 000000000..ff4d50a73 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.unrecognised</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.unrecognised</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws("SYNTAX_ERR", function() { ctx.createPattern(canvas, "invalid"); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html new file mode 100644 index 000000000..57df03be6 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.pattern.repeat.unrecognisednull</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.pattern.repeat.unrecognisednull</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +assert_throws("SYNTAX_ERR", function() { ctx.createPattern(canvas, "null"); }); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.strokeStyle.default.html b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.strokeStyle.default.html new file mode 100644 index 000000000..6e07d6086 --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/2d.strokeStyle.default.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<!-- DO NOT EDIT! This test has been generated by tools/gentest.py. --> +<title>Canvas test: 2d.strokeStyle.default</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/common/canvas-tests.js"></script> +<link rel="stylesheet" href="/common/canvas-tests.css"> +<body class="show_output"> + +<h1>2d.strokeStyle.default</h1> +<p class="desc"></p> + + +<p class="output">Actual output:</p> +<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas> + +<ul id="d"></ul> +<script> +var t = async_test(""); +_addTest(function(canvas, ctx) { + +_assertSame(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'"); + + +}); +</script> + diff --git a/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/canvas_colorsandstyles_createlineargradient_001.htm b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/canvas_colorsandstyles_createlineargradient_001.htm new file mode 100644 index 000000000..5b77c98de --- /dev/null +++ b/testing/web-platform/tests/2dcontext/fill-and-stroke-styles/canvas_colorsandstyles_createlineargradient_001.htm @@ -0,0 +1,59 @@ +<!doctype HTML> +<html> + <head> + <title>HTML5 Canvas Test: createlinearGradient() with two points same</title> + <script src="/resources/testharness.js"></script> + <script src="/resources/testharnessreport.js"></script> + <link rel="author" title="Microsoft" href="http://www.microsoft.com" /> + <link rel="help" href="http://www.w3.org/TR/2dcontext/#dom-context-2d-createlineargradient" /> + <meta name="assert" content="If the two points in a linear gradient have identical x,y coordinates, the canvas must paint nothing." /> + <script type="text/javascript"> + async_test(function(t) { + window.addEventListener("load", t.step_func_done(function runTest() { + var canvas = document.getElementById("canvas1"); + var ctx = canvas.getContext("2d"); + var width = canvas.width; + var height = canvas.height; + + // Start by drawing a left to right, green-to-blue linear gradient. + var lingrad = ctx.createLinearGradient(0, 50, 100, 50); + lingrad.addColorStop(0, "rgba(0, 255, 0, 1.0)"); + lingrad.addColorStop(1, "rgba(0, 0, 255, 1.0)"); + ctx.fillStyle = lingrad; + ctx.fillRect(0, 0, 100, 50); + + // Get the current state of the canvas + var initial = ctx.getImageData(0, 0, width, height); + + // Nothing must be drawn if the two points in the linear gradient are the same. + lingrad = ctx.createLinearGradient(100, 100, 100, 100); + lingrad.addColorStop(0, "rgba(255, 0, 0, 1.0)"); + lingrad.addColorStop(1, "rgba(255, 0, 0, 1.0)"); + ctx.fillStyle = lingrad; + ctx.fillRect(0, 0, 300, 150); + + // Check that nothing is drawn. + var after = ctx.getImageData(0, 0, width, height); + + // Asserts + assert_equals(initial.width, after.width, "widths are equal"); + assert_equals(initial.height, after.height, "heights are equal"); + assert_array_equals(initial.data, after.data, "data are equal"); + + for (var i = 0; i < after.data.length; i += 4) { + var r = after.data[i]; + var g = after.data[i+1]; + var b = after.data[i+2]; + var a = after.data[i+3]; + assert_false(r == 0xFF && g == 0 && b == 0 && a == 0xFF, "no red"); + } + })); + }, "linear gradient from point to self draws nothing"); + </script> + </head> + <body> + <p>Description: If the two points in a linear gradient have identical x,y coordinates, the canvas must paint nothing.</p> + <p>Test passes if there is one left-to-right, green-to-blue linear gradient seen on the page and no red is seen on the page.</p> + <canvas id="canvas1" width="300" height="150">Browser does not support HTML5 Canvas.</canvas> + </body> +</html> |