From 8044994691c3ae5d985f533811b395bd93701c92 Mon Sep 17 00:00:00 2001 From: Aaron Krajeski Date: Sat, 17 Jul 2021 09:47:38 +0000 Subject: [PATCH] Bug 1719767 [wpt PR 29615] - Use DOMPointInit for roundRect, a=testonly Automatic update from web-platform-tests Use DOMPointInit for roundRect This is what we decided on in the spec debate. https://github.com/whatwg/html/pull/6765 Bug: 1193694 Change-Id: Ic24a8cf9ec61ab584318a40660c0c0e06a0b9848 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3016815 Commit-Queue: Aaron Krajeski Reviewed-by: Justin Novosad Cr-Commit-Position: refs/heads/master@{#899818} -- wpt-commits: adcec00147f8dc59daaca5793d8bcd5f8d2d519a wpt-pr: 29615 --- ....path.roundrect.1.radius.dompointinit.html | 55 ++++ ...path.roundrect.2.radii.1.dompointinit.html | 47 ++++ ...path.roundrect.2.radii.2.dompointinit.html | 47 ++++ ...path.roundrect.3.radii.1.dompointinit.html | 42 ++++ ...path.roundrect.3.radii.2.dompointinit.html | 47 ++++ ...path.roundrect.3.radii.3.dompointinit.html | 42 ++++ ...path.roundrect.4.radii.1.dompointinit.html | 42 ++++ ...path.roundrect.4.radii.2.dompointinit.html | 42 ++++ ...path.roundrect.4.radii.3.dompointinit.html | 42 ++++ ...path.roundrect.4.radii.4.dompointinit.html | 42 ++++ ....path.roundrect.1.radius.dompointinit.html | 55 ++++ ....roundrect.1.radius.dompointinit.worker.js | 51 ++++ ...path.roundrect.2.radii.1.dompointinit.html | 47 ++++ ...roundrect.2.radii.1.dompointinit.worker.js | 43 ++++ ...path.roundrect.2.radii.2.dompointinit.html | 47 ++++ ...roundrect.2.radii.2.dompointinit.worker.js | 43 ++++ ...path.roundrect.3.radii.1.dompointinit.html | 42 ++++ ...roundrect.3.radii.1.dompointinit.worker.js | 38 +++ ...path.roundrect.3.radii.2.dompointinit.html | 47 ++++ ...roundrect.3.radii.2.dompointinit.worker.js | 43 ++++ ...path.roundrect.3.radii.3.dompointinit.html | 42 ++++ ...roundrect.3.radii.3.dompointinit.worker.js | 38 +++ ...path.roundrect.4.radii.1.dompointinit.html | 42 ++++ ...roundrect.4.radii.1.dompointinit.worker.js | 38 +++ ...path.roundrect.4.radii.2.dompointinit.html | 42 ++++ ...roundrect.4.radii.2.dompointinit.worker.js | 38 +++ ...path.roundrect.4.radii.3.dompointinit.html | 42 ++++ ...roundrect.4.radii.3.dompointinit.worker.js | 38 +++ ...path.roundrect.4.radii.4.dompointinit.html | 42 ++++ ...roundrect.4.radii.4.dompointinit.worker.js | 38 +++ .../tools/yaml/element/path-objects.yaml | 228 +++++++++++++++++ .../tools/yaml/offscreen/path-objects.yaml | 238 ++++++++++++++++++ 32 files changed, 1770 insertions(+) create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.1.radius.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/element/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js 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 0000000000000..1926bccfdac65 --- /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 0000000000000..37eb89dcf7642 --- /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 0000000000000..7f672555008d9 --- /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 0000000000000..11709a1df8907 --- /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 0000000000000..72e7533059991 --- /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 0000000000000..eec602ea453ac --- /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 0000000000000..72b9ecc7b5136 --- /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 0000000000000..a58a8461c5133 --- /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 0000000000000..f58de8e49bed2 --- /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 0000000000000..59291121aa79c --- /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 0000000000000..0bf33703b434c --- /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 0000000000000..ec0580b84af31 --- /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 0000000000000..dbaac00b7dbb2 --- /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 0000000000000..f9d11df747a80 --- /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 0000000000000..eb782c136aeb2 --- /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 0000000000000..528596833bc82 --- /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 0000000000000..a4196795893f7 --- /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 0000000000000..8ef16a44e66f5 --- /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 0000000000000..07c4eec330d2a --- /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 0000000000000..557762505e207 --- /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 0000000000000..9e4677636538b --- /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 0000000000000..5bc8e6fd1fb01 --- /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 0000000000000..81900a270c62d --- /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 0000000000000..dad5edf954b38 --- /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 0000000000000..1386928a3adfb --- /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 0000000000000..d0dd9bab083e7 --- /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 0000000000000..66e2b7ea207a2 --- /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 0000000000000..5242cbb5c56ec --- /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 0000000000000..2cd39301417cb --- /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 0000000000000..50cd0edca15ce --- /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 0e40e8bb88308..d6b2b5966fe79 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 c10b9d3053a3a..f036d8b294bda 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: |