diff --git a/html/canvas/element/path-objects/2d.path.stroke.prune.ellipse.html b/html/canvas/element/path-objects/2d.path.stroke.prune.ellipse.html new file mode 100644 index 00000000000000..d55507935d2459 --- /dev/null +++ b/html/canvas/element/path-objects/2d.path.stroke.prune.ellipse.html @@ -0,0 +1,38 @@ + + +Canvas test: 2d.path.stroke.prune.ellipse + + + + + + +

2d.path.stroke.prune.ellipse

+

Zero-length full ellipse are removed before stroking with miters

+ + +

Actual output:

+

FAIL (fallback content)

+

Expected output:

+

+ + diff --git a/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.html b/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.html new file mode 100644 index 00000000000000..5eea85482453b9 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.ellipse + + + + +

2d.path.stroke.prune.ellipse

+

Zero-length full ellipse are removed before stroking with miters

+ + + diff --git a/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.worker.js b/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.worker.js new file mode 100644 index 00000000000000..a1fbabdebadba4 --- /dev/null +++ b/html/canvas/offscreen/path-objects/2d.path.stroke.prune.ellipse.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.ellipse +// Description:Zero-length full ellipse are removed before stroking with miters +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length full ellipse are removed before stroking with miters"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 100; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.ellipse(25, 25, 0, 0, 0, 0, 2 * Math.PI); + ctx.stroke(); + + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/html/canvas/tools/yaml-new/path-objects.yaml b/html/canvas/tools/yaml-new/path-objects.yaml index eec142c7692bc5..fab92b930cfc26 100644 --- a/html/canvas/tools/yaml-new/path-objects.yaml +++ b/html/canvas/tools/yaml-new/path-objects.yaml @@ -2853,6 +2853,23 @@ @assert pixel 50,25 == 0,255,0,255; expected: green +- name: 2d.path.stroke.prune.ellipse + desc: Zero-length full ellipse are removed before stroking with miters + code: | + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 100; + ctx.lineCap = 'round'; + ctx.lineJoin = 'round'; + + ctx.beginPath(); + ctx.ellipse(25, 25, 0, 0, 0, 0, 2 * Math.PI); + ctx.stroke(); + + @assert pixel 50,25 == 0,255,0,255; + expected: green - name: 2d.path.transformation.basic code: |