зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1719767 [wpt PR 29615] - Use DOMPointInit for roundRect, a=testonly
Automatic update from web-platform-tests Use DOMPointInit for roundRect This is what we decided on in the spec debate. https://github.com/whatwg/html/pull/6765 Bug: 1193694 Change-Id: Ic24a8cf9ec61ab584318a40660c0c0e06a0b9848 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3016815 Commit-Queue: Aaron Krajeski <aaronhk@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/master@{#899818} -- wpt-commits: adcec00147f8dc59daaca5793d8bcd5f8d2d519a wpt-pr: 29615
This commit is contained in:
Родитель
f01f2bd7d5
Коммит
47e2ecd065
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.1.radius.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.1.radius.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-left corners.</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("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-left corners.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(canvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(canvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(canvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(canvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.2.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.2.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners.</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("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(canvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(canvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_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");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.2.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.2.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners.</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("Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(canvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(canvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.3.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.</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("Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(canvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.3.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.</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("Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(canvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(canvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.3.radii.3.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.3.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.</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("Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(canvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_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");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.4.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.</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("Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(canvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.4.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.</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("Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(canvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.4.radii.3.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.3.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.</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("Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(canvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_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");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>Canvas test: 2d.path.roundrect.4.radii.4.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
<link rel="stylesheet" href="/html/canvas/resources/canvas-tests.css">
|
||||
<body class="show_output">
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.4.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.</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("Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.");
|
||||
_addTest(function(canvas, ctx) {
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(canvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(canvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(canvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(canvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_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, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
|
@ -0,0 +1,55 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.1.radius.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.1.radius.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-left corners.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,51 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.dompointinit
|
||||
// Description:Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-left corners.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.2.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.2.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-right corners.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-right corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,43 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.1.dompointinit
|
||||
// Description:Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-right corners.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-right corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.2.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.2.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,43 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.2.dompointinit
|
||||
// Description:Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.3.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.1.dompointinit
|
||||
// Description:Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,47 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.3.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,43 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.2.dompointinit
|
||||
// Description:Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.3.radii.3.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.3.radii.3.dompointinit</h1>
|
||||
<p class="desc">Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.3.dompointinit
|
||||
// Description:Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.4.radii.1.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.1.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.1.dompointinit
|
||||
// Description:Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
_assertPixel(offscreenCanvas, 20,1, 255,0,0,255, "20,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,1, 0,255,0,255, "41,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,10, 255,0,0,255, "1,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,21, 0,255,0,255, "1,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.4.radii.2.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.2.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.2.dompointinit
|
||||
// Description:Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
_assertPixel(offscreenCanvas, 79,1, 255,0,0,255, "79,1", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,1, 0,255,0,255, "58,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,10, 255,0,0,255, "98,10", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,21, 0,255,0,255, "98,21", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.4.radii.3.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.3.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.3.dompointinit
|
||||
// Description:Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
_assertPixel(offscreenCanvas, 79,48, 255,0,0,255, "79,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 58,48, 0,255,0,255, "58,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,39, 255,0,0,255, "98,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,28, 0,255,0,255, "98,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -0,0 +1,42 @@
|
|||
<!DOCTYPE html>
|
||||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
||||
<title>OffscreenCanvas test: 2d.path.roundrect.4.radii.4.dompointinit</title>
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
<script src="/html/canvas/resources/canvas-tests.js"></script>
|
||||
|
||||
<h1>2d.path.roundrect.4.radii.4.dompointinit</h1>
|
||||
<p class="desc">Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.</p>
|
||||
|
||||
|
||||
<script>
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,38 @@
|
|||
// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py.
|
||||
// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.4.dompointinit
|
||||
// Description:Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.
|
||||
// Note:
|
||||
|
||||
importScripts("/resources/testharness.js");
|
||||
importScripts("/html/canvas/resources/canvas-tests.js");
|
||||
|
||||
var t = async_test("Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.");
|
||||
var t_pass = t.done.bind(t);
|
||||
var t_fail = t.step_func(function(reason) {
|
||||
throw reason;
|
||||
});
|
||||
t.step(function() {
|
||||
|
||||
var offscreenCanvas = new OffscreenCanvas(100, 50);
|
||||
var ctx = offscreenCanvas.getContext('2d');
|
||||
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-left corner
|
||||
_assertPixel(offscreenCanvas, 20,48, 255,0,0,255, "20,48", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 41,48, 0,255,0,255, "41,48", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,39, 255,0,0,255, "1,39", "255,0,0,255");
|
||||
_assertPixel(offscreenCanvas, 1,28, 0,255,0,255, "1,28", "0,255,0,255");
|
||||
|
||||
// other corners
|
||||
_assertPixel(offscreenCanvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
|
||||
_assertPixel(offscreenCanvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
|
||||
t.done();
|
||||
|
||||
});
|
||||
done();
|
|
@ -1820,6 +1820,26 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.1.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.2.double
|
||||
desc: Verify that when four radii are given to roundRect(), the second radius, specified as a double, applies to the top-right corner.
|
||||
code: |
|
||||
|
@ -1853,6 +1873,26 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.2.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.3.double
|
||||
desc: Verify that when four radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.
|
||||
code: |
|
||||
|
@ -1886,6 +1926,26 @@
|
|||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.3.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.4.double
|
||||
desc: Verify that when four radii are given to roundRect(), the fourth radius, specified as a double, applies to the bottom-left corner.
|
||||
code: |
|
||||
|
@ -1919,6 +1979,26 @@
|
|||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.4.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.1.double
|
||||
desc: Verify that when three radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner.
|
||||
code: |
|
||||
|
@ -1952,6 +2032,26 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.1.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.2.double
|
||||
desc: Verify that when three radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
|
@ -1990,6 +2090,31 @@
|
|||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.2.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.3.double
|
||||
desc: Verify that when three radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.
|
||||
code: |
|
||||
|
@ -2023,6 +2148,26 @@
|
|||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.3.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.1.double
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a double, applies to the top-left and bottom-right corners.
|
||||
code: |
|
||||
|
@ -2061,6 +2206,31 @@
|
|||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.1.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.2.double
|
||||
desc: Verify that when two radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
|
@ -2099,6 +2269,31 @@
|
|||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.2.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.1.radius.double
|
||||
desc: Verify that when one radius is given to roundRect(), specified as a double, it applies to all corners.
|
||||
code: |
|
||||
|
@ -2145,6 +2340,39 @@
|
|||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.1.radius.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
- name: 2d.path.roundrect.radius.intersecting.1
|
||||
desc: Check that roundRects with intersecting corner arcs are rendered correctly.
|
||||
code: |
|
||||
|
|
|
@ -1799,6 +1799,27 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.1.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.2.double
|
||||
desc: Verify that when four radii are given to roundRect(), the second radius, specified as a double, applies to the top-right corner.
|
||||
code: |
|
||||
|
@ -1834,6 +1855,27 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.2.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.3.double
|
||||
desc: Verify that when four radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.
|
||||
code: |
|
||||
|
@ -1869,6 +1911,27 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.3.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.4.double
|
||||
desc: Verify that when four radii are given to roundRect(), the fourth radius, specified as a double, applies to the bottom-left corner.
|
||||
code: |
|
||||
|
@ -1904,6 +1967,27 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.4.radii.4.dompointinit
|
||||
desc: Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.1.double
|
||||
desc: Verify that when three radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner.
|
||||
code: |
|
||||
|
@ -1939,6 +2023,27 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.1.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.2.double
|
||||
desc: Verify that when three radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
|
@ -1979,6 +2084,32 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.2.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.3.double
|
||||
desc: Verify that when three radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.
|
||||
code: |
|
||||
|
@ -2014,6 +2145,27 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.3.radii.3.dompointinit
|
||||
desc: Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.1.double
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a double, applies to the top-left and bottom-right corners.
|
||||
code: |
|
||||
|
@ -2054,6 +2206,32 @@
|
|||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.1.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-right corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 98,1 == 0,255,0,255;
|
||||
@assert pixel 1,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.2.double
|
||||
desc: Verify that when two radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.
|
||||
code: |
|
||||
|
@ -2094,6 +2272,32 @@
|
|||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.2.radii.2.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottomInit-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
|
||||
// other corners
|
||||
@assert pixel 1,1 == 0,255,0,255;
|
||||
@assert pixel 98,48 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.1.radius.double
|
||||
desc: Verify that when one radius is given to roundRect(), specified as a double, it applies to all corners.
|
||||
code: |
|
||||
|
@ -2142,6 +2346,40 @@
|
|||
@assert pixel 1,28 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.1.radius.dompointinit
|
||||
desc: Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottomInit-left corners.
|
||||
code: |
|
||||
ctx.fillStyle = '#f00';
|
||||
ctx.fillRect(0, 0, 100, 50);
|
||||
ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]);
|
||||
ctx.fillStyle = '#0f0';
|
||||
ctx.fill();
|
||||
|
||||
// top-left corner
|
||||
@assert pixel 20,1 == 255,0,0,255;
|
||||
@assert pixel 41,1 == 0,255,0,255;
|
||||
@assert pixel 1,10 == 255,0,0,255;
|
||||
@assert pixel 1,21 == 0,255,0,255;
|
||||
|
||||
// top-right corner
|
||||
@assert pixel 79,1 == 255,0,0,255;
|
||||
@assert pixel 58,1 == 0,255,0,255;
|
||||
@assert pixel 98,10 == 255,0,0,255;
|
||||
@assert pixel 98,21 == 0,255,0,255;
|
||||
|
||||
// bottom-right corner
|
||||
@assert pixel 79,48 == 255,0,0,255;
|
||||
@assert pixel 58,48 == 0,255,0,255;
|
||||
@assert pixel 98,39 == 255,0,0,255;
|
||||
@assert pixel 98,28 == 0,255,0,255;
|
||||
|
||||
// bottom-left corner
|
||||
@assert pixel 20,48 == 255,0,0,255;
|
||||
@assert pixel 41,48 == 0,255,0,255;
|
||||
@assert pixel 1,39 == 255,0,0,255;
|
||||
@assert pixel 1,28 == 0,255,0,255;
|
||||
t.done();
|
||||
|
||||
- name: 2d.path.roundrect.radius.intersecting.1
|
||||
desc: Check that roundRects with intersecting corner arcs are rendered correctly.
|
||||
code: |
|
||||
|
|
Загрузка…
Ссылка в новой задаче