Automatic update from web-platform-tests new reftest Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> -- generate canvas regression test Signed-off-by: Euclid Ye <yezhizhenjiakang@gmail.com> -- wpt-commits: d8943e978103c68e07637ad6114e06c1fb0d86c6, a3f19d3119a36216eac2f0dd22bb23e0f0aa7d55 wpt-pr: 59780
29 lines
961 B
HTML
29 lines
961 B
HTML
<!DOCTYPE html>
|
|
<!-- DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. -->
|
|
<meta charset="UTF-8">
|
|
<link rel="match" href="2d.path.clip.scale-expected.html">
|
|
<title>Canvas test: 2d.path.clip.scale</title>
|
|
<h1>2d.path.clip.scale</h1>
|
|
<p class="desc">clip() with non-identity transform applies the correct clip region</p>
|
|
<canvas id="canvas" width="200" height="200">
|
|
<p class="fallback">FAIL (fallback content)</p>
|
|
</canvas>
|
|
<script>
|
|
const canvas = new OffscreenCanvas(200, 200);
|
|
const ctx = canvas.getContext('2d');
|
|
|
|
ctx.scale(2, 2);
|
|
ctx.beginPath();
|
|
ctx.rect(0, 0, 100, 200);
|
|
ctx.clip();
|
|
|
|
// Earlier in Servo, a regression was introduced.
|
|
// This only had fill the left half of square, as clip rect
|
|
// stored was not transformed.
|
|
ctx.fillStyle = 'green';
|
|
ctx.fillRect(0, 0, 200, 200);
|
|
|
|
const outputCanvas = document.getElementById("canvas");
|
|
outputCanvas.getContext('2d').drawImage(canvas, 0, 0);
|
|
</script>
|