2 <!-- Check that resizing a (potentially accelerated) canvas properly clears its
3 contents even if the layout size of the canvas does not change. Expected
4 output is a blank canvas.
5 https://bugs.webkit.org/show_bug.cgi?id=80871 -->
10 outline: solid
1px black;
15 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
17 if (window
.testRunner
) {
18 testRunner
.dumpAsTextWithPixelResults();
19 testRunner
.waitUntilDone();
23 var canvas
= document
.getElementById('canvas');
24 var ctx
= canvas
.getContext('2d');
25 ctx
.fillStyle
= 'red';
26 ctx
.fillRect(0, 0, 300, 300);
27 runAfterLayoutAndPaint(repaintTest
);
30 function repaintTest() {
31 var canvas
= document
.getElementById('canvas');
32 // This changes the resolution of the canvas but keeps its layout size constant.
33 canvas
.width
= canvas
.width
/ 2;
34 if (window
.testRunner
)
35 testRunner
.notifyDone();
39 <body onload=
"runTest();">
40 <canvas id=
"canvas" width=
"300" height=
"300"/>