blob: 58bd5be7a8640d9d1f5ecb98f6483fe8cb4bd397 [file] [log] [blame]
<!-- Based on fast/repaint/canvas-resize-no-full-invalidation.html -->
<!DOCTYPE html>
canvas {
position: absolute;
width: 600px;
height: 500px;
top: 50px;
left: 50px;
/* object-fit and object-position make the content of the canvas not affected
by the resize in paintInvalidationTest(). */
object-fit: contain;
object-position: 0 0;
background-color: #030;
Tests paint invalidation of canvas when it's resized which doesn't affect its contents. Passes if there is only incremental invalidation for the resized background.
<canvas id="canvas" width="500" height="500"></canvas>
<script src="resources/paint-invalidation-test.js"></script>
if (window.testRunner)
function paintInvalidationTest() {
document.getElementById('canvas').style.width = '500px';
onload = runPaintInvalidationTest;
var ctx = document.getElementById('canvas').getContext('2d');
ctx.arc(250, 250, 250, 0, 2 * Math.PI);
ctx.fillStyle = 'green';