diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html new file mode 100644 index 000000000000..1926bccfdac6 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html new file mode 100644 index 000000000000..37eb89dcf764 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html new file mode 100644 index 000000000000..7f672555008d --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html new file mode 100644 index 000000000000..11709a1df890 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html new file mode 100644 index 000000000000..72e753305999 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html new file mode 100644 index 000000000000..eec602ea453a --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html new file mode 100644 index 000000000000..72b9ecc7b513 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html new file mode 100644 index 000000000000..a58a8461c513 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html new file mode 100644 index 000000000000..f58de8e49bed --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html new file mode 100644 index 000000000000..59291121aa79 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html new file mode 100644 index 000000000000..0bf33703b434 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js new file mode 100644 index 000000000000..ec0580b84af3 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html new file mode 100644 index 000000000000..dbaac00b7dbb --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js new file mode 100644 index 000000000000..f9d11df747a8 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html new file mode 100644 index 000000000000..eb782c136aeb --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js new file mode 100644 index 000000000000..528596833bc8 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html new file mode 100644 index 000000000000..a4196795893f --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js new file mode 100644 index 000000000000..8ef16a44e66f --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html new file mode 100644 index 000000000000..07c4eec330d2 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js new file mode 100644 index 000000000000..557762505e20 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html new file mode 100644 index 000000000000..9e4677636538 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js new file mode 100644 index 000000000000..5bc8e6fd1fb0 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html new file mode 100644 index 000000000000..81900a270c62 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js new file mode 100644 index 000000000000..dad5edf954b3 --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html new file mode 100644 index 000000000000..1386928a3adf --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js new file mode 100644 index 000000000000..d0dd9bab083e --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html new file mode 100644 index 000000000000..66e2b7ea207a --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js new file mode 100644 index 000000000000..5242cbb5c56e --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html new file mode 100644 index 000000000000..2cd39301417c --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js new file mode 100644 index 000000000000..50cd0edca15c --- /dev/null +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/tools/yaml/element/path-objects.yaml b/testing/web-platform/tests/html/canvas/tools/yaml/element/path-objects.yaml index 0e40e8bb8830..d6b2b5966fe7 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml/element/path-objects.yaml +++ b/testing/web-platform/tests/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/testing/web-platform/tests/html/canvas/tools/yaml/offscreen/path-objects.yaml b/testing/web-platform/tests/html/canvas/tools/yaml/offscreen/path-objects.yaml index c10b9d3053a3..f036d8b294bd 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml/offscreen/path-objects.yaml +++ b/testing/web-platform/tests/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: |