diff --git a/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html new file mode 100644 index 00000000000000..1926bccfdac65a --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html @@ -0,0 +1,55 @@ + + +Canvas test: 2d.path.roundrect.1.radius.dompointinit + + + + + + +

2d.path.roundrect.1.radius.dompointinit

+

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.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html new file mode 100644 index 00000000000000..37eb89dcf76428 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html @@ -0,0 +1,47 @@ + + +Canvas test: 2d.path.roundrect.2.radii.1.dompointinit + + + + + + +

2d.path.roundrect.2.radii.1.dompointinit

+

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.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html new file mode 100644 index 00000000000000..7f672555008d90 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +Canvas test: 2d.path.roundrect.2.radii.2.dompointinit + + + + + + +

2d.path.roundrect.2.radii.2.dompointinit

+

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.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html new file mode 100644 index 00000000000000..11709a1df8907b --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.3.radii.1.dompointinit + + + + + + +

2d.path.roundrect.3.radii.1.dompointinit

+

Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html new file mode 100644 index 00000000000000..72e75330599913 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +Canvas test: 2d.path.roundrect.3.radii.2.dompointinit + + + + + + +

2d.path.roundrect.3.radii.2.dompointinit

+

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.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html new file mode 100644 index 00000000000000..eec602ea453ac0 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.3.radii.3.dompointinit + + + + + + +

2d.path.roundrect.3.radii.3.dompointinit

+

Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html new file mode 100644 index 00000000000000..72b9ecc7b51368 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.4.radii.1.dompointinit + + + + + + +

2d.path.roundrect.4.radii.1.dompointinit

+

Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html new file mode 100644 index 00000000000000..a58a8461c51338 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.4.radii.2.dompointinit + + + + + + +

2d.path.roundrect.4.radii.2.dompointinit

+

Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html new file mode 100644 index 00000000000000..f58de8e49bed2a --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.4.radii.3.dompointinit + + + + + + +

2d.path.roundrect.4.radii.3.dompointinit

+

Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html new file mode 100644 index 00000000000000..59291121aa79c4 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html @@ -0,0 +1,42 @@ + + +Canvas test: 2d.path.roundrect.4.radii.4.dompointinit + + + + + + +

2d.path.roundrect.4.radii.4.dompointinit

+

Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.

+ + +

Actual output:

+

FAIL (fallback content)

+ + + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html new file mode 100644 index 00000000000000..0bf33703b434ca --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.dompointinit + + + + +

2d.path.roundrect.1.radius.dompointinit

+

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.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js new file mode 100644 index 00000000000000..ec0580b84af31b --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html new file mode 100644 index 00000000000000..dbaac00b7dbb21 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.1.dompointinit + + + + +

2d.path.roundrect.2.radii.1.dompointinit

+

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.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js new file mode 100644 index 00000000000000..f9d11df747a80f --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html new file mode 100644 index 00000000000000..eb782c136aeb28 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.2.dompointinit + + + + +

2d.path.roundrect.2.radii.2.dompointinit

+

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.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js new file mode 100644 index 00000000000000..528596833bc825 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html new file mode 100644 index 00000000000000..a4196795893f7c --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.1.dompointinit + + + + +

2d.path.roundrect.3.radii.1.dompointinit

+

Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js new file mode 100644 index 00000000000000..8ef16a44e66f5a --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html new file mode 100644 index 00000000000000..07c4eec330d2af --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.2.dompointinit + + + + +

2d.path.roundrect.3.radii.2.dompointinit

+

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.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js new file mode 100644 index 00000000000000..557762505e207e --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html new file mode 100644 index 00000000000000..9e4677636538b8 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.3.dompointinit + + + + +

2d.path.roundrect.3.radii.3.dompointinit

+

Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js new file mode 100644 index 00000000000000..5bc8e6fd1fb01a --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html new file mode 100644 index 00000000000000..81900a270c62d3 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.1.dompointinit + + + + +

2d.path.roundrect.4.radii.1.dompointinit

+

Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js new file mode 100644 index 00000000000000..dad5edf954b381 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html new file mode 100644 index 00000000000000..1386928a3adfb0 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.2.dompointinit + + + + +

2d.path.roundrect.4.radii.2.dompointinit

+

Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js new file mode 100644 index 00000000000000..d0dd9bab083e7d --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html new file mode 100644 index 00000000000000..66e2b7ea207a22 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.3.dompointinit + + + + +

2d.path.roundrect.4.radii.3.dompointinit

+

Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js new file mode 100644 index 00000000000000..5242cbb5c56ec8 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html new file mode 100644 index 00000000000000..2cd39301417cb2 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.4.dompointinit + + + + +

2d.path.roundrect.4.radii.4.dompointinit

+

Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js new file mode 100644 index 00000000000000..50cd0edca15ce7 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js @@ -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(); diff --git a/html/canvas/tools/yaml/element/path-objects.yaml b/html/canvas/tools/yaml/element/path-objects.yaml index 0e40e8bb88308a..d6b2b5966fe790 100644 --- a/html/canvas/tools/yaml/element/path-objects.yaml +++ b/html/canvas/tools/yaml/element/path-objects.yaml @@ -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: | diff --git a/html/canvas/tools/yaml/offscreen/path-objects.yaml b/html/canvas/tools/yaml/offscreen/path-objects.yaml index c10b9d3053a3ab..f036d8b294bda2 100644 --- a/html/canvas/tools/yaml/offscreen/path-objects.yaml +++ b/html/canvas/tools/yaml/offscreen/path-objects.yaml @@ -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: |