Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / paint / invalidation / spv2 / canvas-resize-no-full-invalidation.html
blobf0c1a7bc92634adcb1ce3452404f21d9a8f00940
1 <!-- Based on fast/repaint/canvas-resize-no-full-invalidation.html -->
2 <!DOCTYPE html>
3 <style>
4 canvas {
5 position: absolute;
6 width: 600px;
7 height: 500px;
8 top: 50px;
9 left: 50px;
10 /* object-fit and object-position make the content of the canvas not affected
11 window.expectedPaintInvalidationObjects = [
12 "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
14 by the resize in paintInvalidationTest(). */
15 object-fit: contain;
16 object-position: 0 0;
17 background-color: #030;
19 </style>
20 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.
21 <canvas id="canvas" width="500" height="500"></canvas>
23 <script src="resources/paint-invalidation-test.js"></script>
24 <script>
25 window.expectedPaintInvalidationObjects = [
26 "LayoutHTMLCanvas (positioned) CANVAS id='canvas'",
28 function paintInvalidationTest() {
29 document.getElementById('canvas').style.width = '500px';
31 onload = runPaintInvalidationTest;
33 var ctx = document.getElementById('canvas').getContext('2d');
34 ctx.beginPath();
35 ctx.arc(250, 250, 250, 0, 2 * Math.PI);
36 ctx.fillStyle = 'green';
37 ctx.fill();
38 </script>