4 <style type=
"text/css" media=
"screen">
12 border:
1px solid black;
15 <script src=
"../../resources/run-after-layout-and-paint.js"></script>
17 if (window
.testRunner
)
18 testRunner
.overridePreference("WebKitWebGLEnabled", "1");
22 var canvas
= document
.getElementById('canvas');
23 var gl
= canvas
.getContext("webgl", {'antialias': false});
25 alert("No WebGL context found");
37 gl
.viewport(0, 0, 200, 200);
38 gl
.clearColor(1, 0, 0, 1); // red
39 gl
.clear(gl
.COLOR_BUFFER_BIT
);
40 if (window
.testRunner
) {
41 testRunner
.waitUntilDone();
42 testRunner
.dumpAsTextWithPixelResults();
44 runAfterLayoutAndPaint(drawGreen
);
49 gl
.clearColor(0, 1, 0, 1); // green
50 gl
.clear(gl
.COLOR_BUFFER_BIT
);
51 if (window
.testRunner
) {
52 testRunner
.notifyDone();
54 window
.setInterval(function() {
55 document
.getElementById('canvas').classList
.toggle('border');
61 <body onload=
"init()">
62 <canvas id=
"canvas" width=
"200" height=
"200"></canvas>