diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc-expected.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc-expected.html new file mode 100644 index 0000000000000..7c0faba585958 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc-expected.html @@ -0,0 +1,25 @@ + + +
Test if zero-lengthed closePath before and after arc are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc.html new file mode 100644 index 0000000000000..4b1d069275881 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc.html @@ -0,0 +1,35 @@ + + + +Test if zero-lengthed closePath before and after arc are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html new file mode 100644 index 0000000000000..4b867f821fa70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after bezier curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html new file mode 100644 index 0000000000000..2c974bd2740e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html @@ -0,0 +1,35 @@ + + + +Test if zero-lengthed closePath before and after bezier curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line-expected.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line-expected.html new file mode 100644 index 0000000000000..87a99c7938003 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after line are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line.html new file mode 100644 index 0000000000000..655b2e12fda4f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line.html @@ -0,0 +1,35 @@ + + + +Test if zero-lengthed closePath before and after line are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html new file mode 100644 index 0000000000000..03635b0148385 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html new file mode 100644 index 0000000000000..9066770e2213d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html @@ -0,0 +1,35 @@ + + + +Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc-expected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc-expected.html new file mode 100644 index 0000000000000..7c0faba585958 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after arc are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.html new file mode 100644 index 0000000000000..aeff5bfd400aa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.html @@ -0,0 +1,38 @@ + + + +Test if zero-lengthed closePath before and after arc are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.w.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.w.html new file mode 100644 index 0000000000000..f10836239f4c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.w.html @@ -0,0 +1,52 @@ + + + + +Test if zero-lengthed closePath before and after arc are ignored corrected.
+ + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html new file mode 100644 index 0000000000000..4b867f821fa70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after bezier curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html new file mode 100644 index 0000000000000..09d3152a5e718 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html @@ -0,0 +1,38 @@ + + + +Test if zero-lengthed closePath before and after bezier curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.w.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.w.html new file mode 100644 index 0000000000000..66f15eb3f1652 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve.w.html @@ -0,0 +1,52 @@ + + + + +Test if zero-lengthed closePath before and after bezier curve are ignored corrected.
+ + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line-expected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line-expected.html new file mode 100644 index 0000000000000..87a99c7938003 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after line are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.html new file mode 100644 index 0000000000000..5a020cce1718e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.html @@ -0,0 +1,38 @@ + + + +Test if zero-lengthed closePath before and after line are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.w.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.w.html new file mode 100644 index 0000000000000..860ad7036c904 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.line.w.html @@ -0,0 +1,52 @@ + + + + +Test if zero-lengthed closePath before and after line are ignored corrected.
+ + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html new file mode 100644 index 0000000000000..03635b0148385 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html @@ -0,0 +1,25 @@ + + +Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html new file mode 100644 index 0000000000000..1d516710f2018 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html @@ -0,0 +1,38 @@ + + + +Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.w.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.w.html new file mode 100644 index 0000000000000..5bbd27326374f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.w.html @@ -0,0 +1,52 @@ + + + + +Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.
+ + + + diff --git a/testing/web-platform/tests/html/canvas/tools/yaml-new/path-objects.yaml b/testing/web-platform/tests/html/canvas/tools/yaml-new/path-objects.yaml index 673c908574427..755d6fb8d54dc 100644 --- a/testing/web-platform/tests/html/canvas/tools/yaml-new/path-objects.yaml +++ b/testing/web-platform/tests/html/canvas/tools/yaml-new/path-objects.yaml @@ -2879,6 +2879,157 @@ @assert pixel 50,25 == 0,255,0,255; expected: green +- name: 2d.path.stroke.prune.closePath.line + desc: Test if zero-lengthed closePath before and after line are ignored corrected. + code: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.moveTo(50, 25); + ctx.lineTo(50, 25); + ctx.closePath(); + + ctx.moveTo(10, 10); + ctx.lineTo(40, 40); + ctx.closePath(); + + ctx.moveTo(45, 45); + ctx.lineTo(45, 45); + ctx.closePath(); + ctx.stroke(); + reference: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.moveTo(10, 10); + ctx.lineTo(40, 40); + ctx.closePath(); + ctx.stroke(); + +- name: 2d.path.stroke.prune.closePath.bezierCurve + desc: Test if zero-lengthed closePath before and after bezier curve are ignored corrected. + code: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.moveTo(5, 5); + ctx.lineTo(5, 5); + ctx.closePath(); + + ctx.moveTo(10, 10); + ctx.bezierCurveTo(10, 30, 40, 50, 100, 50); + ctx.closePath(); + + ctx.moveTo(20, 40); + ctx.lineTo(20, 40); + ctx.closePath(); + ctx.stroke(); + reference: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.moveTo(10, 10); + ctx.bezierCurveTo(10, 30, 40, 50, 100, 50); + ctx.closePath(); + ctx.stroke(); + +- name: 2d.path.stroke.prune.closePath.quadraticCurve + desc: Test if zero-lengthed closePath before and after quadratic curve are ignored corrected. + code: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.moveTo(5, 5); + ctx.lineTo(5, 5); + ctx.closePath(); + + ctx.moveTo(10, 10); + ctx.quadraticCurveTo(80, 10, 100, 50); + ctx.closePath(); + + ctx.moveTo(40, 40); + ctx.lineTo(40, 40); + ctx.closePath(); + ctx.stroke(); + reference: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.moveTo(10, 10); + ctx.quadraticCurveTo(80, 10, 100, 50); + ctx.closePath(); + ctx.stroke(); + +- name: 2d.path.stroke.prune.closePath.arc + desc: Test if zero-lengthed closePath before and after arc are ignored corrected. + code: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.moveTo(50, 25); + ctx.lineTo(50, 25); + ctx.closePath(); + + ctx.moveTo(10, 10); + ctx.arc(20, 20, 15, 0, Math.PI); + ctx.closePath(); + + ctx.moveTo(40, 40); + ctx.lineTo(40, 40); + ctx.closePath(); + ctx.stroke(); + reference: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.moveTo(10, 10); + ctx.arc(20, 20, 15, 0, Math.PI); + ctx.closePath(); + ctx.stroke(); - name: 2d.path.transformation.basic code: |