Files
tubestation/layout/reftests/canvas/1909718-1.html
Lee Salzman 7fc1fb8137 Bug 1909796 - Allow clip paths larger than int32. r=aosmond
The isEmpty check against path bounds would inadvertently fails because it checks
if the width/height would fit in an int32. However, since the bounds will be intersected
with a further clip rectangle that is already validated, this check is superfluous and
can filter out some valid clip paths. Replacing this check with isEmpty64, which doesn't
do the final limit check resolves this issue.

Differential Revision: https://phabricator.services.mozilla.com/D218706
2024-08-07 04:42:48 +00:00

25 lines
407 B
HTML

<!DOCTYPE html>
<html>
<body>
<canvas id="c" width="200" height="200"></canvas>
<script>
const c = document.getElementById("c");
const ctx = c.getContext("2d");
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 200, 200);
ctx.beginPath();
ctx.rect(-6091968027, 0, 2 * 6091968027, 100);
ctx.rect(100, 100, 100, 100);
ctx.clip();
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, 200, 200);
</script>
</body>
</html>