offscreen-issue.html (921B)
1 <!-- 2 Copyright (c) 2019 The Khronos Group Inc. 3 Use of this source code is governed by an MIT-style license that can be 4 found in the LICENSE.txt file. 5 --> 6 <!DOCTYPE html> 7 <html> 8 <head> 9 <meta charset="utf-8"> 10 <script type="application/javascript"> 11 12 window.onload = function() { 13 setup("1"); 14 setup("2"); 15 } 16 17 function setup(id) { 18 var c = document.getElementById(id); 19 var names = ["webgl", "experimental-webgl"]; 20 for (var i = 0; i < names.length; ++i) { 21 gl = canvas.getContext(names[i]); 22 if (gl) { 23 break; 24 } 25 } 26 gl.clearColor(1,0,0,1); 27 gl.clear(gl.COLOR_BUFFER_BIT); 28 setTimeout(function() { 29 gl.enable(gl.SCISSOR_TEST); 30 gl.scissor(0,0,50,50); 31 gl.clearColor(0,1,0,1); 32 gl.clear(gl.COLOR_BUFFER_BIT); 33 }, 500); 34 } 35 </script> 36 </head> 37 <body> 38 <canvas id="1"></canvas> 39 <div style="height:4000px;">content that is tall like several articles</div> 40 <canvas id="2"></canvas> 41 </body> 42 </html>