forked from kdashg/gecko-cinn
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bug 1857402 [wpt PR 42385] - Remove empty closed paths, a=testonly
Automatic update from web-platform-tests Remove empty closed paths As discussed in the github issue, whatwg/html#1079, it's generally agreed to skip drawing line caps for closed paths. This is a follow up cl of: https://chromium-review.googlesource.com/c/chromium/src/+/4864061. In this cl, it verifies if each closed path is empty, then it removes the empty closed subpaths from path. As the subpaths are removed, the corresponding line caps are skipped. Bug: 644067 Change-Id: I14c5c4819a31eb9249d01574ff1b5c60826c3b9e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4916516 Commit-Queue: Yi Xu <yiyix@google.com> Reviewed-by: Jean-Philippe Gravel <jpgravel@chromium.org> Reviewed-by: Justin Novosad <junov@chromium.org> Cr-Commit-Position: refs/heads/main@{#1247735} -- Fix the inconsistency between yaml and generated files -- wpt-commits: 3b5bcfe6fae26f8de7e5086bf9d5794dbefd456d, 3aa1c64bf887fa1ffa2fe960f43e67a2cc65f0b0 wpt-pr: 42385
- Loading branch information
1 parent
e18a349
commit 10bf9b3
Showing
21 changed files
with
851 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
...m/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.arc</title> | ||
<h1>2d.path.stroke.prune.closePath.arc</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after arc are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
35 changes: 35 additions & 0 deletions
35
...b-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.arc.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.arc-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.arc</title> | ||
<h1>2d.path.stroke.prune.closePath.arc</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after arc are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
25 changes: 25 additions & 0 deletions
25
...html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.bezierCurve</title> | ||
<h1>2d.path.stroke.prune.closePath.bezierCurve</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after bezier curve are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
35 changes: 35 additions & 0 deletions
35
...rm/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.bezierCurve.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.bezierCurve-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.bezierCurve</title> | ||
<h1>2d.path.stroke.prune.closePath.bezierCurve</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after bezier curve are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
25 changes: 25 additions & 0 deletions
25
.../tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.line</title> | ||
<h1>2d.path.stroke.prune.closePath.line</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after line are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
35 changes: 35 additions & 0 deletions
35
...-platform/tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.line.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.line-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.line</title> | ||
<h1>2d.path.stroke.prune.closePath.line</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after line are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
25 changes: 25 additions & 0 deletions
25
...l/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.quadraticCurve</title> | ||
<h1>2d.path.stroke.prune.closePath.quadraticCurve</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
35 changes: 35 additions & 0 deletions
35
...tests/html/canvas/element/path-objects/2d.path.stroke.prune.closePath.quadraticCurve.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.quadraticCurve-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.quadraticCurve</title> | ||
<h1>2d.path.stroke.prune.closePath.quadraticCurve</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after quadratic curve are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
25 changes: 25 additions & 0 deletions
25
...tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.arc</title> | ||
<h1>2d.path.stroke.prune.closePath.arc</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after arc are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
38 changes: 38 additions & 0 deletions
38
...platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.arc-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.arc</title> | ||
<h1>2d.path.stroke.prune.closePath.arc</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after arc are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = new OffscreenCanvas(100, 50); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
|
||
const outputCanvas = document.getElementById("canvas"); | ||
outputCanvas.getContext('2d').drawImage(canvas, 0, 0); | ||
</script> |
52 changes: 52 additions & 0 deletions
52
...atform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.arc.w.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<html class="reftest-wait"> | ||
<link rel="match" href="2d.path.stroke.prune.closePath.arc-expected.html"> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.arc</title> | ||
<h1>2d.path.stroke.prune.closePath.arc</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after arc are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script id='myWorker' type='text/worker'> | ||
self.onmessage = function(e) { | ||
const canvas = new OffscreenCanvas(100, 50); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
|
||
const bitmap = canvas.transferToImageBitmap(); | ||
self.postMessage(bitmap, bitmap); | ||
}; | ||
</script> | ||
<script> | ||
const blob = new Blob([document.getElementById('myWorker').textContent]); | ||
const worker = new Worker(URL.createObjectURL(blob)); | ||
worker.addEventListener('message', msg => { | ||
const outputCtx = document.getElementById("canvas").getContext('2d'); | ||
outputCtx.drawImage(msg.data, 0, 0); | ||
document.documentElement.classList.remove("reftest-wait"); | ||
}); | ||
worker.postMessage(null); | ||
</script> | ||
</html> |
25 changes: 25 additions & 0 deletions
25
...ml/canvas/offscreen/path-objects/2d.path.stroke.prune.closePath.bezierCurve-expected.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<!DOCTYPE html> | ||
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. --> | ||
<title>Canvas test: 2d.path.stroke.prune.closePath.bezierCurve</title> | ||
<h1>2d.path.stroke.prune.closePath.bezierCurve</h1> | ||
<p class="desc">Test if zero-lengthed closePath before and after bezier curve are ignored corrected.</p> | ||
<canvas id="canvas" width="100" height="50"> | ||
<p class="fallback">FAIL (fallback content)</p> | ||
</canvas> | ||
<script> | ||
const canvas = document.getElementById("canvas"); | ||
const ctx = canvas.getContext('2d'); | ||
|
||
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(); | ||
</script> |
Oops, something went wrong.