Upstream version 11.40.277.0
[platform/framework/web/crosswalk.git] / src / third_party / webgl / src / specs / latest / 1.0 / index.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2         "http://www.w3.org/TR/html4/strict.dtd">
3 <html lang="en">
4 <head>
5     <meta http-equiv="content-type" content="text/html; charset=utf-8">
6     <title>WebGL Specification</title>
7     <meta name="generator" content="BBEdit 9.1">
8     <link rel="stylesheet" type="text/css" href="../../../resources/Khronos-WD.css" />
9     <script src="../../../resources/jquery-1.3.2.min.js" type="text/javascript"></script>
10     <script src="../../../resources/generateTOC.js" type="text/javascript"></script>
11 </head>
12 <body onload="generateTOC(document.getElementById('toc'))">
13     <!--begin-logo-->
14     <div class=head>
15         <p>
16             <a href="http://khronos.org/">
17                 <img alt=Khronos height=60 src="../../../resources/KhronosGroup-3D.png" width=220>
18             </a>
19         </p>
20     </div>
21     <div class=head>
22         <p>
23             <a href="http://webgl.org/">
24                 <img alt=WebGL height=72 src="../../../resources/WebGL-Logo.png" width=156>
25             </a>
26         </p>
27     </div>
28     <!--end-logo-->
29
30     <h1>WebGL Specification</h1>
31     <h2 class="no-toc">Editor's Draft 27 October 2014</h2>
32     <dl>
33         <dt>This version:
34             <dd>
35                 <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/">
36                     https://www.khronos.org/registry/webgl/specs/latest/1.0/
37                 </a>
38                 <br>
39                 <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl">
40                     <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
41                 </a>
42             </dd>
43         <dt>Latest version:
44             <dd>
45                 <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/">
46                     https://www.khronos.org/registry/webgl/specs/latest/1.0/
47                 </a>
48                 <br>
49                 <a href="https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl">
50                     <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/latest/1.0/webgl.idl
51                 </a>
52             </dd>
53         <dt>Previous version:
54             <dd>
55                 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/">
56                     https://www.khronos.org/registry/webgl/specs/1.0.2/
57                 </a>
58                 <br>
59                 <a href="https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl">
60                     <b>WebIDL:</b> https://www.khronos.org/registry/webgl/specs/1.0.2/webgl.idl
61                 </a>
62             </dd>
63         <dt>Editor:
64             <dd>
65                 <a href="mailto:dino@apple.com">Dean Jackson</a>
66                 <a href="http://www.apple.com/">(Apple Inc.)</a>
67             </dd>
68     </dl>
69     
70     <span style="font-size: x-small; font-style: oblique">Copyright &copy; 2014 Khronos Group</span>
71
72     <hr />
73     
74     <h2 class="no-toc">Abstract</h2>
75     <p>
76         This specification describes an additional rendering context and support
77         objects for the
78         <a href="http://www.w3.org/TR/html5/the-canvas-element.html"
79            title="HTML 5 Canvas Element">
80             HTML 5 <span class="prop-name">canvas</span> element <a href="#refsCANVAS">[CANVAS]</a>.
81         </a>
82         This context allows rendering using an API that conforms closely to the OpenGL ES 2.0 API.
83     </p>
84
85     <h2 class="no-toc">Status of this document</h2>
86     
87     <!--begin-status-->
88     <p>
89         This document is an editor's draft. Do not cite this document as other than work in
90         progress.  Public discussion of this specification is welcome on the
91         (<a href="https://www.khronos.org/webgl/public-mailing-list/archives/">archived</a>) WebGL
92         mailing list <a href="mailto:public_webgl@khronos.org">public_webgl@khronos.org</a> (see
93         <a href="http://www.khronos.org/webgl/public-mailing-list/">instructions</a>).
94     </p>
95     <!--end-status-->
96     
97     <h2 class="no-toc">Table of contents</h2>
98     <div id="toc"></div>
99
100     <h2>Introduction</h2>
101     <div class="note">        
102     <p>
103       WebGL™ is an immediate mode 3D rendering API designed for the
104       web.  It is derived from OpenGL® ES 2.0, and provides similar
105       rendering functionality, but in an HTML context.  WebGL is
106       designed as a rendering context for the HTML Canvas element.
107       The HTML Canvas provides a destination for programmatic
108       rendering in web pages, and allows for performing that rendering
109       using different rendering APIs.  The only such interface
110       described as part of the Canvas specification is the 2D canvas
111       rendering context, CanvasRenderingContext2D. This document
112       describes another such interface, WebGLRenderingContext, which
113       presents the WebGL API.
114     </p>
115     
116     <p>
117       The immediate mode nature of the API is a divergence from most
118       web APIs.  Given the many use cases of 3D graphics, WebGL
119       chooses the approach of providing flexible primitives that can
120       be applied to any use case.  Libraries can provide an API on top
121       of WebGL that is more tailored to specific areas, thus adding a
122       convenience layer to WebGL that can accelerate and simplify development.
123       However, because of its OpenGL ES 2.0 heritage, it should be
124       straightforward for developers familiar with modern desktop
125       OpenGL or OpenGL ES 2.0 development to transition to WebGL
126       development.
127     </p>
128     </div>
129
130     <h3>Conventions</h3>
131
132     <p>
133      Many functions described in this document contain links to OpenGL ES
134      man pages. While every effort is made to make these pages match the
135      OpenGL ES 2.0 specification <a href="#refsGLES20">[GLES20]</a>, 
136      they may contain errors. In the case of a contradiction, the OpenGL 
137      ES 2.0 specification is the final authority.
138     </p>
139
140     <p>
141       The remaining sections of this document are intended to be read in conjunction
142       with the OpenGL ES 2.0 specification (2.0.25 at the time of this writing, available
143       from the <a href="http://www.khronos.org/registry/gles/">Khronos OpenGL ES API Registry</a>).
144       Unless otherwise specified, the behavior of each method is defined by the
145       OpenGL ES 2.0 specification.  This specification may diverge from OpenGL ES 2.0
146       in order to ensure interoperability or security, often defining areas that
147       OpenGL ES 2.0 leaves implementation-defined.  These differences are summarized in the
148       <a href="#webgl_gl_differences">Differences Between WebGL and OpenGL ES 2.0</a> section.
149     </p>
150
151 <!-- ======================================================================================================= -->
152
153     <h2>Context Creation and Drawing Buffer Presentation</h2>
154
155     <p>
156         Before using the WebGL API, the author must obtain a <code>WebGLRenderingContext</code>
157         object for a given HTMLCanvasElement <a href="#refsCANVAS">[CANVAS]</a> as described
158         below. This object is used to manage OpenGL state and render to the drawing buffer, which
159         must be created at the time of context creation.
160     </p>
161     
162 <!-- ======================================================================================================= -->
163
164     <h3>Context Creation</h3>
165
166     <p>
167         Each <code>WebGLRenderingContext</code> has an
168         associated <b><a name="context-canvas">canvas</a></b>, set upon creation, which is
169         a <em>canvas</em> <a href="#refsCANVAS">[CANVAS]</a>.
170     </p>
171     <p>
172         Each <code>WebGLRenderingContext</code> has <b><a name="context-creation-parameters">context
173         creation parameters</a></b>, set upon creation, in
174         a <a href="#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
175     </p>
176     <p>
177         Each <code>WebGLRenderingContext</code> has <b><a name="actual-context-parameters">actual
178         context parameters</a></b>, set each time the drawing buffer is created, in
179         a <a href="#WEBGLCONTEXTATTRIBUTES"><code>WebGLContextAttributes</code></a> object.
180     </p>
181     <p>
182         Each <code>WebGLRenderingContext</code> has a <b><a name="webgl-context-lost-flag">webgl
183         context lost flag</a></b>, which is initially unset.
184     </p>
185     <p>
186         When the <code>getContext()</code> method of a <code>canvas</code> element is to return a
187         new object for
188         the <em>contextId</em> <code>webgl</code> <a href="#refsCANVASCONTEXTS">[CANVASCONTEXTS]</a>,
189         the user agent must perform the following steps:
190
191         <ol class="nestedlist">
192
193         <li> Create a new <code>WebGLRenderingContext</code> object, <em>context</em>.
194
195         <li> Let <em>context's</em> <a href="#context-canvas">canvas</a> be the canvas
196              the <code>getContext()</code> method is associated with.
197
198         <li> Create a new <code>WebGLContextAttributes</code> object, <em>contextAttributes</em>.
199
200         <li> If <code>getContext()</code> was invoked with a second argument, <em>options</em>, set
201              the attributes of <em>contextAttributes</em> from those specified in <em>options</em>.
202
203         <li> <a href="#create-a-drawing-buffer">Create a <em>drawing buffer</em></a> using the settings
204              specified in <em>contextAttributes</em>, and associate the <em>drawing buffer</em>
205              with <em>context</em>.
206
207         <li> If drawing buffer creation failed, perform the following steps:
208
209           <ol class="nestedlist">
210
211           <li> <a href="#fire-a-webgl-context-creation-error">Fire a WebGL context creation
212           error</a> at <em>canvas</em>.
213
214           <li> Return null and terminate these steps.
215
216           </ol>
217
218         <li> Set the attributes of <em>contextAttributes</em> based on the properties of the newly
219              created drawing buffer.
220
221         <li> Set <em>context's</em> <a href="#context-creation-parameters">context creation
222         parameters</a> to <em>contextAttributes</em>.
223
224         <li> Return <em>context</em>.
225
226         </ol>
227     </p>
228     <div class="note">
229     <p>
230       The canvas context type 'experimental-webgl' has historically been used to provide access to
231       WebGL implementations which are not yet complete or conformant.
232     </p>
233     </div>
234     <p>
235       If the user agent supports both the <code>webgl</code> and <code>experimental-webgl</code>
236       canvas context types, they shall be treated as aliases. For example, if a call
237       to <code>getContext('webgl')</code> successfully creates a WebGLRenderingContext, a subsequent
238       call to <code>getContext('experimental-webgl')</code> shall return the same context object.
239     </p>
240     
241 <!-- ======================================================================================================= -->
242
243     <h3><a name="THE_DRAWING_BUFFER">The Drawing Buffer</a></h3>
244
245     <p>
246         The drawing buffer into which the API calls are rendered shall be defined upon creation of
247         the WebGLRenderingContext object. The following description defines how
248         to <b><a name="create-a-drawing-buffer">create a drawing buffer</a></b>.
249     </p>
250     <p>
251         The table below shows all the buffers which make up the drawing buffer, along with their
252         minimum sizes and whether they are defined or not by default. The size of this drawing
253         buffer shall be determined by the <code>width</code> and <code>height</code> attributes of
254         the HTMLCanvasElement. The table below also shows the value to which these buffers shall be
255         cleared when first created, when the size is changed, or after presentation when
256         the <code>preserveDrawingBuffer</code> context creation attribute is <code>false</code>.
257     </p>
258     <table class="foo">
259         <tr><th>Buffer</th><th>Clear value</th><th>Minimum size</th><th>Defined by default?</th></tr>
260         <tr><td>Color</td><td>(0, 0, 0, 0)</td><td>8 bits per component</td><td>yes</td></tr>
261         <tr><td>Depth</td><td>1.0</td><td>16 bit integer</td><td>yes</td></tr>
262         <tr><td>Stencil</td><td>0</td><td>8 bits</td><td>no</td></tr>
263     </table>
264     <br>
265     <p>
266         If the requested width or height cannot be satisfied, either when the drawing buffer is first
267         created or when the <code>width</code> and <code>height</code> attributes of the 
268         <code>HTMLCanvasElement</code> are changed, a drawing buffer with smaller dimensions shall
269         be created. The dimensions actually used are implementation dependent and there is no 
270         guarantee that a buffer with the same aspect ratio will be created. The actual drawing 
271         buffer size can be obtained from the <code>drawingBufferWidth</code> and 
272         <code>drawingBufferHeight</code> attributes.
273     </p>
274     <p>
275         A WebGL implementation must not perform any automatic scaling of the size of the drawing
276         buffer on high-definition displays. The context's <code>drawingBufferWidth</code>
277         and <code>drawingBufferHeight</code> must match the canvas's <code>width</code>
278         and <code>height</code> attributes as closely as possible, modulo implementation-dependent
279         constraints.
280     </p>
281     <div class="note">
282         <p>
283             The constraint above does not change the amount of space the canvas element consumes on
284             the web page, even on a high-definition display. The
285             canvas's <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#attr-canvas-width">intrinsic
286             dimensions</a> <a href="#refsCANVAS">[CANVAS]</a> equal the size of its coordinate
287             space, with the numbers interpreted in CSS pixels, and CSS pixels
288             are <a href="http://www.w3.org/TR/CSS21/syndata.html#length-units">resolution-independent</a> <a href="#refsCSS">[CSS]</a>.
289         </p>
290         <p>
291             A WebGL application can achieve a 1:1 ratio between drawing buffer pixels and on-screen
292             pixels on high-definition displays by examining properties
293             like <code>window.devicePixelRatio</code>, scaling the canvas's <code>width</code>
294             and <code>height</code> by that factor, and setting its CSS width and height to the
295             original width and height. An application can simulate the effect of running on a
296             higher-resolution display simply by scaling up the canvas's <code>width</code>
297             and <code>height</code> properties.
298         </p>
299     </div>
300     <p>
301         The optional <a href="#WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a> object may be used
302         to change whether or not the buffers are defined. It can also be used to define whether the
303         color buffer will include an alpha channel. If defined, the alpha channel is used by the
304         HTML compositor to combine the color buffer with the rest of the page. The
305         WebGLContextAttributes object is only used on the first call to
306         <code>getContext</code>. No facility is provided to change the attributes of the drawing 
307         buffer after its creation.
308     </p>
309     <p>
310         The <code>depth</code>, <code>stencil</code> and <code>antialias</code> attributes, when set
311         to true, are requests, not requirements. The WebGL implementation should make a best effort
312         to honor them. When any of these attributes is set to false, however, the WebGL
313         implementation must not provide the associated functionality. Combinations of attributes not
314         supported by the WebGL implementation or graphics hardware shall not cause a failure to
315         create a WebGLRenderingContext. The <a href="#actual-context-parameters">actual context
316         parameters</a> are set to the attributes of the created drawing buffer. The
317         <code>alpha</code>, <code>premultipliedAlpha</code> and <code>preserveDrawingBuffer</code>
318         attributes must be obeyed by the WebGL implementation.
319     </p>
320     <p>
321         WebGL presents its drawing buffer to the HTML page compositor immediately before a
322         compositing operation, but only if at least one of the following has occurred since the
323         previous compositing operation:
324         <ul>
325             <li>Context creation</li>
326             <li>Canvas resize</li>
327             <li>
328                 <code>clear</code>, <code>drawArrays</code>, or <code>drawElements</code> has been
329                 called while the drawing buffer is the currently bound framebuffer
330             </li>
331         </ul>
332     </p>
333     <p>
334         Before the drawing buffer is presented for compositing the implementation shall ensure that
335         all rendering operations have been flushed to the drawing buffer. By default, after
336         compositing the contents of the drawing buffer shall be cleared to their default values, as
337         shown in the table above.
338     </p>
339     <p>
340         This default behavior can be changed by setting the <code>preserveDrawingBuffer</code>
341         attribute of the <a href="#WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a> object. If
342         this flag is true, the contents of the drawing buffer shall be preserved until the author
343         either clears or overwrites them. If this flag is false, attempting to perform operations
344         using this context as a source image after the rendering function has returned can lead to
345         undefined behavior. This includes <code>readPixels</code> or <code>toDataURL</code> calls,
346         or using this context as the source image of another context's <code>texImage2D</code> or
347         <code>drawImage</code> call.
348     </p>
349     <div class="note">        
350         <p>
351             While it is sometimes desirable to preserve the drawing buffer, it can cause significant 
352             performance loss on some platforms. Whenever possible this flag should remain false 
353             and other techniques used. Techniques like synchronous drawing buffer access (e.g., 
354             calling <code>readPixels</code> or <code>toDataURL</code> in the same function that 
355             renders to the drawing buffer) can be used to get the contents of the drawing buffer. 
356             If the author needs to render to the same drawing buffer over a series of calls, a 
357             <a href="#WEBGL_FRAMEBUFFER">Framebuffer Object</a> can be used.
358         </p>
359         <p>
360             Implementations may optimize away the required implicit clear operation of the Drawing 
361             Buffer as long as a guarantee can be made that the author cannot gain access to buffer 
362             contents from another process. For instance, if the author performs an explicit 
363             clear then the implicit clear is not needed.
364         </p>
365     </div>
366     
367 <!-- ======================================================================================================= -->
368
369     <h3><a name="WEBGL_VIEWPORT">The WebGL Viewport</a></h3>
370
371     <p>
372         OpenGL manages a rectangular viewport as part of its state which defines the placement of
373         the rendering results in the drawing buffer. Upon creation of WebGL
374         context <em>context</em>, the viewport is initialized to a rectangle with origin at (0, 0)
375         and width and height equal to (context.drawingBufferWidth, context.drawingBufferHeight).
376     </p>
377     <p>
378         A WebGL implementation <em>shall not</em> affect the state of the OpenGL viewport in response to
379         resizing of the canvas element.
380     </p>
381     <div class="example">
382         Note that if a WebGL program does not contain logic to set the viewport, it will not properly
383         handle the case where the canvas is resized. The following ECMAScript example illustrates how
384         a WebGL program might resize the canvas programmatically.
385
386         <pre>
387 var canvas = document.getElementById('canvas1');
388 var gl = canvas.getContext('webgl');
389 canvas.width = newWidth;
390 canvas.height = newHeight;
391 gl.viewport(0, 0, gl.drawingBufferWidth, gl.drawingBufferHeight);
392         </pre>
393     </div>
394     <p>
395         <em>Rationale</em>: automatically setting the viewport will interfere with applications that set
396         it manually. Applications are expected to use <code>onresize</code> handlers to respond to
397         changes in size of the canvas and set the OpenGL viewport in turn.
398     </p>
399
400 <!-- ======================================================================================================= -->
401
402     <h3><a name="PREMULTIPLIED_ALPHA">Premultiplied Alpha, Canvas APIs and texImage2D</a></h3>
403
404     <p>
405         The OpenGL API allows the application to modify the blending modes used during rendering,
406         and for this reason allows control over how alpha values in the drawing buffer are
407         interpreted; see the <code>premultipliedAlpha</code> parameter in
408         the <a href="#WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a> section.
409     </p>
410     <p>
411         The HTML Canvas APIs <code>toDataURL</code> and <code>drawImage</code> must respect
412         the <code>premultipliedAlpha</code> context creation parameter. When <code>toDataURL</code>
413         is called against a Canvas into which WebGL content is being rendered, then if the requested
414         image format does not specify premultiplied alpha and the WebGL context has
415         the <code>premultipliedAlpha</code> parameter set to true, then the pixel values must be
416         de-multiplied; i.e., the color channels are divided by the alpha channel. <b>Note</b> that
417         this operation is lossy.
418     </p>
419     <p>
420         Passing a WebGL-rendered Canvas to the <code>drawImage</code> method
421         of <code>CanvasRenderingContext2D</code> may or may not need to modify the the rendered
422         WebGL content during the drawing operation, depending on the premultiplication needs of the
423         <code>CanvasRenderingContext2D</code> implementation.
424     </p>
425     <p>
426         When passing a WebGL-rendered Canvas to the <code>texImage2D</code> API, then depending on
427         the setting of the <code>premultipliedAlpha</code> context creation parameter of the passed
428         canvas and the <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel store parameter of the
429         destination WebGL context, the pixel data may need to be changed to or from premultiplied
430         form.
431     </p>
432
433 <!-- ======================================================================================================= -->
434
435     <h2>WebGL Resources</h2>
436
437     <p> 
438         OpenGL manages several types of resources as part of its state. These are identified
439         by integer object names and are obtained from OpenGL by various creation calls.
440         In contrast WebGL represents these resources as DOM objects. Each object is derived 
441         from the WebGLObject interface. Currently supported resources are:
442         textures, buffers (i.e., VBOs), framebuffers, renderbuffers, shaders and
443         programs. The WebGLRenderingContext interface has a method to create a 
444         WebGLObject subclass for each type. Data from the underlying graphics library are
445         stored in these objects and are fully managed by them. The resources represented
446         by these objects are guaranteed to exist as long as the object exists.
447         Furthermore, the DOM object is guaranteed to exist as long as the author has an explicit
448         valid reference to it <b>or</b> as long as it is bound by the underlying graphics library.
449         When none of these conditions exist the user agent can, at any point, delete the object 
450         using the equivalent of a delete call (e.g., deleteTexture). If authors wish to control 
451         when the underlying resource is released then the delete call can be made explicitly.
452     </p>
453
454 <!-- ======================================================================================================= -->
455
456     <h2>Security</h2>
457
458     <p> 
459     </p>
460
461 <!-- ======================================================================================================= -->
462
463     <h3>Resource Restrictions</h3>
464
465     <p>
466         WebGL resources such as textures and vertex buffer objects (VBOs) must always 
467         contain initialized data, even if they were created without initial user 
468         data values.  Creating a resource without initial values is commonly used to 
469         reserve space for a texture or VBO, which is then modified using <code>texSubImage</code> or 
470         <code>bufferSubData</code> calls.  If initial data is not provided to these calls, the WebGL
471         implementation must initialize their contents to 0; depth renderbuffers must be cleared to
472         the default 1.0 clear depth.  This may require creating a zeroed temporary buffer the size
473         of a requested VBO, so that it can be initialized correctly.  All other forms of loading
474         data into a texture or VBO involve either ArrayBuffers or DOM objects such as images, and
475         are therefore already required to be initialized.
476     </p>
477
478     <p>
479         When WebGL resources are accessed by shaders through a call such as
480         <code>drawElements</code> or <code>drawArrays</code>, the WebGL implementation must ensure
481         that the shader cannot access either out of bounds or uninitialized data.
482         See <a href="#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range Checking</a>
483         for restrictions which must be enforced by the WebGL implementation.
484     </p>
485
486 <!-- ======================================================================================================= -->
487
488     <h3><a name="ORIGIN_RESTRICTIONS">Origin Restrictions</a></h3>
489
490     <p>
491         In order to prevent information leakage, WebGL disallows uploading as textures:
492         <ul>
493         <li> Image or video elements whose origin is not the same as the origin of the Document that
494              contains the WebGLRenderingContext's canvas element
495         <li> Canvas elements whose <i>origin-clean</i> flag is set to false
496         </ul>
497     </p>
498     <p>
499         If the <code>texImage2D</code> or <code>texSubImage2D</code> method is called with otherwise
500         correct arguments and an <code>HTMLImageElement</code>, <code>HTMLVideoElement</code>,
501         or <code>HTMLCanvasElement</code> violating these restrictions, a <code>SECURITY_ERR</code>
502         exception must be thrown.
503     </p>
504     <div class="note">
505         <p>
506             WebGL necessarily imposes stronger restrictions on the use of cross-domain media than other
507             APIs such as the 2D canvas rendering context, because shaders can be used to indirectly
508             deduce the contents of textures which have been uploaded to the GPU.
509         </p>
510         <p>
511             WebGL applications may utilize images and videos that come from other domains, with the
512             cooperation of the server hosting the media,
513             using <a href="http://www.w3.org/TR/cors/">Cross-Origin Resource
514             Sharing</a> <a href="#refsCORS">[CORS]</a>. In order to use such media, the application
515             needs to explicitly request permission to do so, and the server needs to explicitly grant
516             permission. Successful CORS-enabled fetches of image and video elements from other
517             domains <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/origin-0.html#origin-0">cause
518             the origin of these elements</a> to be set to that of the containing
519             Document <a href="#refsHTML">[HTML]</a>.
520         </p>
521         <div class="example">
522             <p>
523                 The following ECMAScript example demonstrates how to issue a CORS request for an
524                 image coming from another domain. The image is fetched from the server without any
525                 credentials, i.e., cookies.
526             </p>
527 <pre>
528 var gl = ...;
529 var image = new Image();
530
531 // The onload handler should be set to a function which uploads the HTMLImageElement
532 // using texImage2D or texSubImage2D.
533 image.onload = ...;
534
535 image.crossOrigin = "anonymous";
536
537 image.src = "http://other-domain.com/image.jpg";
538 </pre>
539         </div>
540         <p>
541             Note that these rules imply that the <i>origin-clean</i> flag for a canvas rendered
542             using WebGL will never be set to false.
543         </p>
544         <p>
545             For more information on issuing CORS requests for image and video elements, consult:
546             <ul>
547             <li> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#cors-settings-attribute">CORS settings attributes</a> <a href="#refsHTML">[HTML]</a>
548             <li> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/embedded-content-1.html#the-img-element">The <code>img</code> element</a> <a href="#refsHTML">[HTML]</a>
549             <li> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/the-iframe-element.html#media-elements">Media elements</a> <a href="#refsHTML">[HTML]</a>
550             </ul>
551         </p>
552     </div>
553
554 <!-- ======================================================================================================= -->
555
556     <h3><a name="SUPPORTED_GLSL_CONSTRUCTS">Supported GLSL Constructs</a></h3>
557
558     <p>
559         A WebGL implementation must only accept shaders which conform to The OpenGL ES Shading
560         Language, Version 1.00 <a href="#refsGLES20GLSL">[GLES20GLSL]</a>, and which do not exceed
561         the minimum functionality mandated in Sections 4 and 5 of Appendix A.  In particular:
562
563         <ul>
564         <li> A shader referencing state variables or functions that are available in other versions
565              of GLSL, such as that found in versions of OpenGL for the desktop, must not be allowed
566              to load. </li>
567         <li> <code>for</code> loops must conform to the structural constraints in Appendix A. </li>
568         <li> <code>while</code> and <code>do-while</code> loops are disallowed, since they are
569              optional in Appendix A.</li>
570         <li> Appendix A mandates certain forms of indexing of arrays; for example, within fragment
571              shaders, indexing is only mandated with a <i>constant-index-expression</i>
572              (see <a href="#refsGLES20GLSL">[GLES20GLSL]</a> for the definition of this term). In
573              the WebGL API, only the forms of indexing mandated in Appendix A are supported. </li>
574         </ul>
575     </p>
576     <p>
577         In addition to the reserved identifiers in the aforementioned specification, identifiers
578         starting with "webgl_" and "_webgl_" are reserved for use by WebGL. A shader which declares
579         a function, variable, structure name, or structure field starting with these prefixes must
580         not be allowed to load.
581     </p>
582
583 <!-- ======================================================================================================= -->
584
585     <h3>Defense Against Denial of Service</h3>
586     <div class="note">        
587     <p>
588     It is possible to create, either intentionally or unintentionally, combinations of shaders and
589     geometry that take an undesirably long time to render. This issue is analogous to that of
590     long-running scripts, for which user agents already have safeguards. However, long-running draw
591     calls can cause loss of interactivity for the entire window system, not just the user agent.
592     </p>
593
594     <p>
595     In the general case it is not possible to impose limits on the structure of incoming shaders to
596     guard against this problem. Experimentation has shown that even very strict structural limits
597     are insufficient to prevent long rendering times, and such limits would prevent shader authors
598     from implementing common algorithms.
599     </p>
600
601     <p>
602     User agents should implement safeguards to prevent excessively long rendering times and
603     associated loss of interactivity. Suggested safeguards include:
604     </p>
605
606     <ul>
607
608     <li> Splitting up draw calls with large numbers of elements into smaller draw calls.
609
610     <li> Timing individual draw calls and forbidding further rendering from a page if a certain
611          timeout is exceeded.
612
613     <li> Using any watchdog facilities available at the user level, graphics API level, or operating
614          system level to limit the duration of draw calls.
615
616     <li> Separating the graphics rendering of the user agent into a distinct operating system
617          process which can be terminated and restarted without losing application state.
618
619     </ul>
620
621     <p>
622     The supporting infrastructure at the OS and graphics API layer is expected to improve over time,
623     which is why the exact nature of these safeguards is not specified.
624     </p>
625     </div>
626 <!-- ======================================================================================================= -->
627
628     <h3><a name="OUT_OF_RANGE_ARRAY_ACCESSES">Out-of-Range Array Accesses</a></h3>
629
630     <p>
631         Shaders must not be allowed to read or write array elements that lie outside the bounds of
632         the array. This includes any variable of array type, as well as vector or matrix types such
633         as <code>vec3</code> or <code>mat4</code> when accessed using array subscripting syntax. If
634         detected during compilation, such accesses must generate an error and prevent the shader
635         from compiling. Otherwise, at runtime they shall return zero or the value at any valid index
636         of the same array.
637     </p>
638     <div class="note">
639         <p>
640             See <a href="#SUPPORTED_GLSL_CONSTRUCTS">Supported GLSL Constructs</a> for more information
641             on restrictions which simplify static analysis of the array indexing operations in shaders.
642         </p>
643     </div>
644 <!-- ======================================================================================================= -->
645
646     <h2>DOM Interfaces</h2>
647
648     <p>
649         This section describes the interfaces and functionality added to the
650         DOM to support runtime access to the functionality described above.
651     </p>
652
653 <!-- ======================================================================================================= -->
654
655     <h3>Types</h3>
656
657     <p>
658         The following types are used in all interfaces in the following section.
659     </p>
660     <pre class="idl">
661 typedef unsigned long  GLenum;
662 typedef boolean        GLboolean;
663 typedef unsigned long  GLbitfield;
664 typedef byte           GLbyte;         /* 'byte' should be a signed 8 bit type. */
665 typedef short          GLshort;
666 typedef long           GLint;
667 typedef long           GLsizei;
668 typedef long long      GLintptr;
669 typedef long long      GLsizeiptr;
670 // Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
671 typedef octet          GLubyte;        /* 'octet' should be an unsigned 8 bit type. */
672 typedef unsigned short GLushort;
673 typedef unsigned long  GLuint;
674 typedef unrestricted float GLfloat;
675 typedef unrestricted float GLclampf;  
676 </pre>
677
678 <!-- ======================================================================================================= -->
679
680     <h3><a name="WEBGLCONTEXTATTRIBUTES">WebGLContextAttributes</a></h3>
681
682     <p>
683         The <code>WebGLContextAttributes</code> dictionary contains drawing surface attributes and
684         is passed as the second parameter to <code>getContext</code>.
685     </p>
686     <pre class="idl">dictionary <dfn id="WebGLContextAttributes">WebGLContextAttributes</dfn> {
687     GLboolean alpha = true;
688     GLboolean depth = true;
689     GLboolean stencil = false;
690     GLboolean antialias = true;
691     GLboolean premultipliedAlpha = true;
692     GLboolean preserveDrawingBuffer = false;
693     GLboolean preferLowPowerToHighPerformance = false;
694     GLboolean failIfMajorPerformanceCaveat = false;
695 };</pre>
696
697     <h4>Context creation parameters</h4>
698
699     <p>
700         The following list describes each attribute in the WebGLContextAttributes object and its
701         use. The default value for each attribute is shown above. The default value is used either
702         if no second parameter is passed to <code>getContext</code>, or if a user object is passed
703         which has no attribute of the given name.
704     </p>
705     <dl>
706         <dt><span class=prop-value>alpha</span></dt>
707             <dd>
708                 If the value is true, the drawing buffer has an alpha channel for the purposes of
709                 performing OpenGL destination alpha operations and compositing with the page. If the
710                 value is false, no alpha buffer is available.
711             </dd>
712         <dt> <span class=prop-value>depth</span>
713             <dd>
714                 If the value is true, the drawing buffer has a depth buffer of at least 16 bits. If
715                 the value is false, no depth buffer is available.
716            </dd>
717         <dt> <span class=prop-value>stencil</span>
718             <dd>
719                 If the value is true, the drawing buffer has a stencil buffer of at least 8 bits. If
720                 the value is false, no stencil buffer is available.
721             </dd>
722         <dt> <span class=prop-value>antialias</span>
723             <dd>
724                 If the value is true and the implementation supports antialiasing the drawing buffer
725                 will perform antialiasing using its choice of technique (multisample/supersample)
726                 and quality. If the value is false or the implementation does not support
727                 antialiasing, no antialiasing is performed.
728             </dd>
729         <dt> <span class=prop-value>premultipliedAlpha</span>
730             <dd>
731                 If the value is true the page compositor will assume the drawing buffer contains
732                 colors with premultiplied alpha. If the value is false the page compositor will
733                 assume that colors in the drawing buffer are not premultiplied. This flag is ignored
734                 if the <strong>alpha</strong> flag is
735                 false. See <a href="#PREMULTIPLIED_ALPHA">Premultiplied Alpha</a> for more
736                 information on the effects of the <code>premultipliedAlpha</code> flag.
737             </dd>
738         <dt> <span class=prop-value>preserveDrawingBuffer</span>
739             <dd>
740                 If false, once the drawing buffer is presented as described in
741                 the<a href="#THE_DRAWING_BUFFER">Drawing Buffer</a> section, the contents of the
742                 drawing buffer are cleared to their default values.  All elements of the drawing
743                 buffer (color, depth and stencil) are cleared.  If the value is true the buffers
744                 will not be cleared and will preserve their values until cleared or overwritten by
745                 the author.
746                 <blockquote>
747                 <em>
748                     On some hardware setting the <code>preserveDrawingBuffer</code> flag 
749                     to true can have significant performance implications.
750                 </em>
751                 </blockquote>
752             </dd>
753         <dt><span class=prop-value>preferLowPowerToHighPerformance</span></dt>
754             <dd>
755               Provides a hint to the implementation suggesting that, if possible, it
756               creates a context that optimizes for power consumption over
757               performance. For example, on hardware that has more than one
758               GPU, it may be the case that one of them is less powerful
759               but also uses less power. An implementation may choose to, and may
760               have to, ignore this hint.
761             </dd>
762         <dt> <span class=prop-value>failIfMajorPerformanceCaveat</span></dt>
763             <dd>
764               If the value is true, context creation will fail if the implementation determines
765               that the performance of the created WebGL context would be dramatically lower
766               than that of a native application making equivalent OpenGL calls. This could happen
767               for a number of reasons, including:
768               <ul>
769                 <li>An implementation might switch to a software rasterizer if the user's GPU
770                     driver is known to be unstable.
771                 <li>An implementation might require reading back the framebuffer from GPU memory
772                     to system memory before compositing it with the rest of the page,
773                     significantly reducing performance.
774               </ul>
775               Applications that don't require high performance should leave this parameter at its
776               default value of <code>false</code>. Applications that require high performance may
777               set this parameter to <code>true</code>, and if context creation fails then the
778               application may prefer to use a fallback rendering path such as a 2D canvas context.
779               Alternatively the application can retry WebGL context creation with this parameter
780               set to <code>false</code>, with the knowledge that a reduced-fidelity rendering mode
781               should be used to improve performance.
782             </dd>
783     </dl>
784     <div class="example">
785     Here is an ECMAScript example which passes a WebGLContextAttributes argument
786     to <code>getContext</code>.  It assumes the presence of a canvas element named "canvas1" on the
787     page.
788
789     <pre>
790 var canvas = document.getElementById('canvas1');
791 var context = canvas.getContext('webgl',
792                                 { antialias: false,
793                                   stencil: true });
794     </pre>
795     </div>
796
797 <!-- ======================================================================================================= -->
798
799     <h3>WebGLObject</h3>
800
801     <p>
802         The <code>WebGLObject</code> interface is the parent interface for all GL objects.
803     </p>
804     <p>
805         Each <code>WebGLObject</code> has
806         an <b><a name="webgl-object-invalidated-flag">invalidated</a></b> flag, which is initially unset.
807     </p>
808     <pre class="idl">interface <dfn id="WebGLObject">WebGLObject</dfn> {
809 };</pre>
810
811 <!-- ======================================================================================================= -->
812
813     <h3>WebGLBuffer</h3>
814
815     <p>
816         The <code>WebGLBuffer</code> interface represents an OpenGL Buffer Object. The
817         underlying object is created as if by calling glGenBuffers 
818         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenBuffers.xml">man page</a>)</span>
819         , bound as if by calling glBindBuffer
820         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindBuffer.xml">man page</a>)</span>
821         and destroyed as if by calling glDeleteBuffers
822         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteBuffers.xml">man page</a>)</span>
823         .
824     </p>
825     <pre class="idl">interface <dfn id="WebGLBuffer">WebGLBuffer</dfn> : WebGLObject {
826 };</pre>
827
828 <!-- ======================================================================================================= -->
829
830     <h3><a name="WEBGL_FRAMEBUFFER">WebGLFramebuffer</a></h3>
831
832     <p>
833         The <code>WebGLFramebuffer</code> interface represents an OpenGL Framebuffer Object. The
834         underlying object is created as if by calling glGenFramebuffers
835         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenFramebuffers.xml">man page</a>)</span>
836         , bound as if by calling glBindFramebuffer
837         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindFramebuffer.xml">man page</a>)</span>
838         and destroyed as if by calling glDeleteFramebuffers
839         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteFramebuffers.xml">man page</a>)</span>
840         .
841     </p>
842     <pre class="idl">interface <dfn id="WebGLFramebuffer">WebGLFramebuffer</dfn> : WebGLObject {
843 };</pre>
844
845 <!-- ======================================================================================================= -->
846
847     <h3>WebGLProgram</h3>
848
849     <p>
850         The <code>WebGLProgram</code> interface represents an OpenGL Program Object. The
851         underlying object is created as if by calling glCreateProgram
852         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCreateProgram.xml">man page</a>)</span>
853         , used as if by calling glUseProgram
854         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glUseProgram.xml">man page</a>)</span>
855         and destroyed as if by calling glDeleteProgram
856         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteProgram.xml">man page</a>)</span>
857         .
858     </p>
859     <pre class="idl">interface <dfn id="WebGLProgram">WebGLProgram</dfn> : WebGLObject {
860 };</pre>
861
862 <!-- ======================================================================================================= -->
863
864     <h3>WebGLRenderbuffer</h3>
865
866     <p>
867         The <code>WebGLRenderbuffer</code> interface represents an OpenGL Renderbuffer Object. The
868         underlying object is created as if by calling glGenRenderbuffers
869         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenRenderbuffers.xml">man page</a>)</span>
870         , bound as if by calling glBindRenderbuffer
871         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindRenderbuffer.xml">man page</a>)</span>
872         and destroyed as if by calling glDeleteRenderbuffers
873         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteRenderbuffers.xml">man page</a>)</span>
874         .
875     </p>
876     <pre class="idl">interface <dfn id="WebGLRenderbuffer">WebGLRenderbuffer</dfn> : WebGLObject {
877 };</pre>
878
879 <!-- ======================================================================================================= -->
880
881     <h3>WebGLShader</h3>
882
883     <p>
884         The <code>WebGLShader</code> interface represents an OpenGL Shader Object. The
885         underlying object is created as if by calling glCreateShader
886         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCreateShader.xml">man page</a>)</span>
887         , attached to a Program as if by calling glAttachShader
888         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glAttachShader.xml">man page</a>)</span>
889         and destroyed as if by calling glDeleteShader
890         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteShader.xml">man page</a>)</span>
891         .
892     </p>
893     <pre class="idl">interface <dfn id="WebGLShader">WebGLShader</dfn> : WebGLObject {
894 };</pre>
895
896 <!-- ======================================================================================================= -->
897
898     <h3>WebGLTexture</h3>
899
900     <p>
901         The <code>WebGLTexture</code> interface represents an OpenGL Texture Object. The
902         underlying object is created as if by calling glGenTextures
903         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenTextures.xml">man page</a>)</span>
904         , bound as if by calling glBindTexture
905         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindTexture.xml">man page</a>)</span>
906         and destroyed as if by calling glDeleteTextures
907         <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteTextures.xml">man page</a>)</span>
908         .
909     </p>
910     <pre class="idl">interface <dfn id="WebGLTexture">WebGLTexture</dfn> : WebGLObject {
911 };</pre>
912
913 <!-- ======================================================================================================= -->
914
915     <h3>WebGLUniformLocation</h3>
916
917     <p>
918         The <code>WebGLUniformLocation</code> interface represents the location of a uniform variable 
919         in a shader program.
920     </p>
921     <pre class="idl">interface <dfn id="WebGLUniformLocation">WebGLUniformLocation</dfn> {
922 };</pre>
923
924 <!-- ======================================================================================================= -->
925
926     <h3>WebGLActiveInfo</h3>
927
928     <p>
929         The <code>WebGLActiveInfo</code> interface represents the information returned 
930         from the getActiveAttrib and getActiveUniform calls.
931     </p>
932     <pre class="idl">interface <dfn id="WebGLActiveInfo">WebGLActiveInfo</dfn> {
933     readonly attribute GLint size;
934     readonly attribute GLenum type;
935     readonly attribute DOMString name;
936 };</pre>
937
938     <h4>Attributes</h4>
939
940     <p>
941         The following attributes are available:
942     </p>
943
944     <dl class="methods">
945         <dt>
946             <code class=attribute-name>
947                 <a id="DOM-WebGLActiveInfo-size">
948                     size
949                 </a>
950             </code> 
951             of type <code>GLint</code>
952         <dd>
953             The size of the requested variable.
954         <dt>
955             <code class=attribute-name>
956                 <a id="DOM-WebGLActiveInfo-type">
957                     type
958                 </a>
959             </code> 
960             of type <code>GLenum</code>
961         <dd>
962             The data type of the requested variable.
963         <dt>
964             <code class=attribute-name>
965                 <a id="DOM-WebGLActiveInfo-name">
966                     name
967                 </a>
968             </code> 
969             of type <code>DOMString</code>
970         <dd>
971             The name of the requested variable.
972     </dl>
973
974 <!-- ======================================================================================================= -->
975
976     <h3>WebGLShaderPrecisionFormat</h3>
977
978     <p>
979         The <code>WebGLShaderPrecisionFormat</code> interface represents the information returned 
980         from the getShaderPrecisionFormat call.
981     </p>
982     <pre class="idl">interface <dfn id="WebGLShaderPrecisionFormat">WebGLShaderPrecisionFormat</dfn> {
983     readonly attribute GLint rangeMin;
984     readonly attribute GLint rangeMax;
985     readonly attribute GLint precision;
986 };</pre>
987
988     <h4>Attributes</h4>
989
990     <p>
991         The following attributes are available:
992     </p>
993
994     <dl class="methods">
995         <dt>
996             <code class=attribute-name>
997                 <a id="DOM-WebGLShaderPrecisionFormat-rangeMin">
998                     rangeMin
999                 </a>
1000             </code> 
1001             of type <code>GLint</code>
1002         <dd>
1003             The base 2 log of the absolute value of the minimum value that can be represented.
1004         <dt>
1005             <code class=attribute-name>
1006                 <a id="DOM-WebGLShaderPrecisionFormat-rangeMax">
1007                     rangeMax
1008                 </a>
1009             </code> 
1010             of type <code>GLint</code>
1011         <dd>
1012             The base 2 log of the absolute value of the maximum value that can be represented.
1013         <dt>
1014             <code class=attribute-name>
1015                 <a id="DOM-WebGLShaderPrecisionFormat-precision">
1016                     precision
1017                 </a>
1018             </code> 
1019             of type <code>GLint</code>
1020         <dd>
1021             The number of bits of precision that can be represented. For integer formats this value
1022             is always 0.
1023     </dl>
1024
1025 <!-- ======================================================================================================= -->
1026
1027     <h3><a name="ARRAYBUFFER">ArrayBuffer</a> and <a name="TYPEDARRAY">Typed Arrays</a></h3>
1028
1029     <p>
1030         Vertex, index, texture, and other data is transferred to the WebGL implementation using
1031         the <a href="../../../../typedarray/specs/latest/#ARRAYBUFFER">ArrayBuffer</a>
1032         and <a href="../../../../typedarray/specs/latest/#TYPEDARRAYS">views</a> defined in
1033         the <a href="../../../../typedarray/specs/latest/">Typed Array</a>
1034         specification <a href="#refsTYPEDARRAYS">[TYPEDARRAYS]</a>.
1035     </p>
1036     <p>
1037         Typed Arrays support the creation of interleaved, heterogeneous vertex data; uploading of
1038         distinct blocks of data into a large vertex buffer object; and most other use cases required
1039         by OpenGL programs.
1040     </p>
1041
1042     <div class="example">
1043     Here is an ECMAScript example showing access to the same ArrayBuffer using different types of
1044     typed arrays. In this case the buffer contains a floating point vertex position (x, y, z)
1045     followed by a color as 4 unsigned bytes (r, g, b, a).
1046
1047     <pre>
1048 var numVertices = 100; // for example
1049
1050 // Compute the size needed for the buffer, in bytes and floats
1051 var vertexSize = 3 * Float32Array.BYTES_PER_ELEMENT +
1052      4 * Uint8Array.BYTES_PER_ELEMENT;
1053 var vertexSizeInFloats = vertexSize / Float32Array.BYTES_PER_ELEMENT;
1054
1055 // Allocate the buffer
1056 var buf = new ArrayBuffer(numVertices * vertexSize);
1057
1058 // Map this buffer to a Float32Array to access the positions
1059 var positionArray = new Float32Array(buf);
1060
1061 // Map the same buffer to a Uint8Array to access the color
1062 var colorArray = new Uint8Array(buf);
1063
1064 // Set up the initial offset of the vertices and colors within the buffer
1065 var positionIdx = 0;
1066 var colorIdx = 3 * Float32Array.BYTES_PER_ELEMENT;
1067
1068 // Initialize the buffer
1069 for (var i = 0; i < numVertices; i++) {
1070     positionArray[positionIdx] = ...;
1071     positionArray[positionIdx + 1] = ...;
1072     positionArray[positionIdx + 2] = ...;
1073     colorArray[colorIdx] = ...;
1074     colorArray[colorIdx + 1] = ...;
1075     colorArray[colorIdx + 2] = ...;
1076     colorArray[colorIdx + 3] = ...;
1077     positionIdx += vertexSizeInFloats;
1078     colorIdx += vertexSize;
1079 }
1080     </pre>
1081     </div>
1082
1083 <!-- ======================================================================================================= -->
1084
1085     <h3><a name="WEBGLRENDERINGCONTEXT">The WebGL context</a></h3>
1086
1087     <p>
1088         The <code>WebGLRenderingContext</code> represents the API allowing
1089         OpenGL ES 2.0 style rendering into the canvas element.
1090     </p>
1091     <p>
1092         Before performing the implementation of any method of the <code>WebGLRenderingContext</code>
1093         interface or any method of an interface returned by the <code>getExtension</code> method,
1094         the following steps must be performed:
1095
1096         <ol class="nestedlist">
1097
1098         <li> If the <code>[WebGLHandlesContextLoss]</code> extended attribute appears on the called
1099         method, perform the implementation of the called method, return its result and terminate
1100         these steps. </li>
1101
1102         <li> Let <em>use default return value</em> be false. </li>
1103
1104         <li> If the <a href="#webgl-context-lost-flag">webgl context lost flag</a> is set,
1105         let <em>use default return value</em> be true. </li>
1106
1107         <li> If any argument to the method is a <code>WebGLObject</code> with
1108         its <a href="#webgl-object-invalidated-flag">invalidated flag</a> set, generate
1109         an <code>INVALID_OPERATION</code> error and let <em>use default return value</em> be
1110         true. </li>
1111
1112         <li> If <em>use default return value</em> is true, perform the following steps:
1113
1114             <ol class="nestedlist">
1115
1116             <li> If the return type of the called method is <code>any</code> or any nullable type,
1117             return null. </li>
1118
1119             <li> Terminate this algorithm without calling the method implementation. </li>
1120
1121             </ol>
1122
1123         <li> Otherwise, perform the implementation of the called method and return its result. </li>
1124
1125         </ol>
1126     </p>
1127     <p>
1128     See <a href="#CONTEXT_LOST">the context lost event</a> for further details.
1129     </p>
1130     <pre class="idl">
1131 [NoInterfaceObject]
1132 interface <dfn id="WebGLRenderingContextBase">WebGLRenderingContextBase</dfn>
1133 {
1134
1135     /* ClearBufferMask */
1136     const GLenum DEPTH_BUFFER_BIT               = 0x00000100;
1137     const GLenum STENCIL_BUFFER_BIT             = 0x00000400;
1138     const GLenum COLOR_BUFFER_BIT               = 0x00004000;
1139     
1140     /* BeginMode */
1141     const GLenum POINTS                         = 0x0000;
1142     const GLenum LINES                          = 0x0001;
1143     const GLenum LINE_LOOP                      = 0x0002;
1144     const GLenum LINE_STRIP                     = 0x0003;
1145     const GLenum TRIANGLES                      = 0x0004;
1146     const GLenum TRIANGLE_STRIP                 = 0x0005;
1147     const GLenum TRIANGLE_FAN                   = 0x0006;
1148     
1149     /* AlphaFunction (not supported in ES20) */
1150     /*      NEVER */
1151     /*      LESS */
1152     /*      EQUAL */
1153     /*      LEQUAL */
1154     /*      GREATER */
1155     /*      NOTEQUAL */
1156     /*      GEQUAL */
1157     /*      ALWAYS */
1158     
1159     /* BlendingFactorDest */
1160     const GLenum ZERO                           = 0;
1161     const GLenum ONE                            = 1;
1162     const GLenum SRC_COLOR                      = 0x0300;
1163     const GLenum ONE_MINUS_SRC_COLOR            = 0x0301;
1164     const GLenum SRC_ALPHA                      = 0x0302;
1165     const GLenum ONE_MINUS_SRC_ALPHA            = 0x0303;
1166     const GLenum DST_ALPHA                      = 0x0304;
1167     const GLenum ONE_MINUS_DST_ALPHA            = 0x0305;
1168     
1169     /* BlendingFactorSrc */
1170     /*      ZERO */
1171     /*      ONE */
1172     const GLenum DST_COLOR                      = 0x0306;
1173     const GLenum ONE_MINUS_DST_COLOR            = 0x0307;
1174     const GLenum SRC_ALPHA_SATURATE             = 0x0308;
1175     /*      SRC_ALPHA */
1176     /*      ONE_MINUS_SRC_ALPHA */
1177     /*      DST_ALPHA */
1178     /*      ONE_MINUS_DST_ALPHA */
1179     
1180     /* BlendEquationSeparate */
1181     const GLenum FUNC_ADD                       = 0x8006;
1182     const GLenum BLEND_EQUATION                 = 0x8009;
1183     const GLenum BLEND_EQUATION_RGB             = 0x8009;   /* same as BLEND_EQUATION */
1184     const GLenum BLEND_EQUATION_ALPHA           = 0x883D;
1185     
1186     /* BlendSubtract */
1187     const GLenum FUNC_SUBTRACT                  = 0x800A;
1188     const GLenum FUNC_REVERSE_SUBTRACT          = 0x800B;
1189     
1190     /* Separate Blend Functions */
1191     const GLenum BLEND_DST_RGB                  = 0x80C8;
1192     const GLenum BLEND_SRC_RGB                  = 0x80C9;
1193     const GLenum BLEND_DST_ALPHA                = 0x80CA;
1194     const GLenum BLEND_SRC_ALPHA                = 0x80CB;
1195     const GLenum CONSTANT_COLOR                 = 0x8001;
1196     const GLenum ONE_MINUS_CONSTANT_COLOR       = 0x8002;
1197     const GLenum CONSTANT_ALPHA                 = 0x8003;
1198     const GLenum ONE_MINUS_CONSTANT_ALPHA       = 0x8004;
1199     const GLenum BLEND_COLOR                    = 0x8005;
1200     
1201     /* Buffer Objects */
1202     const GLenum ARRAY_BUFFER                   = 0x8892;
1203     const GLenum ELEMENT_ARRAY_BUFFER           = 0x8893;
1204     const GLenum ARRAY_BUFFER_BINDING           = 0x8894;
1205     const GLenum ELEMENT_ARRAY_BUFFER_BINDING   = 0x8895;
1206     
1207     const GLenum STREAM_DRAW                    = 0x88E0;
1208     const GLenum STATIC_DRAW                    = 0x88E4;
1209     const GLenum DYNAMIC_DRAW                   = 0x88E8;
1210     
1211     const GLenum BUFFER_SIZE                    = 0x8764;
1212     const GLenum BUFFER_USAGE                   = 0x8765;
1213     
1214     const GLenum CURRENT_VERTEX_ATTRIB          = 0x8626;
1215     
1216     /* CullFaceMode */
1217     const GLenum FRONT                          = 0x0404;
1218     const GLenum BACK                           = 0x0405;
1219     const GLenum FRONT_AND_BACK                 = 0x0408;
1220     
1221     /* DepthFunction */
1222     /*      NEVER */
1223     /*      LESS */
1224     /*      EQUAL */
1225     /*      LEQUAL */
1226     /*      GREATER */
1227     /*      NOTEQUAL */
1228     /*      GEQUAL */
1229     /*      ALWAYS */
1230     
1231     /* EnableCap */
1232     /* TEXTURE_2D */
1233     const GLenum CULL_FACE                      = 0x0B44;
1234     const GLenum BLEND                          = 0x0BE2;
1235     const GLenum DITHER                         = 0x0BD0;
1236     const GLenum STENCIL_TEST                   = 0x0B90;
1237     const GLenum DEPTH_TEST                     = 0x0B71;
1238     const GLenum SCISSOR_TEST                   = 0x0C11;
1239     const GLenum POLYGON_OFFSET_FILL            = 0x8037;
1240     const GLenum SAMPLE_ALPHA_TO_COVERAGE       = 0x809E;
1241     const GLenum SAMPLE_COVERAGE                = 0x80A0;
1242     
1243     /* ErrorCode */
1244     const GLenum NO_ERROR                       = 0;
1245     const GLenum INVALID_ENUM                   = 0x0500;
1246     const GLenum INVALID_VALUE                  = 0x0501;
1247     const GLenum INVALID_OPERATION              = 0x0502;
1248     const GLenum OUT_OF_MEMORY                  = 0x0505;
1249     
1250     /* FrontFaceDirection */
1251     const GLenum CW                             = 0x0900;
1252     const GLenum CCW                            = 0x0901;
1253     
1254     /* GetPName */
1255     const GLenum LINE_WIDTH                     = 0x0B21;
1256     const GLenum ALIASED_POINT_SIZE_RANGE       = 0x846D;
1257     const GLenum ALIASED_LINE_WIDTH_RANGE       = 0x846E;
1258     const GLenum CULL_FACE_MODE                 = 0x0B45;
1259     const GLenum FRONT_FACE                     = 0x0B46;
1260     const GLenum DEPTH_RANGE                    = 0x0B70;
1261     const GLenum DEPTH_WRITEMASK                = 0x0B72;
1262     const GLenum DEPTH_CLEAR_VALUE              = 0x0B73;
1263     const GLenum DEPTH_FUNC                     = 0x0B74;
1264     const GLenum STENCIL_CLEAR_VALUE            = 0x0B91;
1265     const GLenum STENCIL_FUNC                   = 0x0B92;
1266     const GLenum STENCIL_FAIL                   = 0x0B94;
1267     const GLenum STENCIL_PASS_DEPTH_FAIL        = 0x0B95;
1268     const GLenum STENCIL_PASS_DEPTH_PASS        = 0x0B96;
1269     const GLenum STENCIL_REF                    = 0x0B97;
1270     const GLenum STENCIL_VALUE_MASK             = 0x0B93;
1271     const GLenum STENCIL_WRITEMASK              = 0x0B98;
1272     const GLenum STENCIL_BACK_FUNC              = 0x8800;
1273     const GLenum STENCIL_BACK_FAIL              = 0x8801;
1274     const GLenum STENCIL_BACK_PASS_DEPTH_FAIL   = 0x8802;
1275     const GLenum STENCIL_BACK_PASS_DEPTH_PASS   = 0x8803;
1276     const GLenum STENCIL_BACK_REF               = 0x8CA3;
1277     const GLenum STENCIL_BACK_VALUE_MASK        = 0x8CA4;
1278     const GLenum STENCIL_BACK_WRITEMASK         = 0x8CA5;
1279     const GLenum VIEWPORT                       = 0x0BA2;
1280     const GLenum SCISSOR_BOX                    = 0x0C10;
1281     /*      SCISSOR_TEST */
1282     const GLenum COLOR_CLEAR_VALUE              = 0x0C22;
1283     const GLenum COLOR_WRITEMASK                = 0x0C23;
1284     const GLenum UNPACK_ALIGNMENT               = 0x0CF5;
1285     const GLenum PACK_ALIGNMENT                 = 0x0D05;
1286     const GLenum MAX_TEXTURE_SIZE               = 0x0D33;
1287     const GLenum MAX_VIEWPORT_DIMS              = 0x0D3A;
1288     const GLenum SUBPIXEL_BITS                  = 0x0D50;
1289     const GLenum RED_BITS                       = 0x0D52;
1290     const GLenum GREEN_BITS                     = 0x0D53;
1291     const GLenum BLUE_BITS                      = 0x0D54;
1292     const GLenum ALPHA_BITS                     = 0x0D55;
1293     const GLenum DEPTH_BITS                     = 0x0D56;
1294     const GLenum STENCIL_BITS                   = 0x0D57;
1295     const GLenum POLYGON_OFFSET_UNITS           = 0x2A00;
1296     /*      POLYGON_OFFSET_FILL */
1297     const GLenum POLYGON_OFFSET_FACTOR          = 0x8038;
1298     const GLenum TEXTURE_BINDING_2D             = 0x8069;
1299     const GLenum SAMPLE_BUFFERS                 = 0x80A8;
1300     const GLenum SAMPLES                        = 0x80A9;
1301     const GLenum SAMPLE_COVERAGE_VALUE          = 0x80AA;
1302     const GLenum SAMPLE_COVERAGE_INVERT         = 0x80AB;
1303     
1304     /* GetTextureParameter */
1305     /*      TEXTURE_MAG_FILTER */
1306     /*      TEXTURE_MIN_FILTER */
1307     /*      TEXTURE_WRAP_S */
1308     /*      TEXTURE_WRAP_T */
1309     
1310     const GLenum COMPRESSED_TEXTURE_FORMATS     = 0x86A3;
1311     
1312     /* HintMode */
1313     const GLenum DONT_CARE                      = 0x1100;
1314     const GLenum FASTEST                        = 0x1101;
1315     const GLenum NICEST                         = 0x1102;
1316     
1317     /* HintTarget */
1318     const GLenum GENERATE_MIPMAP_HINT            = 0x8192;
1319     
1320     /* DataType */
1321     const GLenum BYTE                           = 0x1400;
1322     const GLenum UNSIGNED_BYTE                  = 0x1401;
1323     const GLenum SHORT                          = 0x1402;
1324     const GLenum UNSIGNED_SHORT                 = 0x1403;
1325     const GLenum INT                            = 0x1404;
1326     const GLenum UNSIGNED_INT                   = 0x1405;
1327     const GLenum FLOAT                          = 0x1406;
1328     
1329     /* PixelFormat */
1330     const GLenum DEPTH_COMPONENT                = 0x1902;
1331     const GLenum ALPHA                          = 0x1906;
1332     const GLenum RGB                            = 0x1907;
1333     const GLenum RGBA                           = 0x1908;
1334     const GLenum LUMINANCE                      = 0x1909;
1335     const GLenum LUMINANCE_ALPHA                = 0x190A;
1336     
1337     /* PixelType */
1338     /*      UNSIGNED_BYTE */
1339     const GLenum UNSIGNED_SHORT_4_4_4_4         = 0x8033;
1340     const GLenum UNSIGNED_SHORT_5_5_5_1         = 0x8034;
1341     const GLenum UNSIGNED_SHORT_5_6_5           = 0x8363;
1342     
1343     /* Shaders */
1344     const GLenum FRAGMENT_SHADER                  = 0x8B30;
1345     const GLenum VERTEX_SHADER                    = 0x8B31;
1346     const GLenum MAX_VERTEX_ATTRIBS               = 0x8869;
1347     const GLenum MAX_VERTEX_UNIFORM_VECTORS       = 0x8DFB;
1348     const GLenum MAX_VARYING_VECTORS              = 0x8DFC;
1349     const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
1350     const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS   = 0x8B4C;
1351     const GLenum MAX_TEXTURE_IMAGE_UNITS          = 0x8872;
1352     const GLenum MAX_FRAGMENT_UNIFORM_VECTORS     = 0x8DFD;
1353     const GLenum SHADER_TYPE                      = 0x8B4F;
1354     const GLenum DELETE_STATUS                    = 0x8B80;
1355     const GLenum LINK_STATUS                      = 0x8B82;
1356     const GLenum VALIDATE_STATUS                  = 0x8B83;
1357     const GLenum ATTACHED_SHADERS                 = 0x8B85;
1358     const GLenum ACTIVE_UNIFORMS                  = 0x8B86;
1359     const GLenum ACTIVE_ATTRIBUTES                = 0x8B89;
1360     const GLenum SHADING_LANGUAGE_VERSION         = 0x8B8C;
1361     const GLenum CURRENT_PROGRAM                  = 0x8B8D;
1362     
1363     /* StencilFunction */
1364     const GLenum NEVER                          = 0x0200;
1365     const GLenum LESS                           = 0x0201;
1366     const GLenum EQUAL                          = 0x0202;
1367     const GLenum LEQUAL                         = 0x0203;
1368     const GLenum GREATER                        = 0x0204;
1369     const GLenum NOTEQUAL                       = 0x0205;
1370     const GLenum GEQUAL                         = 0x0206;
1371     const GLenum ALWAYS                         = 0x0207;
1372     
1373     /* StencilOp */
1374     /*      ZERO */
1375     const GLenum KEEP                           = 0x1E00;
1376     const GLenum REPLACE                        = 0x1E01;
1377     const GLenum INCR                           = 0x1E02;
1378     const GLenum DECR                           = 0x1E03;
1379     const GLenum INVERT                         = 0x150A;
1380     const GLenum INCR_WRAP                      = 0x8507;
1381     const GLenum DECR_WRAP                      = 0x8508;
1382     
1383     /* StringName */
1384     const GLenum VENDOR                         = 0x1F00;
1385     const GLenum RENDERER                       = 0x1F01;
1386     const GLenum VERSION                        = 0x1F02;
1387     
1388     /* TextureMagFilter */
1389     const GLenum NEAREST                        = 0x2600;
1390     const GLenum LINEAR                         = 0x2601;
1391     
1392     /* TextureMinFilter */
1393     /*      NEAREST */
1394     /*      LINEAR */
1395     const GLenum NEAREST_MIPMAP_NEAREST         = 0x2700;
1396     const GLenum LINEAR_MIPMAP_NEAREST          = 0x2701;
1397     const GLenum NEAREST_MIPMAP_LINEAR          = 0x2702;
1398     const GLenum LINEAR_MIPMAP_LINEAR           = 0x2703;
1399     
1400     /* TextureParameterName */
1401     const GLenum TEXTURE_MAG_FILTER             = 0x2800;
1402     const GLenum TEXTURE_MIN_FILTER             = 0x2801;
1403     const GLenum TEXTURE_WRAP_S                 = 0x2802;
1404     const GLenum TEXTURE_WRAP_T                 = 0x2803;
1405     
1406     /* TextureTarget */
1407     const GLenum TEXTURE_2D                     = 0x0DE1;
1408     const GLenum TEXTURE                        = 0x1702;
1409     
1410     const GLenum TEXTURE_CUBE_MAP               = 0x8513;
1411     const GLenum TEXTURE_BINDING_CUBE_MAP       = 0x8514;
1412     const GLenum TEXTURE_CUBE_MAP_POSITIVE_X    = 0x8515;
1413     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X    = 0x8516;
1414     const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y    = 0x8517;
1415     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y    = 0x8518;
1416     const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z    = 0x8519;
1417     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z    = 0x851A;
1418     const GLenum MAX_CUBE_MAP_TEXTURE_SIZE      = 0x851C;
1419     
1420     /* TextureUnit */
1421     const GLenum TEXTURE0                       = 0x84C0;
1422     const GLenum TEXTURE1                       = 0x84C1;
1423     const GLenum TEXTURE2                       = 0x84C2;
1424     const GLenum TEXTURE3                       = 0x84C3;
1425     const GLenum TEXTURE4                       = 0x84C4;
1426     const GLenum TEXTURE5                       = 0x84C5;
1427     const GLenum TEXTURE6                       = 0x84C6;
1428     const GLenum TEXTURE7                       = 0x84C7;
1429     const GLenum TEXTURE8                       = 0x84C8;
1430     const GLenum TEXTURE9                       = 0x84C9;
1431     const GLenum TEXTURE10                      = 0x84CA;
1432     const GLenum TEXTURE11                      = 0x84CB;
1433     const GLenum TEXTURE12                      = 0x84CC;
1434     const GLenum TEXTURE13                      = 0x84CD;
1435     const GLenum TEXTURE14                      = 0x84CE;
1436     const GLenum TEXTURE15                      = 0x84CF;
1437     const GLenum TEXTURE16                      = 0x84D0;
1438     const GLenum TEXTURE17                      = 0x84D1;
1439     const GLenum TEXTURE18                      = 0x84D2;
1440     const GLenum TEXTURE19                      = 0x84D3;
1441     const GLenum TEXTURE20                      = 0x84D4;
1442     const GLenum TEXTURE21                      = 0x84D5;
1443     const GLenum TEXTURE22                      = 0x84D6;
1444     const GLenum TEXTURE23                      = 0x84D7;
1445     const GLenum TEXTURE24                      = 0x84D8;
1446     const GLenum TEXTURE25                      = 0x84D9;
1447     const GLenum TEXTURE26                      = 0x84DA;
1448     const GLenum TEXTURE27                      = 0x84DB;
1449     const GLenum TEXTURE28                      = 0x84DC;
1450     const GLenum TEXTURE29                      = 0x84DD;
1451     const GLenum TEXTURE30                      = 0x84DE;
1452     const GLenum TEXTURE31                      = 0x84DF;
1453     const GLenum ACTIVE_TEXTURE                 = 0x84E0;
1454     
1455     /* TextureWrapMode */
1456     const GLenum REPEAT                         = 0x2901;
1457     const GLenum CLAMP_TO_EDGE                  = 0x812F;
1458     const GLenum MIRRORED_REPEAT                = 0x8370;
1459     
1460     /* Uniform Types */
1461     const GLenum FLOAT_VEC2                     = 0x8B50;
1462     const GLenum FLOAT_VEC3                     = 0x8B51;
1463     const GLenum FLOAT_VEC4                     = 0x8B52;
1464     const GLenum INT_VEC2                       = 0x8B53;
1465     const GLenum INT_VEC3                       = 0x8B54;
1466     const GLenum INT_VEC4                       = 0x8B55;
1467     const GLenum BOOL                           = 0x8B56;
1468     const GLenum BOOL_VEC2                      = 0x8B57;
1469     const GLenum BOOL_VEC3                      = 0x8B58;
1470     const GLenum BOOL_VEC4                      = 0x8B59;
1471     const GLenum FLOAT_MAT2                     = 0x8B5A;
1472     const GLenum FLOAT_MAT3                     = 0x8B5B;
1473     const GLenum FLOAT_MAT4                     = 0x8B5C;
1474     const GLenum SAMPLER_2D                     = 0x8B5E;
1475     const GLenum SAMPLER_CUBE                   = 0x8B60;
1476     
1477     /* Vertex Arrays */
1478     const GLenum VERTEX_ATTRIB_ARRAY_ENABLED        = 0x8622;
1479     const GLenum VERTEX_ATTRIB_ARRAY_SIZE           = 0x8623;
1480     const GLenum VERTEX_ATTRIB_ARRAY_STRIDE         = 0x8624;
1481     const GLenum VERTEX_ATTRIB_ARRAY_TYPE           = 0x8625;
1482     const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED     = 0x886A;
1483     const GLenum VERTEX_ATTRIB_ARRAY_POINTER        = 0x8645;
1484     const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
1485     
1486     /* Read Format */
1487     const GLenum IMPLEMENTATION_COLOR_READ_TYPE   = 0x8B9A;
1488     const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
1489
1490     /* Shader Source */
1491     const GLenum COMPILE_STATUS                 = 0x8B81;
1492     
1493     /* Shader Precision-Specified Types */
1494     const GLenum LOW_FLOAT                      = 0x8DF0;
1495     const GLenum MEDIUM_FLOAT                   = 0x8DF1;
1496     const GLenum HIGH_FLOAT                     = 0x8DF2;
1497     const GLenum LOW_INT                        = 0x8DF3;
1498     const GLenum MEDIUM_INT                     = 0x8DF4;
1499     const GLenum HIGH_INT                       = 0x8DF5;
1500     
1501     /* Framebuffer Object. */
1502     const GLenum FRAMEBUFFER                    = 0x8D40;
1503     const GLenum RENDERBUFFER                   = 0x8D41;
1504     
1505     const GLenum RGBA4                          = 0x8056;
1506     const GLenum RGB5_A1                        = 0x8057;
1507     const GLenum RGB565                         = 0x8D62;
1508     const GLenum DEPTH_COMPONENT16              = 0x81A5;
1509     const GLenum STENCIL_INDEX                  = 0x1901;
1510     const GLenum STENCIL_INDEX8                 = 0x8D48;
1511     const GLenum DEPTH_STENCIL                  = 0x84F9;
1512     
1513     const GLenum RENDERBUFFER_WIDTH             = 0x8D42;
1514     const GLenum RENDERBUFFER_HEIGHT            = 0x8D43;
1515     const GLenum RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
1516     const GLenum RENDERBUFFER_RED_SIZE          = 0x8D50;
1517     const GLenum RENDERBUFFER_GREEN_SIZE        = 0x8D51;
1518     const GLenum RENDERBUFFER_BLUE_SIZE         = 0x8D52;
1519     const GLenum RENDERBUFFER_ALPHA_SIZE        = 0x8D53;
1520     const GLenum RENDERBUFFER_DEPTH_SIZE        = 0x8D54;
1521     const GLenum RENDERBUFFER_STENCIL_SIZE      = 0x8D55;
1522     
1523     const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           = 0x8CD0;
1524     const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           = 0x8CD1;
1525     const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         = 0x8CD2;
1526     const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
1527     
1528     const GLenum COLOR_ATTACHMENT0              = 0x8CE0;
1529     const GLenum DEPTH_ATTACHMENT               = 0x8D00;
1530     const GLenum STENCIL_ATTACHMENT             = 0x8D20;
1531     const GLenum DEPTH_STENCIL_ATTACHMENT       = 0x821A;
1532     
1533     const GLenum NONE                           = 0;
1534     
1535     const GLenum FRAMEBUFFER_COMPLETE                      = 0x8CD5;
1536     const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT         = 0x8CD6;
1537     const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
1538     const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS         = 0x8CD9;
1539     const GLenum FRAMEBUFFER_UNSUPPORTED                   = 0x8CDD;
1540     
1541     const GLenum FRAMEBUFFER_BINDING            = 0x8CA6;
1542     const GLenum RENDERBUFFER_BINDING           = 0x8CA7;
1543     const GLenum MAX_RENDERBUFFER_SIZE          = 0x84E8;
1544     
1545     const GLenum INVALID_FRAMEBUFFER_OPERATION  = 0x0506;
1546     
1547     /* WebGL-specific enums */
1548     const GLenum UNPACK_FLIP_Y_WEBGL            = 0x9240;
1549     const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
1550     const GLenum CONTEXT_LOST_WEBGL             = 0x9242;
1551     const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
1552     const GLenum BROWSER_DEFAULT_WEBGL          = 0x9244;
1553
1554     readonly attribute HTMLCanvasElement canvas;
1555     readonly attribute GLsizei drawingBufferWidth;
1556     readonly attribute GLsizei drawingBufferHeight;
1557
1558     [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
1559     [WebGLHandlesContextLoss] boolean isContextLost();
1560     
1561     sequence&lt;DOMString&gt;? getSupportedExtensions();
1562     object? getExtension(DOMString name);
1563
1564     void activeTexture(GLenum texture);
1565     void attachShader(WebGLProgram? program, WebGLShader? shader);
1566     void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name);
1567     void bindBuffer(GLenum target, WebGLBuffer? buffer);
1568     void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
1569     void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
1570     void bindTexture(GLenum target, WebGLTexture? texture);
1571     void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1572     void blendEquation(GLenum mode);
1573     void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
1574     void blendFunc(GLenum sfactor, GLenum dfactor);
1575     void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, 
1576                            GLenum srcAlpha, GLenum dstAlpha);
1577
1578     typedef (ArrayBuffer or ArrayBufferView) BufferDataSource;
1579     void bufferData(GLenum target, GLsizeiptr size, GLenum usage);
1580     void bufferData(GLenum target, BufferDataSource? data, GLenum usage);
1581     void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data);
1582
1583     [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
1584     void clear(GLbitfield mask);
1585     void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1586     void clearDepth(GLclampf depth);
1587     void clearStencil(GLint s);
1588     void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1589     void compileShader(WebGLShader? shader);
1590
1591     void compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
1592                               GLsizei width, GLsizei height, GLint border,
1593                               ArrayBufferView data);
1594     void compressedTexSubImage2D(GLenum target, GLint level,
1595                                  GLint xoffset, GLint yoffset,
1596                                  GLsizei width, GLsizei height, GLenum format,
1597                                  ArrayBufferView data);
1598
1599     void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, 
1600                         GLint x, GLint y, GLsizei width, GLsizei height, 
1601                         GLint border);
1602     void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
1603                            GLint x, GLint y, GLsizei width, GLsizei height);
1604
1605     WebGLBuffer? createBuffer();
1606     WebGLFramebuffer? createFramebuffer();
1607     WebGLProgram? createProgram();
1608     WebGLRenderbuffer? createRenderbuffer();
1609     WebGLShader? createShader(GLenum type);
1610     WebGLTexture? createTexture();
1611
1612     void cullFace(GLenum mode);
1613
1614     void deleteBuffer(WebGLBuffer? buffer);
1615     void deleteFramebuffer(WebGLFramebuffer? framebuffer);
1616     void deleteProgram(WebGLProgram? program);
1617     void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
1618     void deleteShader(WebGLShader? shader);
1619     void deleteTexture(WebGLTexture? texture);
1620
1621     void depthFunc(GLenum func);
1622     void depthMask(GLboolean flag);
1623     void depthRange(GLclampf zNear, GLclampf zFar);
1624     void detachShader(WebGLProgram? program, WebGLShader? shader);
1625     void disable(GLenum cap);
1626     void disableVertexAttribArray(GLuint index);
1627     void drawArrays(GLenum mode, GLint first, GLsizei count);
1628     void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
1629
1630     void enable(GLenum cap);
1631     void enableVertexAttribArray(GLuint index);
1632     void finish();
1633     void flush();
1634     void framebufferRenderbuffer(GLenum target, GLenum attachment, 
1635                                  GLenum renderbuffertarget, 
1636                                  WebGLRenderbuffer? renderbuffer);
1637     void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, 
1638                               WebGLTexture? texture, GLint level);
1639     void frontFace(GLenum mode);
1640
1641     void generateMipmap(GLenum target);
1642
1643     WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index);
1644     WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index);
1645     sequence&lt;WebGLShader&gt;? getAttachedShaders(WebGLProgram? program);
1646
1647     [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name);
1648
1649     any getBufferParameter(GLenum target, GLenum pname);
1650     any getParameter(GLenum pname);
1651
1652     [WebGLHandlesContextLoss] GLenum getError();
1653
1654     any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, 
1655                                           GLenum pname);
1656     any getProgramParameter(WebGLProgram? program, GLenum pname);
1657     DOMString? getProgramInfoLog(WebGLProgram? program);
1658     any getRenderbufferParameter(GLenum target, GLenum pname);
1659     any getShaderParameter(WebGLShader? shader, GLenum pname);
1660     WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
1661     DOMString? getShaderInfoLog(WebGLShader? shader);
1662
1663     DOMString? getShaderSource(WebGLShader? shader);
1664
1665     any getTexParameter(GLenum target, GLenum pname);
1666
1667     any getUniform(WebGLProgram? program, WebGLUniformLocation? location);
1668
1669     WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name);
1670
1671     any getVertexAttrib(GLuint index, GLenum pname);
1672
1673     [WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname);
1674
1675     void hint(GLenum target, GLenum mode);
1676     [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
1677     [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
1678     [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
1679     [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
1680     [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
1681     [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
1682     [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
1683     void lineWidth(GLfloat width);
1684     void linkProgram(WebGLProgram? program);
1685     void pixelStorei(GLenum pname, GLint param);
1686     void polygonOffset(GLfloat factor, GLfloat units);
1687
1688     void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, 
1689                     GLenum format, GLenum type, ArrayBufferView? pixels);
1690
1691     void renderbufferStorage(GLenum target, GLenum internalformat, 
1692                              GLsizei width, GLsizei height);
1693     void sampleCoverage(GLclampf value, GLboolean invert);
1694     void scissor(GLint x, GLint y, GLsizei width, GLsizei height);
1695
1696     void shaderSource(WebGLShader? shader, DOMString source);
1697
1698     void stencilFunc(GLenum func, GLint ref, GLuint mask);
1699     void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
1700     void stencilMask(GLuint mask);
1701     void stencilMaskSeparate(GLenum face, GLuint mask);
1702     void stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
1703     void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
1704
1705     typedef (ImageData or
1706              HTMLImageElement or
1707              HTMLCanvasElement or
1708              HTMLVideoElement) TexImageSource;
1709     void texImage2D(GLenum target, GLint level, GLenum internalformat, 
1710                     GLsizei width, GLsizei height, GLint border, GLenum format, 
1711                     GLenum type, ArrayBufferView? pixels);
1712     void texImage2D(GLenum target, GLint level, GLenum internalformat,
1713                     GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
1714
1715     void texParameterf(GLenum target, GLenum pname, GLfloat param);
1716     void texParameteri(GLenum target, GLenum pname, GLint param);
1717
1718     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
1719                        GLsizei width, GLsizei height, 
1720                        GLenum format, GLenum type, ArrayBufferView? pixels);
1721     void texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
1722                        GLenum format, GLenum type, TexImageSource? source); // May throw DOMException
1723
1724     void uniform1f(WebGLUniformLocation? location, GLfloat x);
1725     void uniform1fv(WebGLUniformLocation? location, Float32Array v);
1726     void uniform1fv(WebGLUniformLocation? location, sequence&lt;GLfloat&gt; v);
1727     void uniform1i(WebGLUniformLocation? location, GLint x);
1728     void uniform1iv(WebGLUniformLocation? location, Int32Array v);
1729     void uniform1iv(WebGLUniformLocation? location, sequence&lt;long&gt; v);
1730     void uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
1731     void uniform2fv(WebGLUniformLocation? location, Float32Array v);
1732     void uniform2fv(WebGLUniformLocation? location, sequence&lt;GLfloat&gt; v);
1733     void uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
1734     void uniform2iv(WebGLUniformLocation? location, Int32Array v);
1735     void uniform2iv(WebGLUniformLocation? location, sequence&lt;long&gt; v);
1736     void uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
1737     void uniform3fv(WebGLUniformLocation? location, Float32Array v);
1738     void uniform3fv(WebGLUniformLocation? location, sequence&lt;GLfloat&gt; v);
1739     void uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
1740     void uniform3iv(WebGLUniformLocation? location, Int32Array v);
1741     void uniform3iv(WebGLUniformLocation? location, sequence&lt;long&gt; v);
1742     void uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1743     void uniform4fv(WebGLUniformLocation? location, Float32Array v);
1744     void uniform4fv(WebGLUniformLocation? location, sequence&lt;GLfloat&gt; v);
1745     void uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
1746     void uniform4iv(WebGLUniformLocation? location, Int32Array v);
1747     void uniform4iv(WebGLUniformLocation? location, sequence&lt;long&gt; v);
1748
1749     void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, 
1750                           Float32Array value);
1751     void uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, 
1752                           sequence&lt;GLfloat&gt; value);
1753     void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, 
1754                           Float32Array value);
1755     void uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, 
1756                           sequence&lt;GLfloat&gt; value);
1757     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, 
1758                           Float32Array value);
1759     void uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, 
1760                           sequence&lt;GLfloat&gt; value);
1761
1762     void useProgram(WebGLProgram? program);
1763     void validateProgram(WebGLProgram? program);
1764
1765     void vertexAttrib1f(GLuint indx, GLfloat x);
1766     void vertexAttrib1fv(GLuint indx, Float32Array values);
1767     void vertexAttrib1fv(GLuint indx, sequence&lt;GLfloat&gt; values);
1768     void vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
1769     void vertexAttrib2fv(GLuint indx, Float32Array values);
1770     void vertexAttrib2fv(GLuint indx, sequence&lt;GLfloat&gt; values);
1771     void vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
1772     void vertexAttrib3fv(GLuint indx, Float32Array values);
1773     void vertexAttrib3fv(GLuint indx, sequence&lt;GLfloat&gt; values);
1774     void vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1775     void vertexAttrib4fv(GLuint indx, Float32Array values);
1776     void vertexAttrib4fv(GLuint indx, sequence&lt;GLfloat&gt; values);
1777     void vertexAttribPointer(GLuint indx, GLint size, GLenum type, 
1778                              GLboolean normalized, GLsizei stride, GLintptr offset);
1779
1780     void viewport(GLint x, GLint y, GLsizei width, GLsizei height);
1781 };
1782
1783 interface <dfn id="WebGLRenderingContext">WebGLRenderingContext</dfn>
1784 {
1785 };
1786 WebGLRenderingContext implements WebGLRenderingContextBase;
1787 </pre>
1788
1789 <!-- ======================================================================================================= -->
1790
1791     <h4>Attributes</h4>
1792
1793     <p>
1794         The following attributes are available:
1795     </p>
1796
1797     <dl class="methods">
1798         <dt>
1799             <code class=attribute-name>
1800                 <a id="DOM-WebGLRenderingContext-canvas">
1801                     canvas
1802                 </a>
1803             </code> 
1804             of type <code>HTMLCanvasElement</code>
1805         <dd>
1806             A reference to the canvas element which created this context.
1807
1808         <dt>
1809             <code class=attribute-name>
1810                 <a id="DOM-WebGLRenderingContext-drawingBufferWidth">
1811                     drawingBufferWidth
1812                 </a>
1813             </code> 
1814             of type <code>GLsizei</code>
1815         <dd>
1816             The actual width of the drawing buffer. May be different from the 
1817             <code>width</code> attribute of the <code>HTMLCanvasElement</code> if 
1818             the implementation is unable to satisfy the requested widthor height.
1819             
1820         <dt>
1821             <code class=attribute-name>
1822                 <a id="DOM-WebGLRenderingContext-drawingBufferHeight">
1823                     drawingBufferHeight
1824                 </a>
1825             </code> 
1826             of type <code>GLsizei</code>
1827         <dd>
1828             The actual height of the drawing buffer. May be different from the 
1829             <code>height</code> attribute of the <code>HTMLCanvasElement</code> if 
1830             the implementation is unable to satisfy the requested width or height.
1831     </dl>
1832
1833 <!-- ======================================================================================================= -->
1834
1835     <h4>Getting information about the context</h4>
1836
1837     <dl class="methods">
1838         <dt class="idl-code">[WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes()
1839         <dd>
1840             If the <a href="#webgl-context-lost-flag">webgl context lost flag</a> is set, returns
1841             null. Otherwise, returns a copy of the <a href="#actual-context-parameters">actual
1842             context parameters</a>.
1843     </dl>
1844      
1845 <!-- ======================================================================================================= -->
1846
1847     <h4>Setting and getting state</h4>
1848
1849     <p>
1850         OpenGL ES 2.0 maintains state values for use in rendering. All the calls in this
1851         group behave identically to their OpenGL counterparts unless otherwise noted.
1852     </p>
1853     
1854     <dl class="methods">
1855         <dt class="idl-code">void activeTexture(GLenum texture)
1856             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7">OpenGL ES 2.0 &sect;3.7</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glActiveTexture.xml">man page</a>)</span>
1857         <dt class="idl-code">void blendColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1858             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.6">OpenGL ES 2.0 &sect;4.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBlendColor.xml">man page</a>)</span>
1859         <dt class="idl-code">void blendEquation(GLenum mode)
1860             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.6">OpenGL ES 2.0 &sect;4.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBlendEquation.xml">man page</a>)</span>
1861         <dt class="idl-code">void blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha)
1862             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.6">OpenGL ES 2.0 &sect;4.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBlendEquationSeparate.xml">man page</a>)</span>
1863         <dt class="idl-code">void blendFunc(GLenum sfactor, GLenum dfactor)
1864             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.6">OpenGL ES 2.0 &sect;4.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBlendFunc.xml">man page</a>)</span>
1865             <dd>
1866                 See <a href="#CONSTANT_COLOR_BLEND">Blending With Constant Color</a> for limitations imposed
1867                 by WebGL.
1868         <dt class="idl-code">void blendFuncSeparate(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
1869             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.6">OpenGL ES 2.0 &sect;4.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBlendFuncSeparate.xml">man page</a>)</span>
1870             <dd>
1871                 See <a href="#CONSTANT_COLOR_BLEND">Blending With Constant Color</a> for limitations imposed
1872                 by WebGL.
1873         <dt class="idl-code">void clearColor(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
1874             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.3">OpenGL ES 2.0 &sect;4.2.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glClearColor.xml">man page</a>)</span>
1875         <dt class="idl-code">void clearDepth(GLclampf depth)
1876             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.3">OpenGL ES 2.0 &sect;4.2.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glClearDepthf.xml">man page</a>)</span>
1877             <dd>
1878                 <code>depth</code> value is clamped to the range 0 to 1.
1879         <dt class="idl-code">void clearStencil(GLint s)
1880             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.3">OpenGL ES 2.0 &sect;4.2.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glClearStencil.xml">man page</a>)</span>
1881         <dt class="idl-code">void colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
1882             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.2">OpenGL ES 2.0 &sect;4.2.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glColorMask.xml">man page</a>)</span>
1883         <dt class="idl-code">void cullFace(GLenum mode)
1884             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.5.1">OpenGL ES 2.0 &sect;3.5.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCullFace.xml">man page</a>)</span>
1885         <dt class="idl-code">void depthFunc(GLenum func)
1886             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.5">OpenGL ES 2.0 &sect;4.1.5</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDepthFunc.xml">man page</a>)</span>
1887         <dt class="idl-code">void depthMask(GLboolean flag)
1888             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.2">OpenGL ES 2.0 &sect;4.2.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDepthMask.xml">man page</a>)</span>
1889         <dt class="idl-code">void depthRange(GLclampf zNear, GLclampf zFar)
1890             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.12.1">OpenGL ES 2.0 &sect;2.12.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDepthRangef.xml">man page</a>)</span>
1891             <dd>
1892                 <code>zNear</code> and <code>zFar</code> values are clamped to the range 0 to 1 and
1893                 <code>zNear</code> must be less than or equal to <code>zFar</code>; see
1894                 <a href="#VIEWPORT_DEPTH_RANGE">Viewport Depth Range</a>.
1895         <dt class="idl-code">void disable(GLenum cap)
1896             <span class="gl-spec">(<a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDisable.xml">man page</a>)</span>
1897         <dt class="idl-code">void enable(GLenum cap)
1898             <span class="gl-spec">(<a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glEnable.xml">man page</a>)</span>
1899         <dt class="idl-code">void frontFace(GLenum mode)
1900             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.5.1">OpenGL ES 2.0 &sect;3.5.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glFrontFace.xml">man page</a>)</span>
1901         <dt class="idl-code"><a name="GETPARAMETER">any getParameter</a>(GLenum pname)
1902             <a class="gl-spec" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGet.xml">
1903                 (glGet OpenGL ES 2.0 man page)
1904             </a>
1905             <a class="gl-spec" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetString.xml">
1906                 (glGetString OpenGL ES 2.0 man page)
1907             </a>
1908         <dd>
1909             Return the value for the passed pname. The type returned is the natural type for the
1910             requested pname, as given in the following table:
1911             <table class="foo">
1912                 <tr><th>pname</th><th>returned type</th></tr>
1913                 <tr><td>ACTIVE_TEXTURE</td><td>GLenum</td></tr>
1914                 <tr><td>ALIASED_LINE_WIDTH_RANGE</td><td>Float32Array (with 2 elements)</td></tr>
1915                 <tr><td>ALIASED_POINT_SIZE_RANGE</td><td>Float32Array (with 2 elements)</td></tr>
1916                 <tr><td>ALPHA_BITS</td><td>GLint</td></tr>
1917                 <tr><td>ARRAY_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
1918                 <tr><td>BLEND</td><td>GLboolean</td></tr>
1919                 <tr><td>BLEND_COLOR</td><td>Float32Array (with 4 values)</td></tr>
1920                 <tr><td>BLEND_DST_ALPHA</td><td>GLenum</td></tr>
1921                 <tr><td>BLEND_DST_RGB</td><td>GLenum</td></tr>
1922                 <tr><td>BLEND_EQUATION_ALPHA</td><td>GLenum</td></tr>
1923                 <tr><td>BLEND_EQUATION_RGB</td><td>GLenum</td></tr>
1924                 <tr><td>BLEND_SRC_ALPHA</td><td>GLenum</td></tr>
1925                 <tr><td>BLEND_SRC_RGB</td><td>GLenum</td></tr>
1926                 <tr><td>BLUE_BITS</td><td>GLint</td></tr>
1927                 <tr><td>COLOR_CLEAR_VALUE</td><td>Float32Array (with 4 values)</td></tr>
1928                 <tr><td>COLOR_WRITEMASK</td><td>sequence&lt;GLboolean&gt; (with 4 values)</td></tr>
1929                 <tr><td>COMPRESSED_TEXTURE_FORMATS</td><td>Uint32Array</td></tr>
1930                 <tr><td>CULL_FACE</td><td>GLboolean</td></tr>
1931                 <tr><td>CULL_FACE_MODE</td><td>GLenum</td></tr>
1932                 <tr><td>CURRENT_PROGRAM</td><td>WebGLProgram</td></tr>
1933                 <tr><td>DEPTH_BITS</td><td>GLint</td></tr>
1934                 <tr><td>DEPTH_CLEAR_VALUE</td><td>GLfloat</td></tr>
1935                 <tr><td>DEPTH_FUNC</td><td>GLenum</td></tr>
1936                 <tr><td>DEPTH_RANGE</td><td>Float32Array (with 2 elements)</td></tr>
1937                 <tr><td>DEPTH_TEST</td><td>GLboolean</td></tr>
1938                 <tr><td>DEPTH_WRITEMASK</td><td>GLboolean</td></tr>
1939                 <tr><td>DITHER</td><td>GLboolean</td></tr>
1940                 <tr><td>ELEMENT_ARRAY_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
1941                 <tr><td>FRAMEBUFFER_BINDING</td><td>WebGLFramebuffer</td></tr>
1942                 <tr><td>FRONT_FACE</td><td>GLenum</td></tr>
1943                 <tr><td>GENERATE_MIPMAP_HINT</td><td>GLenum</td></tr>
1944                 <tr><td>GREEN_BITS</td><td>GLint</td></tr>
1945                 <tr><td>IMPLEMENTATION_COLOR_READ_FORMAT</td><td>GLenum</td></tr>
1946                 <tr><td>IMPLEMENTATION_COLOR_READ_TYPE</td><td>GLenum</td></tr>
1947                 <tr><td>LINE_WIDTH</td><td>GLfloat</td></tr>
1948                 <tr><td>MAX_COMBINED_TEXTURE_IMAGE_UNITS</td><td>GLint</td></tr>
1949                 <tr><td>MAX_CUBE_MAP_TEXTURE_SIZE</td><td>GLint</td></tr>
1950                 <tr><td>MAX_FRAGMENT_UNIFORM_VECTORS</td><td>GLint</td></tr>
1951                 <tr><td>MAX_RENDERBUFFER_SIZE</td><td>GLint</td></tr>
1952                 <tr><td>MAX_TEXTURE_IMAGE_UNITS</td><td>GLint</td></tr>
1953                 <tr><td>MAX_TEXTURE_SIZE</td><td>GLint</td></tr>
1954                 <tr><td>MAX_VARYING_VECTORS</td><td>GLint</td></tr>
1955                 <tr><td>MAX_VERTEX_ATTRIBS</td><td>GLint</td></tr>
1956                 <tr><td>MAX_VERTEX_TEXTURE_IMAGE_UNITS</td><td>GLint</td></tr>
1957                 <tr><td>MAX_VERTEX_UNIFORM_VECTORS</td><td>GLint</td></tr>
1958                 <tr><td>MAX_VIEWPORT_DIMS</td><td>Int32Array (with 2 elements)</td></tr>
1959                 <tr><td>PACK_ALIGNMENT</td><td>GLint</td></tr>
1960                 <tr><td>POLYGON_OFFSET_FACTOR</td><td>GLfloat</td></tr>
1961                 <tr><td>POLYGON_OFFSET_FILL</td><td>GLboolean</td></tr>
1962                 <tr><td>POLYGON_OFFSET_UNITS</td><td>GLfloat</td></tr>
1963                 <tr><td>RED_BITS</td><td>GLint</td></tr>
1964                 <tr><td>RENDERBUFFER_BINDING</td><td>WebGLRenderbuffer</td></tr>
1965                 <tr><td>RENDERER</td><td>DOMString</td></tr>
1966                 <tr><td>SAMPLE_BUFFERS</td><td>GLint</td></tr>
1967                 <tr><td>SAMPLE_COVERAGE_INVERT</td><td>GLboolean</td></tr>
1968                 <tr><td>SAMPLE_COVERAGE_VALUE</td><td>GLfloat</td></tr>
1969                 <tr><td>SAMPLES</td><td>GLint</td></tr>
1970                 <tr><td>SCISSOR_BOX</td><td>Int32Array (with 4 elements)</td></tr>
1971                 <tr><td>SCISSOR_TEST</td><td>GLboolean</td></tr>
1972                 <tr><td>SHADING_LANGUAGE_VERSION</td><td>DOMString</td></tr>
1973                 <tr><td>STENCIL_BACK_FAIL</td><td>GLenum</td></tr>
1974                 <tr><td>STENCIL_BACK_FUNC</td><td>GLenum</td></tr>
1975                 <tr><td>STENCIL_BACK_PASS_DEPTH_FAIL</td><td>GLenum</td></tr>
1976                 <tr><td>STENCIL_BACK_PASS_DEPTH_PASS</td><td>GLenum</td></tr>
1977                 <tr><td>STENCIL_BACK_REF</td><td>GLint</td></tr>
1978                 <tr><td>STENCIL_BACK_VALUE_MASK</td><td>GLuint</td></tr>
1979                 <tr><td>STENCIL_BACK_WRITEMASK</td><td>GLuint</td></tr>
1980                 <tr><td>STENCIL_BITS</td><td>GLint</td></tr>
1981                 <tr><td>STENCIL_CLEAR_VALUE</td><td>GLint</td></tr>
1982                 <tr><td>STENCIL_FAIL</td><td>GLenum</td></tr>
1983                 <tr><td>STENCIL_FUNC</td><td>GLenum</td></tr>
1984                 <tr><td>STENCIL_PASS_DEPTH_FAIL</td><td>GLenum</td></tr>
1985                 <tr><td>STENCIL_PASS_DEPTH_PASS</td><td>GLenum</td></tr>
1986                 <tr><td>STENCIL_REF</td><td>GLint</td></tr>
1987                 <tr><td>STENCIL_TEST</td><td>GLboolean</td></tr>
1988                 <tr><td>STENCIL_VALUE_MASK</td><td>GLuint</td></tr>
1989                 <tr><td>STENCIL_WRITEMASK</td><td>GLuint</td></tr>
1990                 <tr><td>SUBPIXEL_BITS</td><td>GLint</td></tr>
1991                 <tr><td>TEXTURE_BINDING_2D</td><td>WebGLTexture</td></tr>
1992                 <tr><td>TEXTURE_BINDING_CUBE_MAP</td><td>WebGLTexture</td></tr>
1993                 <tr><td>UNPACK_ALIGNMENT</td><td>GLint</td></tr>
1994                 <tr><td>UNPACK_COLORSPACE_CONVERSION_WEBGL</td><td>GLenum</td></tr>
1995                 <tr><td>UNPACK_FLIP_Y_WEBGL</td><td>GLboolean</td></tr>
1996                 <tr><td>UNPACK_PREMULTIPLY_ALPHA_WEBGL</td><td>GLboolean</td></tr>
1997                 <tr><td>VENDOR</td><td>DOMString</td></tr>
1998                 <tr><td>VERSION</td><td>DOMString</td></tr>
1999                 <tr><td>VIEWPORT</td><td>Int32Array (with 4 elements)</td></tr>
2000             </table><br>
2001             <p>All queries returning sequences or typed arrays return a new object each time.</p>
2002             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
2003             <p>The following <em>pname</em> arguments return a string describing some aspect of the current WebGL implementation:</p>
2004             <table>
2005               <tr><td>VERSION</td>
2006                   <td>Returns a version or release number of the form <code>WebGL&lt;space&gt;1.0&lt;space&gt;&lt;vendor-specific information&gt;</code>.</td></tr>
2007               <tr><td>SHADING_LANGUAGE_VERSION</td>
2008                   <td>Returns a version or release number of the form <code>WebGL&lt;space&gt;GLSL&lt;space&gt;ES&lt;space&gt;1.0&lt;space&gt;&lt;vendor-specific information&gt;</code>.</td></tr>
2009               <tr><td>VENDOR</td>
2010                   <td>Returns the company responsible for this WebGL implementation. This name does not change from release to release.</td></tr>
2011               <tr><td>RENDERER</td>
2012                   <td>Returns the name of the renderer. This name is typically specific to a particular configuration of a hardware platform. It does not change from release to release.</td></tr>
2013             </table><br>
2014             <p>See <a href="#EXTENSION_QUERIES">Extension Queries</a> for information on querying the
2015             available extensions in the current WebGL implementation.</p>
2016         <dt class="idl-code">[WebGLHandlesContextLoss] GLenum getError()
2017             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.5">OpenGL ES 2.0 &sect;2.5</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetError.xml">man page</a>)</span>
2018             <dd>
2019                 If the context's <a href="#webgl-context-lost-flag">webgl context lost flag</a> is set,
2020                 returns <code class="enum">CONTEXT_LOST_WEBGL</code> the first time this method is
2021                 called. Afterward, returns <code class="enum">NO_ERROR</code> until the context has
2022                 been restored.
2023         <dt class="idl-code">void hint(GLenum target, GLenum mode)
2024             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-5.2">OpenGL ES 2.0 &sect;5.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glHint.xml">man page</a>)</span>
2025         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap)
2026             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.1">OpenGL ES 2.0 &sect;6.1.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsEnabled.xml">man page</a>)</span>
2027         <dd>
2028             Returns false if the context's <a href="#webgl-context-lost-flag">webgl context lost
2029             flag</a> is set.
2030         <dt class="idl-code">void lineWidth(GLfloat width)
2031             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.4">OpenGL ES 2.0 &sect;3.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glLineWidth.xml">man page</a>)</span>
2032         <dd>
2033             See <a href="#NAN_LINE_WIDTH">NaN Line Width</a> for restrictions specified for WebGL.
2034         </dd>
2035         <dt class="idl-code">void pixelStorei(GLenum pname, GLint param)
2036             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.6.1">OpenGL ES 2.0 &sect;3.6.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glPixelStorei.xml">man page</a>)</span>
2037             <dd>
2038                 In addition to the parameters in the OpenGL ES 2.0 specification, the WebGL
2039                 specification accepts the parameters <code>UNPACK_FLIP_Y_WEBGL</code>,
2040                 <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code>
2041                 and <code>UNPACK_COLORSPACE_CONVERSION_WEBGL</code>. See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel
2042                 Storage Parameters</a> for documentation of these parameters.
2043         <dt class="idl-code">void polygonOffset(GLfloat factor, GLfloat units)
2044             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.5.2">OpenGL ES 2.0 &sect;3.5.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glPolygonOffset.xml">man page</a>)</span>
2045         <dt class="idl-code">void sampleCoverage(GLclampf value, GLboolean invert)
2046             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.3">OpenGL ES 2.0 &sect;4.1.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glSampleCoverage.xml">man page</a>)</span>
2047         <dt class="idl-code">void stencilFunc(GLenum func, GLint ref, GLuint mask)
2048             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.4">OpenGL ES 2.0 &sect;4.1.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilFunc.xml">man page</a>)</span>
2049         <dt class="idl-code">void stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask)
2050             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.4">OpenGL ES 2.0 &sect;4.1.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilFuncSeparate.xml">man page</a>)</span>
2051             <dd>
2052                 See <a href="#STENCIL_SEPARATE_LIMIT">Stencil Separate Mask and Reference Value</a> for information
2053                 on WebGL specific limitations to the allowable argument values.
2054         <dt class="idl-code">void stencilMask(GLuint mask)
2055             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.2">OpenGL ES 2.0 &sect;4.2.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilMask.xml">man page</a>)</span>
2056             <dd>
2057                 See <a href="#STENCIL_SEPARATE_LIMIT">Stencil Separate Mask and Reference Value</a> for information
2058                 on WebGL specific limitations to the allowable mask values.
2059         <dt class="idl-code">void stencilMaskSeparate(GLenum face, GLuint mask)
2060             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.2">OpenGL ES 2.0 &sect;4.2.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilMaskSeparate.xml">man page</a>)</span>
2061         <dt class="idl-code">void stencilOp(GLenum fail, GLenum zfail, GLenum zpass)
2062             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.4">OpenGL ES 2.0 &sect;4.1.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilOp.xml">man page</a>)</span>
2063         <dt class="idl-code">void stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
2064             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.4">OpenGL ES 2.0 &sect;4.1.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glStencilOpSeparate.xml">man page</a>)</span>
2065     </dl>
2066      
2067 <!-- ======================================================================================================= -->
2068
2069     <h4>Viewing and clipping</h4>
2070
2071     <p>
2072         Drawing commands can only modify pixels inside the currently bound framebuffer. In
2073         addition, the viewport and the scissor box affect drawing.
2074     </p>
2075
2076     <p>
2077         The viewport specifies the affine transformation of x and y from normalized device
2078         coordinates to window coordinates. The size of the viewport is initially determined
2079         as specified in section <a href="#WEBGL_VIEWPORT">The WebGL Viewport</a>.
2080         The scissor box defines a rectangle which constrains drawing. When the scissor test is
2081         enabled only pixels that lie within the scissor box can be modified by drawing commands
2082         including <code>clear</code>, and primitives can only be drawn inside the intersection
2083         of the viewport, the currently bound framebuffer, and the scissor box. When the scissor
2084         test is not enabled primitives can only be drawn inside the intersection of the viewport
2085         and the currently bound framebuffer.
2086     </p>
2087
2088     <dl class="methods">
2089         <dt class="idl-code">void scissor(GLint x, GLint y, GLsizei width, GLsizei height)
2090             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.1.2">OpenGL ES 2.0 &sect;4.1.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glScissor.xml">man page</a>)</span>
2091             
2092         <dt class="idl-code">void viewport(GLint x, GLint y, GLsizei width, GLsizei height)
2093             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.12.1">OpenGL ES 2.0 &sect;2.12.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glViewport.xml">man page</a>)</span>
2094     </dl>
2095      
2096 <!-- ======================================================================================================= -->
2097
2098     <h4>Buffer objects</h4>
2099
2100     <p>
2101         Buffer objects (sometimes referred to as VBOs) hold vertex attribute data for the GLSL
2102         shaders.
2103     </p>
2104      
2105     <dl class="methods">
2106         <dt class="idl-code">void bindBuffer(GLenum target, WebGLBuffer? buffer)
2107             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindBuffer.xml">man page</a>)</span>
2108         <dd>
2109             Binds the given WebGLBuffer object to the given binding point (target), either
2110             ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER. If the buffer is null then any buffer currently
2111             bound to this target is unbound. A given WebGLBuffer object may only be bound to one of
2112             the ARRAY_BUFFER or ELEMENT_ARRAY_BUFFER target in its lifetime. An attempt to bind a
2113             buffer object to the other target will generate an <code>INVALID_OPERATION</code> error, and the
2114             current binding will remain untouched.
2115         
2116         <dt class="idl-code">void bufferData(GLenum target, GLsizeiptr size, GLenum usage)
2117             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBufferData.xml">man page</a>)</span>
2118         <dd>
2119             Set the size of the currently bound WebGLBuffer object for the passed target. The
2120             buffer is initialized to 0.
2121             
2122         <dt><p class="idl-code">void bufferData(GLenum target, BufferDataSource? data, GLenum usage)
2123             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBufferData.xml">man page</a>)</span></p>
2124         <dd>
2125             Set the size of the currently bound WebGLBuffer object for the passed target to the 
2126             size of the passed data, then write the contents of data to the buffer object.
2127             <br><br>
2128             If the passed data is null then an <code>INVALID_VALUE</code> error is generated.
2129         <dt><p class="idl-code">void bufferSubData(GLenum target, GLintptr offset, BufferDataSource? data)
2130             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBufferSubData.xml">man page</a>)</span></p>
2131         <dd>
2132             For the WebGLBuffer object bound to the passed target write the passed data starting at
2133             the passed offset. If the data would be written past the end of the buffer object
2134             an <code>INVALID_VALUE</code> error is generated. If <code>data</code> is null then
2135             an <code>INVALID_VALUE</code> error is generated.
2136             
2137         <dt class="idl-code">WebGLBuffer? createBuffer()
2138             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenBuffers.xml">glGenBuffers</a>)</span>
2139         <dd>
2140             Create a WebGLBuffer object and initialize it with a buffer object name as if by
2141             calling glGenBuffers.
2142             
2143         <dt class="idl-code">void deleteBuffer(WebGLBuffer? buffer)
2144             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.9">OpenGL ES 2.0 &sect;2.9</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteBuffers.xml">glDeleteBuffers</a>)</span>
2145         <dd>
2146             Delete the buffer object contained in the passed WebGLBuffer as if by calling
2147             glDeleteBuffers. If the buffer has already been deleted the call has no effect.
2148             Note that the buffer object will be deleted when the WebGLBuffer object is destroyed.
2149             This method merely gives the author greater control over when the buffer object is
2150             destroyed.
2151
2152         <dt class="idl-code">any getBufferParameter(GLenum target, GLenum pname)
2153             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.3">OpenGL ES 2.0 &sect;6.1.3</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetBufferParameteriv.xml">glGetBufferParameteriv</a>)</span>
2154         <dd>
2155             Return the value for the passed pname. The type returned is the natural type for the
2156             requested pname, as given in the following table:
2157             <table class="foo">
2158                 <tr><th>pname</th><th>returned type</th></tr>
2159                 <tr><td>BUFFER_SIZE</td><td>GLint</td></tr>
2160                 <tr><td>BUFFER_USAGE</td><td>GLenum</td></tr>
2161             </table>
2162             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2163             <p>If an OpenGL error is generated, returns null.</p>
2164         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer)
2165             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.6">OpenGL ES 2.0 &sect;6.1.6</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsBuffer.xml">man page</a>)</span>
2166         <dd>
2167             Return true if the passed WebGLBuffer is valid and false otherwise. <br><br>
2168
2169             Returns false if the buffer's <a href="#webgl-object-invalidated-flag">invalidated
2170             flag</a> is set.
2171     </dl>
2172
2173 <!-- ======================================================================================================= -->
2174
2175     <h4>Framebuffer objects</h4>
2176
2177     <p>
2178         Framebuffer objects provide an alternative rendering target to the drawing buffer. They
2179         are a collection of color, alpha, depth and stencil buffers and are often used to 
2180         render an image that will later be used as a texture.
2181     </p>
2182      
2183     <dl class="methods">
2184         <dt class="idl-code">void bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer)
2185             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindFramebuffer.xml">man page</a>)</span>
2186         <dd>
2187             Bind the given <code class="interface">WebGLFramebuffer</code> object to the given binding point
2188             (<code class="param">target</code>), which must be <code class="enum">FRAMEBUFFER</code>.
2189             If <code class="param">framebuffer</code> is null, the default framebuffer provided by the context
2190             is bound and attempts to modify or query state on <code class="param">target</code> <code class="enum">FRAMEBUFFER</code>
2191             will generate an <code class="error">INVALID_OPERATION</code> error.
2192
2193         <dt class="idl-code">[WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target)
2194             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.5">OpenGL ES 2.0 &sect;4.4.5</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCheckFramebufferStatus.xml">man page</a>)</span>
2195         <dd>
2196             Returns <code class="enum">FRAMEBUFFER_UNSUPPORTED</code> if the
2197             context's <a href="#webgl-context-lost-flag">webgl context lost flag</a> is set.
2198
2199         <dt class="idl-code">WebGLFramebuffer? createFramebuffer()
2200             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenFramebuffers.xml">glGenFramebuffers</a>)</span>
2201         <dd>
2202             Create a WebGLFramebuffer object and initialize it with a framebuffer object name as if by
2203             calling glGenFramebuffers.
2204             
2205         <dt class="idl-code">void deleteFramebuffer(WebGLFramebuffer? buffer)
2206             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.1">OpenGL ES 2.0 &sect;4.4.1</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteFramebuffers.xml">glDeleteFramebuffers</a>)</span>
2207         <dd>
2208             Delete the framebuffer object contained in the passed WebGLFramebuffer as if by calling
2209             glDeleteFramebuffers. If the framebuffer has already been deleted the call has no effect.
2210             Note that the framebuffer object will be deleted when the WebGLFramebuffer object is destroyed.
2211             This method merely gives the author greater control over when the framebuffer object is
2212             destroyed.
2213
2214         <dt class="idl-code">void framebufferRenderbuffer(GLenum target, GLenum attachment, 
2215                                  GLenum renderbuffertarget, 
2216                                  WebGLRenderbuffer? renderbuffer)
2217             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glFramebufferRenderbuffer.xml">man page</a>)</span></dt>
2218         <dt class="idl-code">void framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, 
2219                               WebGLTexture? texture, GLint level)
2220             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glFramebufferTexture2D.xml">man page</a>)</span>
2221         <dt class="idl-code">any getFramebufferAttachmentParameter(GLenum target, GLenum attachment, 
2222                                           GLenum pname)
2223             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.3">OpenGL ES 2.0 &sect;6.1.3</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetFramebufferAttachmentParameteriv.xml">glGetFramebufferAttachmentParameteriv</a>)</span>
2224         <dd>
2225             Return the value for the passed pname given the passed target and attachment. The type 
2226             returned is the natural type for the requested pname, as given in the following table:
2227             <table class="foo">
2228                 <tr><th>pname</th><th>returned type</th></tr>
2229                 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE</td><td>GLenum</td></tr>
2230                 <tr><td>FRAMEBUFFER_ATTACHMENT_OBJECT_NAME</td><td>WebGLRenderbuffer or WebGLTexture</td></tr>
2231                 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL</td><td>GLint</td></tr>
2232                 <tr><td>FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE</td><td>GLint</td></tr>
2233             </table>
2234             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2235             <p>If an OpenGL error is generated, returns null.</p>
2236         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer)
2237             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.7">OpenGL ES 2.0 &sect;6.1.7</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsFramebuffer.xml">man page</a>)</span>
2238         <dd>
2239             Return true if the passed WebGLFramebuffer is valid and false otherwise. <br><br>
2240
2241             Returns false if the framebuffer's <a href="#webgl-object-invalidated-flag">invalidated
2242             flag</a> is set.
2243     </dl>
2244      
2245 <!-- ======================================================================================================= -->
2246
2247     <h4>Renderbuffer objects</h4>
2248
2249     <p>
2250         Renderbuffer objects are used to provide storage for the individual buffers used in a
2251         framebuffer object.
2252     </p>
2253      
2254     <dl class="methods">
2255         <dt class="idl-code">void bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer)
2256             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindRenderbuffer.xml">man page</a>)</span>
2257         <dd>
2258             Bind the given <code class="interface">WebGLRenderbuffer</code> object to the given binding point
2259             (<code class="param">target</code>), which must be <code class="enum">RENDERBUFFER</code>.
2260             If <code class="param">renderbuffer</code> is null the renderbuffer object currently bound to
2261             this <code class="param">target</code> is unbound.
2262
2263         <dt class="idl-code">WebGLRenderbuffer? createRenderbuffer()
2264             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenRenderbuffers.xml">glGenRenderbuffers</a>)</span>
2265         <dd>
2266             Create a WebGLRenderbuffer object and initialize it with a renderbuffer object name as if by
2267             calling glGenRenderbuffers.
2268             
2269         <dt class="idl-code">void deleteRenderbuffer(WebGLRenderbuffer? renderbuffer)
2270             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteRenderbuffers.xml">glDeleteRenderbuffers</a>)</span>
2271         <dd>
2272             Delete the renderbuffer object contained in the passed WebGLRenderbuffer as if by calling
2273             glDeleteRenderbuffers. If the renderbuffer has already been deleted the call has no effect.
2274             Note that the renderbuffer object will be deleted when the WebGLRenderbuffer object is destroyed.
2275             This method merely gives the author greater control over when the renderbuffer object is
2276             destroyed.
2277         <dt class="idl-code">any getRenderbufferParameter(GLenum target, GLenum pname)
2278             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.3">OpenGL ES 2.0 &sect;6.1.3</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetRenderbufferParameteriv.xml">glGetRenderbufferParameteriv</a>)</span>
2279         <dd>
2280             Return the value for the passed pname given the passed target. The type returned is the natural 
2281             type for the requested pname, as given in the following table:
2282             <table class="foo">
2283                 <tr><th>pname</th><th>returned type</th></tr>
2284                 <tr><td>RENDERBUFFER_WIDTH</td><td>GLint</td></tr>
2285                 <tr><td>RENDERBUFFER_HEIGHT</td><td>GLint</td></tr>
2286                 <tr><td>RENDERBUFFER_INTERNAL_FORMAT</td><td>GLenum</td></tr>
2287                 <tr><td>RENDERBUFFER_RED_SIZE</td><td>GLint</td></tr>
2288                 <tr><td>RENDERBUFFER_GREEN_SIZE</td><td>GLint</td></tr>
2289                 <tr><td>RENDERBUFFER_BLUE_SIZE</td><td>GLint</td></tr>
2290                 <tr><td>RENDERBUFFER_ALPHA_SIZE</td><td>GLint</td></tr>
2291                 <tr><td>RENDERBUFFER_DEPTH_SIZE</td><td>GLint</td></tr>
2292                 <tr><td>RENDERBUFFER_STENCIL_SIZE</td><td>GLint</td></tr>
2293             </table>
2294             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2295             <p>If an OpenGL error is generated, returns null.</p>
2296         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer)
2297             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.7">OpenGL ES 2.0 &sect;6.1.7</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsRenderbuffer.xml">man page</a>)</span>
2298         <dd>
2299             Return true if the passed WebGLRenderbuffer is valid and false otherwise. <br><br>
2300
2301             Returns false if the renderbuffer's <a href="#webgl-object-invalidated-flag">invalidated
2302             flag</a> is set.
2303         <dt class="idl-code">void renderbufferStorage(GLenum target, GLenum internalformat, 
2304                              GLsizei width, GLsizei height)
2305             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.4.3">OpenGL ES 2.0 &sect;4.4.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glRenderbufferStorage.xml">man page</a>)</span>
2306     </dl>
2307
2308 <!-- ======================================================================================================= -->
2309
2310     <h4>Texture objects</h4>
2311
2312     <p>
2313         Texture objects provide storage and state for texturing operations. If no WebGLTexture is bound
2314         (e.g., passing null or 0 to bindTexture) then attempts to modify or query the texture object shall
2315         generate an <code>INVALID_OPERATION</code> error. This is indicated in the functions below.
2316     </p>
2317      
2318     <dl class="methods">
2319         <dt class="idl-code">void bindTexture(GLenum target, WebGLTexture? texture)
2320             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindTexture.xml">man page</a>)</span>
2321
2322         <dt><p class="idl-code"><a name="COMPRESSEDTEXIMAGE2D">void compressedTexImage2D</a>(GLenum target, GLint level, GLenum internalformat, 
2323                     GLsizei width, GLsizei height, GLint border, ArrayBufferView pixels)
2324                 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.3">OpenGL ES 2.0 &sect;3.7.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCompressedTexImage2D.xml">man page</a>)</span></p>
2325             <p class="idl-code"><a name="COMPRESSEDTEXSUBIMAGE2D">void compressedTexSubImage2D</a>(GLenum target, GLint level,
2326                     GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, ArrayBufferView pixels)
2327                 <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.3">OpenGL ES 2.0 &sect;3.7.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCompressedTexSubImage2D.xml">man page</a>)</span></p>
2328         <dd>
2329             If an attempt is made to call these functions with no WebGLTexture bound (see above), an
2330             <code>INVALID_OPERATION</code> error is generated. <br><br>
2331
2332             The core WebGL specification does not define any supported compressed texture formats.
2333             By default, these methods generate an <code>INVALID_ENUM</code> error and return
2334             immediately. See <a href="#COMPRESSED_TEXTURE_SUPPORT">Compressed Texture Support</a>.
2335
2336         <dt class="idl-code">void copyTexImage2D(GLenum target, GLint level, GLenum internalformat, 
2337                         GLint x, GLint y, GLsizei width, GLsizei height, 
2338                         GLint border)
2339             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.2">OpenGL ES 2.0 &sect;3.7.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCopyTexImage2D.xml">man page</a>)</span>
2340         <dd>
2341             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2342             <code>INVALID_OPERATION</code> error is generated. <br><br>
2343
2344             For any pixel lying outside the frame buffer, all channels of the associated texel are
2345             initialized to 0; see <a href="#READS_OUTSIDE_FRAMEBUFFER">Reading Pixels Outside the
2346             Framebuffer</a>. <br><br>
2347
2348             If this function attempts to read from a complete framebuffer with a missing attachment,
2349             an <code>INVALID_OPERATION</code> error is generated
2350             per <a href="#READING_FROM_MISSING_ATTACHMENT">Reading from a Missing Attachment</a>.
2351         <dt class="idl-code">void copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
2352                            GLint x, GLint y, GLsizei width, GLsizei height)
2353             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.2">OpenGL ES 2.0 &sect;3.7.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCopyTexSubImage2D.xml">man page</a>)</span>
2354         <dd>
2355             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2356             <code>INVALID_OPERATION</code> error is generated. <br><br>
2357
2358             For any pixel lying outside the frame buffer, all channels of the associated texel are
2359             initialized to 0; see <a href="#READS_OUTSIDE_FRAMEBUFFER">Reading Pixels Outside the
2360             Framebuffer</a>. <br><br>
2361
2362             If this function attempts to read from a complete framebuffer with a missing attachment,
2363             an <code>INVALID_OPERATION</code> error is generated
2364             per <a href="#READING_FROM_MISSING_ATTACHMENT">Reading from a Missing Attachment</a>.
2365         <dt class="idl-code">WebGLTexture? createTexture()
2366             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenTextures.xml">man page</a>)</span>
2367         <dd>
2368             Create a WebGLTexture object and initialize it with a texture object name as if by
2369             calling glGenTextures.
2370             
2371         <dt class="idl-code">void deleteTexture(WebGLTexture? texture)
2372             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.13">OpenGL ES 2.0 &sect;3.7.13</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteTextures.xml">man page</a>)</span>
2373         <dd>
2374             Delete the texture object contained in the passed WebGLTexture as if by calling
2375             glDeleteTextures. If the texture has already been deleted the call has no effect.
2376             Note that the texture object will be deleted when the WebGLTexture object is destroyed.
2377             This method merely gives the author greater control over when the texture object is
2378             destroyed.
2379         <dt class="idl-code">void generateMipmap(GLenum target)
2380             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.11">OpenGL ES 2.0 &sect;3.7.11</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGenerateMipmap.xml">man page</a>)</span>
2381         <dd>
2382             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2383             <code>INVALID_OPERATION</code> error is generated.
2384         <dt class="idl-code">any getTexParameter(GLenum target, GLenum pname)
2385             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.3">OpenGL ES 2.0 &sect;6.1.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetTexParameter.xml">man page</a>)</span>
2386         <dd>
2387             Return the value for the passed pname given the passed target. The type returned is the natural type for the
2388             requested pname, as given in the following table:
2389             <table class="foo">
2390                 <tr><th>pname</th><th>returned type</th></tr>
2391                 <tr><td>TEXTURE_MAG_FILTER</td><td>GLenum</td></tr>
2392                 <tr><td>TEXTURE_MIN_FILTER</td><td>GLenum</td></tr>
2393                 <tr><td>TEXTURE_WRAP_S</td><td>GLenum</td></tr>
2394                 <tr><td>TEXTURE_WRAP_T</td><td>GLenum</td></tr>
2395             </table>
2396             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2397             <p>If an attempt is made to call this function with no WebGLTexture bound (see above), generates an
2398             <code>INVALID_OPERATION</code> error.</p>
2399             <p>If an OpenGL error is generated, returns null.</p>
2400         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture)
2401             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.4">OpenGL ES 2.0 &sect;6.1.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsTexture.xml">man page</a>)</span>
2402         <dd>
2403             Return true if the passed WebGLTexture is valid and false otherwise. <br><br>
2404
2405             Returns false if the texture's <a href="#webgl-object-invalidated-flag">invalidated
2406             flag</a> is set.
2407         <dt class="idl-code"><a name="TEXIMAGE2D">void texImage2D</a>(GLenum target, GLint level, GLenum internalformat, 
2408                     GLsizei width, GLsizei height, GLint border, GLenum format, 
2409                     GLenum type, ArrayBufferView? pixels)
2410             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.1">OpenGL ES 2.0 &sect;3.7.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexImage2D.xml">man page</a>)</span>
2411         <dd>
2412             If <code>pixels</code> is null, a buffer of sufficient size initialized to 0 is
2413             passed. <br><br>
2414
2415             If <code>pixels</code> is non-null, the type of <code>pixels</code> must match the type
2416             of the data to be read. If it is UNSIGNED_BYTE, a Uint8Array must be supplied; if it is
2417             UNSIGNED_SHORT_5_6_5, UNSIGNED_SHORT_4_4_4_4, or UNSIGNED_SHORT_5_5_5_1, a Uint16Array
2418             must be supplied. If the types do not match, an INVALID_OPERATION error is generated.
2419             <br><br>
2420
2421             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2422             <code>INVALID_OPERATION</code> error is generated. <br><br>
2423
2424             See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
2425             pixel storage parameters that affect the behavior of this function.
2426         <dt><p class="idl-code"><a name="TEXIMAGE2D_HTML">void texImage2D</a>(GLenum target, GLint level, GLenum internalformat,
2427                     GLenum format, GLenum type, TexImageSource? source) /* May throw DOMException */
2428             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.1">OpenGL ES 2.0 &sect;3.7.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexImage2D.xml">man page</a>)</span></p>
2429         <dd>
2430             Uploads the given element or image data to the currently bound WebGLTexture. <br><br>
2431
2432             The width and height of the texture are set as specified in section
2433             <a href="#TEXTURE_UPLOAD_SIZE">Texture Upload Width and Height</a>.<br><br>
2434
2435             The source image data is conceptually first converted to the data type and format
2436             specified by the <em>format</em> and <em>type</em> arguments, and then transferred to
2437             the WebGL implementation. If a packed pixel format is specified which would imply loss
2438             of bits of precision from the image data, this loss of precision must occur. <br><br>
2439
2440             The first pixel transferred from the source to the WebGL implementation corresponds to
2441             the upper left corner of the source. This behavior is modified by the
2442             the <code>UNPACK_FLIP_Y_WEBGL</code> <a href="#PIXEL_STORAGE_PARAMETERS">pixel storage
2443             parameter</a>. <br><br>
2444
2445             If the source image is an RGB or RGBA lossless image with 8 bits per channel, the
2446             browser guarantees that the full precision of all channels is preserved. <br><br>
2447
2448             If the original image contains an alpha channel and the
2449             <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel storage parameter is false, then the
2450             RGB values are guaranteed to never have been premultiplied by the alpha channel, whether
2451             those values are derived directly from the original file format or converted from some
2452             other color format. <br><br>
2453
2454             <div class="note">
2455
2456             Some implementations of HTMLCanvasElement's CanvasRenderingContext2D store color values
2457             internally in premultiplied form. If such a canvas is uploaded to a WebGL texture with
2458             the <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel storage parameter set to false,
2459             the color channels will have to be un-multiplied by the alpha channel, which is a lossy
2460             operation. The WebGL implementation therefore can not guarantee that colors with alpha <
2461             1.0 will be preserved losslessly when first drawn to a canvas via
2462             CanvasRenderingContext2D and then uploaded to a WebGL texture when
2463             the <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel storage parameter is set to false.
2464
2465             </div>
2466
2467             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2468             <code>INVALID_OPERATION</code> error is generated. <br><br>
2469
2470             If this function is called with an <code>HTMLImageElement</code>
2471             or <code>HTMLVideoElement</code> whose origin differs from the origin of the containing
2472             Document, or with an <code>HTMLCanvasElement</code> whose <i>origin-clean</i> flag is
2473             set to false, a <code>SECURITY_ERR</code> exception must be
2474             thrown. See <a href="#ORIGIN_RESTRICTIONS">Origin Restrictions</a>.<br><br>
2475
2476             If <code>source</code> is null then an <code>INVALID_VALUE</code> error is
2477             generated. <br><br>
2478
2479             See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
2480             pixel storage parameters that affect the behavior of this function.
2481         <dt class="idl-code">void texParameterf(GLenum target, GLenum pname, GLfloat param)
2482             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.4">OpenGL ES 2.0 &sect;3.7.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexParameter.xml">man page</a>)</span>
2483         <dd>
2484             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2485             <code>INVALID_OPERATION</code> error is generated.
2486         <dt class="idl-code">void texParameteri(GLenum target, GLenum pname, GLint param)
2487             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.4">OpenGL ES 2.0 &sect;3.7.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexParameter.xml">man page</a>)</span>
2488         <dd>
2489             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2490             <code>INVALID_OPERATION</code> error is generated.
2491         <dt class="idl-code"><a name="TEXSUBIMAGE2D">void texSubImage2D</a>(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
2492                        GLsizei width, GLsizei height, 
2493                        GLenum format, GLenum type, ArrayBufferView? pixels)
2494             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.2">OpenGL ES 2.0 &sect;3.7.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexSubImage2D.xml">man page</a>)</span>
2495         <dd>
2496             See <a href="#TEXIMAGE2D">texImage2D</a> for restrictions on the <em>format</em>
2497             and <em>pixels</em> arguments. <br><br>
2498
2499             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2500             <code>INVALID_OPERATION</code> error is generated. <br><br>
2501
2502             If <em>type</em> does not match the type originally used to define the texture, an
2503             <code>INVALID_OPERATION</code> error is generated. <br><br>
2504
2505             If <code>pixels</code> is null then an <code>INVALID_VALUE</code> error is
2506             generated. <br><br>
2507
2508             See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
2509             pixel storage parameters that affect the behavior of this function.
2510         <dt><p class="idl-code"><a name="TEXSUBIMAGE2D_HTML">void texSubImage2D</a>(GLenum target, GLint level, GLint xoffset, GLint yoffset, 
2511                        GLenum format, GLenum type, TexImageSource? source) /* May throw DOMException */
2512             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-3.7.2">OpenGL ES 2.0 &sect;3.7.2</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glTexSubImage2D.xml">man page</a>)</span></p>
2513         <dd>
2514             Updates a sub-rectangle of the currently bound WebGLTexture with the contents of the
2515             given element or image data. <br><br>
2516
2517             The width and height of the updated sub-rectangle are determined as specified in section
2518             <a href="#TEXTURE_UPLOAD_SIZE">Texture Upload Width and Height</a>.<br><br>
2519
2520             See <a href="#TEXIMAGE2D_HTML">texImage2D</a> for the interpretation of
2521             the <em>format</em> and <em>type</em> arguments, and notes on
2522             the <code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> pixel storage parameter. <br><br>
2523
2524             The first pixel transferred from the source to the WebGL implementation corresponds to
2525             the upper left corner of the source. This behavior is modified by the
2526             the <code>UNPACK_FLIP_Y_WEBGL</code> <a href="#PIXEL_STORAGE_PARAMETERS">pixel storage
2527             parameter</a>. <br><br>
2528
2529             If an attempt is made to call this function with no WebGLTexture bound (see above), an
2530             <code>INVALID_OPERATION</code> error is generated. <br><br>
2531
2532             If <em>type</em> does not match the type originally used to define the texture, an
2533             <code>INVALID_OPERATION</code> error is generated. <br><br>
2534
2535             If this function is called with an <code>HTMLImageElement</code>
2536             or <code>HTMLVideoElement</code> whose origin differs from the origin of the containing
2537             Document, or with an <code>HTMLCanvasElement</code> whose <i>origin-clean</i> flag is
2538             set to false, a <code>SECURITY_ERR</code> exception must be
2539             thrown. See <a href="#ORIGIN_RESTRICTIONS">Origin Restrictions</a>.<br><br>
2540
2541             If <code>source</code> is null then an <code>INVALID_VALUE</code> error is
2542             generated. <br><br>
2543
2544             See <a href="#PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a> for WebGL-specific
2545             pixel storage parameters that affect the behavior of this function.
2546     </dl>
2547
2548 <!-- ======================================================================================================= -->
2549
2550     <h4>Programs and Shaders</h4>
2551
2552     <p>
2553         Rendering with OpenGL ES 2.0 requires the use of <i>shaders</i>, written in OpenGL ES's shading language, GLSL ES.
2554         Shaders must be loaded with a source string (shaderSource), compiled
2555         (compileShader) and attached to a <i>program</i> (attachShader) which must be linked
2556         (linkProgram) and then used (useProgram).
2557     </p>
2558
2559     <dl class="methods">
2560         <dt class="idl-code">void attachShader(WebGLProgram? program, WebGLShader? shader)
2561             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glAttachShader.xml">man page</a>)</span>
2562         <dt class="idl-code">void bindAttribLocation(WebGLProgram? program, GLuint index, DOMString name)
2563             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glBindAttribLocation.xml">man page</a>)</span>
2564         <dd>
2565             If the passed name is longer than the restriction defined
2566             in <a href="#MAX_LOCATION_LENGTHS">Maximum Uniform and Attribute Location Lengths</a>,
2567             generates an <code>INVALID_VALUE</code> error. <br><br>
2568
2569             If <code>name</code> starts with one of the reserved WebGL prefixes
2570             per <a href="#GLSL_CONSTRUCTS">GLSL Constructs</a>, generates
2571             an <code>INVALID_OPERATION</code> error. <br><br>
2572
2573             See <a href="#CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source Character
2574             Set</a> for additional validation performed by WebGL implementations.
2575         <dt class="idl-code">void compileShader(WebGLShader? shader)
2576             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCompileShader.xml">man page</a>)</span>
2577         <dd>
2578             See <a href="#SUPPORTED_GLSL_CONSTRUCTS">Supported GLSL
2579             Constructs</a>, <a href="#MAX_GLSL_TOKEN_SIZE">Maximum GLSL Token
2580             Size</a>, <a href="#CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source
2581             Character Set</a>, <a href="#MAX_STRUCT_NESTING">Maximum Nesting of Structures in GLSL
2582             Shaders</a>, and <a href="#PACKING_RESTRICTIONS">Packing Restrictions for Uniforms and
2583             Varyings</a> for additional constraints enforced in, additional constructs supported by,
2584             and additional validation performed by WebGL implementations.
2585         <dt class="idl-code">WebGLProgram? createProgram()
2586             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCreateProgram.xml">man page</a>)</span>
2587         <dd>
2588             Create a WebGLProgram object and initialize it with a program object name as if by
2589             calling glCreateProgram.
2590             
2591         <dt class="idl-code">WebGLShader? createShader(GLenum type)
2592             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glCreateShader.xml">man page</a>)</span>
2593         <dd>
2594             Create a WebGLShader object and initialize it with a shader object name as if by
2595             calling glCreateShader.
2596             
2597         <dt class="idl-code">void deleteProgram(WebGLProgram? program)
2598             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteProgram.xml">man page</a>)</span>
2599         <dd>
2600             Delete the program object contained in the passed WebGLProgram as if by calling
2601             glDeleteProgram. If the program has already been deleted the call has no effect.
2602             Note that the program object will be deleted when the WebGLProgram object is destroyed.
2603             This method merely gives the author greater control over when the program object is
2604             destroyed.
2605         <dt class="idl-code">void deleteShader(WebGLShader? shader)
2606             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDeleteShader.xml">man page</a>)</span>
2607         <dd>
2608             Delete the shader object contained in the passed WebGLShader as if by calling
2609             glDeleteShader. If the shader has already been deleted the call has no effect.
2610             Note that the shader object will be deleted when the WebGLShader object is destroyed.
2611             This method merely gives the author greater control over when the shader object is
2612             destroyed.
2613         <dt class="idl-code">void detachShader(WebGLProgram? program, WebGLShader? shader)
2614             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDetachShader.xml">man page</a>)</span>
2615         <dt class="idl-code">sequence&lt;WebGLShader&gt;? getAttachedShaders(WebGLProgram? program)
2616             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetAttachedShaders.xml">man page</a>)</span>
2617         <dd>
2618             <p>Returns a new object representing the list of shaders attached to the passed program.</p>
2619
2620             <p>Returns null if any OpenGL errors are generated during the execution of this
2621             function.</p>
2622         <dt class="idl-code">any getProgramParameter(WebGLProgram? program, GLenum pname)
2623             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetProgramiv.xml">man page</a>)</span>
2624         <dd>
2625             Return the value for the passed pname given the passed program. The type returned is the natural 
2626             type for the requested pname, as given in the following table:
2627             <table class="foo">
2628                 <tr><th>pname</th><th>returned type</th></tr>
2629                 <tr><td>DELETE_STATUS</td><td>GLboolean</td></tr>
2630                 <tr><td>LINK_STATUS</td><td>GLboolean</td></tr>
2631                 <tr><td>VALIDATE_STATUS</td><td>GLboolean</td></tr>
2632                 <tr><td>ATTACHED_SHADERS</td><td>GLint</td></tr>
2633                 <tr><td>ACTIVE_ATTRIBUTES</td><td>GLint</td></tr>
2634                 <tr><td>ACTIVE_UNIFORMS</td><td>GLint</td></tr>
2635             </table>
2636             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
2637             <p>Returns null if any OpenGL errors are generated during the execution of this
2638             function.</p>
2639         <dt class="idl-code">DOMString? getProgramInfoLog(WebGLProgram? program)
2640             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetProgramInfoLog.xml">man page</a>)</span>
2641         <dd>
2642             <p>Returns null if any OpenGL errors are generated during the execution of this
2643             function.</p>
2644         <dt class="idl-code">any getShaderParameter(WebGLShader? shader, GLenum pname)
2645             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetShaderiv.xml">man page</a>)</span>
2646         <dd>
2647             Return the value for the passed pname given the passed shader. The type returned is the natural 
2648             type for the requested pname, as given in the following table:
2649             <table class="foo">
2650                 <tr><th>pname</th><th>returned type</th></tr>
2651                 <tr><td>SHADER_TYPE</td><td>GLenum</td></tr>
2652                 <tr><td>DELETE_STATUS</td><td>GLboolean</td></tr>
2653                 <tr><td>COMPILE_STATUS</td><td>GLboolean</td></tr>
2654             </table>
2655             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error and returns null.</p>
2656             <p>Returns null if any OpenGL errors are generated during the execution of this
2657             function.</p>
2658         <dt class="idl-code">WebGLShaderPrecisionFormat getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype)
2659             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/docs/man/xhtml/glGetShaderPrecisionFormat.xml">man page</a>)</span>
2660         <dd>
2661             Return a new <code>WebGLShaderPrecisionFormat</code> describing the range and precision
2662             for the specified shader numeric format. The shadertype value can be FRAGMENT_SHADER or
2663             VERTEX_SHADER. The precisiontype value can be LOW_FLOAT, MEDIUM_FLOAT, HIGH_FLOAT,
2664             LOW_INT, MEDIUM_INT or HIGH_INT.
2665         <dt class="idl-code">DOMString? getShaderInfoLog(WebGLShader? shader)
2666             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetShaderInfoLog.xml">man page</a>)</span>
2667         <dd>
2668             <p>Returns null if any OpenGL errors are generated during the execution of this
2669             function.</p>
2670         <dt class="idl-code">DOMString? getShaderSource(WebGLShader? shader)
2671             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetShaderSource.xml">man page</a>)</span>
2672         <dd>
2673             <p>Returns null if any OpenGL errors are generated during the execution of this
2674             function.</p>
2675         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program)
2676             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsProgram.xml">man page</a>)</span>
2677         <dd>
2678             Return true if the passed WebGLProgram is valid and false otherwise. <br><br>
2679
2680             Returns false if the program's <a href="#webgl-object-invalidated-flag">invalidated
2681             flag</a> is set.
2682         <dt class="idl-code">[WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader)
2683             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glIsShader.xml">man page</a>)</span>
2684         <dd>
2685             Return true if the passed WebGLShader is valid and false otherwise. <br><br>
2686
2687             Returns false if the shader's <a href="#webgl-object-invalidated-flag">invalidated
2688             flag</a> is set.
2689         <dt class="idl-code">void linkProgram(WebGLProgram? program)
2690             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glLinkProgram.xml">man page</a>)</span>
2691         <dd>
2692             See <a href="#PACKING_RESTRICTIONS">Packing Restrictions for Uniforms and Varyings</a>
2693             for additional constraints enforced in, and additional validation performed by, WebGL
2694             implementations.
2695         <dt class="idl-code">void shaderSource(WebGLShader? shader, DOMString source)
2696             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.1">OpenGL ES 2.0 &sect;2.10.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glShaderSource.xml">man page</a>)</span>
2697         <dd>
2698             See <a href="#SUPPORTED_GLSL_CONSTRUCTS">Supported GLSL
2699             Constructs</a>, <a href="#MAX_GLSL_TOKEN_SIZE">Maximum GLSL Token
2700             Size</a>, <a href="#CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source
2701             Character Set</a>, <a href="#MAX_STRUCT_NESTING">Maximum Nesting of Structures in GLSL
2702             Shaders</a>, and <a href="#PACKING_RESTRICTIONS">Packing Restrictions for Uniforms and
2703             Varyings</a> for additional constraints enforced in, additional constructs supported by,
2704             and additional validation performed by WebGL implementations.
2705         <dt class="idl-code">void useProgram(WebGLProgram? program)
2706             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.3">OpenGL ES 2.0 &sect;2.10.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glUseProgram.xml">man page</a>)</span>
2707         <dt class="idl-code">void validateProgram(WebGLProgram? program)
2708             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.5">OpenGL ES 2.0 &sect;2.10.5</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glValidateProgram.xml">man page</a>)</span>
2709     </dl>
2710     
2711 <!-- ======================================================================================================= -->
2712
2713     <h4>Uniforms and attributes</h4>
2714
2715     <p>
2716         Values used by the shaders are passed in as uniforms or vertex attributes.
2717     </p>
2718      
2719     <dl class="methods">
2720         <dt class="idl-code">void disableVertexAttribArray(GLuint index)
2721             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.8">OpenGL ES 2.0 &sect;2.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDisableVertexAttribArray.xml">man page</a>)</span>
2722         <dt class="idl-code">void enableVertexAttribArray(GLuint index)
2723             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.8">OpenGL ES 2.0 &sect;2.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glEnableVertexAttribArray.xml">man page</a>)</span>
2724         <dd>
2725             Enable the vertex attribute at <code>index</code> as an array. WebGL imposes additional
2726             rules beyond OpenGL ES 2.0 regarding enabled vertex attributes;
2727             see <a href="#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range
2728             Checking</a>.
2729         <dt class="idl-code">WebGLActiveInfo? getActiveAttrib(WebGLProgram? program, GLuint index)
2730             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetActiveAttrib.xml">man page</a>)</span>
2731         <dd>
2732             Returns a new <code>WebGLActiveInfo</code> object describing the size, type and name of
2733             the vertex attribute at the passed index of the passed program object. If the passed
2734             index is out of range, generates an <code>INVALID_VALUE</code> error and returns null.
2735             <p>Returns null if any OpenGL errors are generated during the execution of this
2736             function.</p>
2737         <dt class="idl-code">WebGLActiveInfo? getActiveUniform(WebGLProgram? program, GLuint index)
2738             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetActiveUniform.xml">man page</a>)</span>
2739         <dd>
2740             Returns a new <code>WebGLActiveInfo</code> object describing the size, type and name of
2741             the uniform at the passed index of the passed program object. If the passed index is out
2742             of range, generates an <code>INVALID_VALUE</code> error and returns null.
2743             <p>Returns null if any OpenGL errors are generated during the execution of this
2744             function.</p>
2745         <dt class="idl-code">[WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram? program, DOMString name)
2746             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetAttribLocation.xml">man page</a>)</span>
2747         <dd>
2748             If the passed name is longer than the restriction defined
2749             in <a href="#MAX_LOCATION_LENGTHS">Maximum Uniform and Attribute Location Lengths</a>,
2750             generates an <code>INVALID_VALUE</code> error and returns -1. <br><br>
2751
2752             Returns -1 if <code>name</code> starts with one of the reserved WebGL prefixes
2753             per <a href="#GLSL_CONSTRUCTS">GLSL Constructs</a>. <br><br>
2754
2755             Returns -1 if the context's <a href="#webgl-context-lost-flag">webgl context lost
2756             flag</a> is set. <br><br>
2757
2758             If the <a href="#webgl-object-invalidated-flag">invalidated flag</a> of the passed
2759             program is set, generates an <code>INVALID_OPERATION</code> error and returns
2760             -1. <br><br>
2761
2762             See <a href="#CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source Character
2763             Set</a> for additional validation performed by WebGL implementations.
2764         <dt class="idl-code">any getUniform(WebGLProgram? program, WebGLUniformLocation? location)
2765             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetUniform.xml">man page</a>)</span>
2766         <dd>
2767             Return the uniform value at the passed location in the passed program. The type returned is 
2768             dependent on the uniform type, as shown in the following table:
2769             <table class="foo">
2770                 <tr><th>uniform type</th><th>returned type</th></tr>
2771                 <tr><td>boolean</td><td>GLboolean</td></tr>
2772                 <tr><td>int</td><td>GLint</td></tr>
2773                 <tr><td>float</td><td>GLfloat</td></tr>
2774                 <tr><td>vec2</td><td>Float32Array (with 2 elements)</td></tr>
2775                 <tr><td>ivec2</td><td>Int32Array (with 2 elements)</td></tr>
2776                 <tr><td>bvec2</td><td>sequence&lt;GLboolean&gt; (with 2 elements)</td></tr>
2777                 <tr><td>vec3</td><td>Float32Array (with 3 elements)</td></tr>
2778                 <tr><td>ivec3</td><td>Int32Array (with 3 elements)</td></tr>
2779                 <tr><td>bvec3</td><td>sequence&lt;GLboolean&gt; (with 3 elements)</td></tr>
2780                 <tr><td>vec4</td><td>Float32Array (with 4 elements)</td></tr>
2781                 <tr><td>ivec4</td><td>Int32Array (with 4 elements)</td></tr>
2782                 <tr><td>bvec4</td><td>sequence&lt;GLboolean&gt; (with 4 elements)</td></tr>
2783                 <tr><td>mat2</td><td>Float32Array (with 4 elements)</td></tr>
2784                 <tr><td>mat3</td><td>Float32Array (with 9 elements)</td></tr>
2785                 <tr><td>mat4</td><td>Float32Array (with 16 elements)</td></tr>
2786                 <tr><td>sampler2D</td><td>GLint</td></tr>
2787                 <tr><td>samplerCube</td><td>GLint</td></tr>
2788             </table>
2789             <p>All queries returning sequences or typed arrays return a new object each time.</p>
2790             <p>Returns null if any OpenGL errors are generated during the execution of this
2791             function.</p>
2792         <dt class="idl-code">WebGLUniformLocation? getUniformLocation(WebGLProgram? program, DOMString name)
2793             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetUniformLocation.xml">man page</a>)</span>
2794         <dd>
2795             <p>Return a new <code>WebGLUniformLocation</code> that represents the location of a
2796             specific uniform variable within a program object. The return value is null if name does
2797             not correspond to an active uniform variable in the passed program.</p>
2798
2799             <p>If the passed name is longer than the restriction defined
2800             in <a href="#MAX_LOCATION_LENGTHS">Maximum Uniform and Attribute Location Lengths</a>,
2801             generates an <code>INVALID_VALUE</code> error and returns null.</p>
2802
2803             <p>Returns null if <code>name</code> starts with one of the reserved WebGL prefixes
2804             per <a href="#GLSL_CONSTRUCTS">GLSL Constructs</a>.</p>
2805
2806             <p>See <a href="#CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source
2807             Character Set</a> for additional validation performed by WebGL implementations.</p>
2808
2809             <p>Returns null if any OpenGL errors are generated during the execution of this
2810             function.</p>
2811         <dt class="idl-code">any getVertexAttrib(GLuint index, GLenum pname)
2812             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetVertexAttrib.xml">man page</a>)</span>
2813         <dd>
2814             Return the information requested in pname about the vertex attribute at the passed index. The 
2815             type returned is dependent on the information requested, as shown in the following table:
2816             <table class="foo">
2817                 <tr><th>pname</th><th>returned type</th></tr>
2818                 <tr><td>VERTEX_ATTRIB_ARRAY_BUFFER_BINDING</td><td>WebGLBuffer</td></tr>
2819                 <tr><td>VERTEX_ATTRIB_ARRAY_ENABLED</td><td>GLboolean</td></tr>
2820                 <tr><td>VERTEX_ATTRIB_ARRAY_SIZE</td><td>GLint</td></tr>
2821                 <tr><td>VERTEX_ATTRIB_ARRAY_STRIDE</td><td>GLint</td></tr>
2822                 <tr><td>VERTEX_ATTRIB_ARRAY_TYPE</td><td>GLenum</td></tr>
2823                 <tr><td>VERTEX_ATTRIB_ARRAY_NORMALIZED</td><td>GLboolean</td></tr>
2824                 <tr><td>CURRENT_VERTEX_ATTRIB</td><td>Float32Array (with 4 elements)</td></tr>
2825             </table>
2826             <p>All queries returning sequences or typed arrays return a new object each time.</p>
2827             <p>If <em>pname</em> is not in the table above, generates an <code>INVALID_ENUM</code> error.</p>
2828             <p>If an OpenGL error is generated, returns null.</p>
2829         <dt class="idl-code">[WebGLHandlesContextLoss] GLsizeiptr getVertexAttribOffset(GLuint index, GLenum pname)
2830             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-6.1.8">OpenGL ES 2.0 &sect;6.1.8</a>, similar to <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glGetVertexAttribPointerv.xml">man page</a>)</span>
2831         <dd>
2832             Returns 0 if the context's <a href="#webgl-context-lost-flag">webgl context lost
2833             flag</a> is set.
2834         <dt><p class="idl-code">void uniform[1234][fi](WebGLUniformLocation? location, ...)</p>
2835             <p class="idl-code">void uniform[1234][fi]v(WebGLUniformLocation? location, ...)
2836             <p class="idl-code">void uniformMatrix[234]fv(WebGLUniformLocation? location, GLboolean transpose, ...)
2837             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.10.4">OpenGL ES 2.0 &sect;2.10.4</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glUniform.xml">man page</a>)</span></p>
2838        <dd>
2839             Each of the uniform* functions above sets the specified uniform or uniforms to the
2840             values provided. If the passed <code>location</code> is not null and was not obtained
2841             from the currently used program via an earlier call to <code>getUniformLocation</code>,
2842             an <code>INVALID_OPERATION</code> error will be generated. If the passed
2843             <code>location</code> is null, the data passed in will be silently ignored and
2844             no uniform variables will be changed.
2845             <br><br>
2846             If the array passed to any of the vector forms (those ending in <code>v</code>) has an 
2847             invalid length, an <code>INVALID_VALUE</code> error will be generated. The length is 
2848             invalid if it is too short for or is not an integer multiple of the assigned type.
2849         <dt><p class="idl-code">void vertexAttrib[1234]f(GLuint indx, ...)</p>
2850             <p class="idl-code">void vertexAttrib[1234]fv(GLuint indx, ...)
2851             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.7">OpenGL ES 2.0 &sect;2.7</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glVertexAttrib.xml">man page</a>)</span></p>
2852        <dd>
2853            Sets the vertex attribute at the passed index to the given constant value. Values set via the
2854            <code>vertexAttrib</code> are guaranteed to be returned from the <code>getVertexAttrib</code> function
2855            with the <code>CURRENT_VERTEX_ATTRIB</code> param, even if there have been intervening calls to 
2856            <code>drawArrays</code> or <code>drawElements</code>.
2857        <dt class="idl-code">void vertexAttribPointer(GLuint indx, GLint size, GLenum type, 
2858                             GLboolean normalized, GLsizei stride, GLintptr offset)
2859             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.8">OpenGL ES 2.0 &sect;2.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glVertexAttribPointer.xml">man page</a>)</span>
2860         <dd>
2861             Assign the WebGLBuffer object currently bound to the ARRAY_BUFFER target to the vertex
2862             attribute at the passed index. Size is number of components per attribute. Stride and
2863             offset are in units of bytes. Passed stride and offset must be appropriate for the
2864             passed type and size or an <code>INVALID_OPERATION</code> error will be generated;
2865             see <a href="#BUFFER_OFFSET_AND_STRIDE">Buffer Offset and Stride Requirements</a>. If
2866             offset is negative, an <code>INVALID_VALUE</code> error will be generated. If no
2867             WebGLBuffer is bound to the ARRAY_BUFFER target, an <code>INVALID_OPERATION</code> error
2868             will be generated. In WebGL, the maximum supported stride is 255;
2869             see <a href="#VERTEX_STRIDE"> Vertex Attribute Data Stride</a>.
2870     </dl>
2871     
2872 <!-- ======================================================================================================= -->
2873
2874     <h4><a name="WRITING_TO_THE_DRAWING_BUFFER">Writing to the drawing buffer</a></h4>
2875
2876     <p>
2877         OpenGL ES 2.0 has 3 calls which can render to the drawing buffer: <code>clear</code>, 
2878         <code>drawArrays</code> and <code>drawElements</code>. Furthermore rendering can
2879         be directed to the drawing buffer or to a Framebuffer object. When rendering is
2880         directed to the drawing buffer, making any of the 3 rendering calls shall 
2881         cause the drawing buffer to be presented to the HTML page compositor at the start
2882         of the next compositing operation.
2883     </p>
2884      
2885     <dl class="methods">
2886         <dt class="idl-code">void clear(GLbitfield mask)
2887             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.2.3">OpenGL ES 2.0 &sect;4.2.3</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glClear.xml">man page</a>)</span>
2888         <dt class="idl-code">void drawArrays(GLenum mode, GLint first, GLsizei count)
2889             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.8">OpenGL ES 2.0 &sect;2.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDrawArrays.xml">man page</a>)</span>
2890             <dd>
2891             If <em>first</em> is negative, an <code>INVALID_VALUE</code> error will be generated.
2892             If the CURRENT_PROGRAM is null, an <code>INVALID_OPERATION</code> error will be generated.
2893         <dt class="idl-code">void drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset)
2894             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-2.8">OpenGL ES 2.0 &sect;2.8</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glDrawElements.xml">man page</a>)</span>
2895         <dd>
2896             Draw using the currently bound element array buffer.  The given offset is in bytes, and
2897             must be a valid multiple of the size of the given type or an <code>INVALID_OPERATION</code>
2898             error will be generated; see <a href="#BUFFER_OFFSET_AND_STRIDE">Buffer Offset and Stride
2899             Requirements</a>. If <code>count</code> is greater than zero, then a non-null
2900             <code>WebGLBuffer</code> must be bound to the <code>ELEMENT_ARRAY_BUFFER</code> binding
2901             point or an <code>INVALID_OPERATION</code> error will be generated.<br><br>
2902             If the CURRENT_PROGRAM is null, an <code>INVALID_OPERATION</code> error will be generated.
2903
2904             WebGL performs additional error checking beyond that specified in OpenGL ES 2.0 during
2905             calls to <code>drawArrays</code>
2906             and <code>drawElements</code>. See <a href="#ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex
2907             Attributes and Range Checking</a>.
2908         <dt class="idl-code">void finish()
2909             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-5.1">OpenGL ES 2.0 &sect;5.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glFinish.xml">man page</a>)</span>
2910         <dt class="idl-code">void flush()
2911             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-5.1">OpenGL ES 2.0 &sect;5.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glFlush.xml">man page</a>)</span>
2912     </dl>
2913
2914 <!-- ======================================================================================================= -->
2915
2916     <h4><a name="readpixels">Reading back pixels</a></h4>
2917
2918     <p>
2919         Pixels in the current framebuffer can be read back into an ArrayBufferView object.
2920     </p>
2921
2922     <dl class="methods">
2923         <dt class="idl-code">void readPixels(GLint x, GLint y, GLsizei width, GLsizei height, 
2924                            GLenum format, GLenum type, ArrayBufferView? pixels)
2925             <span class="gl-spec">(<a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf#nameddest=section-4.3.1">OpenGL ES 2.0 &sect;4.3.1</a>, <a class="nonnormative" href="http://www.khronos.org/opengles/sdk/2.0/docs/man/xhtml/glReadPixels.xml">man page</a>)</span>
2926         <dd>
2927             Fills <code>pixels</code> with the pixel data in the specified rectangle of the frame
2928             buffer. The data returned from readPixels must be up-to-date as of the most recently
2929             sent drawing command.
2930             <br><br>
2931
2932             The type of <code>pixels</code> must match the type of the data to be read. For example,
2933             if it is UNSIGNED_BYTE, a Uint8Array must be supplied; if it is UNSIGNED_SHORT_5_6_5,
2934             UNSIGNED_SHORT_4_4_4_4, or UNSIGNED_SHORT_5_5_5_1, a Uint16Array must be supplied. If
2935             the types do not match, an INVALID_OPERATION error is generated.
2936             <br><br>
2937
2938             Only two combinations of <code>format</code> and <code>type</code> are accepted. The
2939             first is <code>format</code> RGBA and <code>type</code> UNSIGNED_BYTE. The second is an
2940             implementation-chosen format. The values of <code>format</code> and <code>type</code>
2941             for this format may be determined by calling
2942             <a href="#GETPARAMETER"><code>getParameter</code></a> with the symbolic constants
2943             IMPLEMENTATION_COLOR_READ_FORMAT and IMPLEMENTATION_COLOR_READ_TYPE, respectively. The
2944             implementation-chosen format may vary depending on the format of the currently bound
2945             rendering surface. Unsupported combinations of <code>format</code> and <code>type</code>
2946             will generate an INVALID_OPERATION error. <br><br>
2947
2948             If <code>pixels</code> is null, an INVALID_VALUE error is generated. If
2949             <code>pixels</code> is non-null, but is not large enough to retrieve all of the pixels
2950             in the specified rectangle taking into account pixel store modes, an INVALID_OPERATION
2951             error is generated.
2952             <br><br>
2953
2954             For any pixel lying outside the frame buffer, the value read contains 0 in all channels;
2955             see <a href="#READS_OUTSIDE_FRAMEBUFFER">Reading Pixels Outside the Framebuffer</a>.
2956             <br><br>
2957
2958             If this function attempts to read from a complete framebuffer with a missing color
2959             attachment, an <code>INVALID_OPERATION</code> error is generated
2960             per <a href="#READING_FROM_MISSING_ATTACHMENT">Reading from a Missing Attachment</a>.
2961     </dl>
2962     
2963 <!-- ======================================================================================================= -->
2964
2965     <h4>Detecting context lost events</h4>
2966
2967     <p>
2968         Occurrences such as power events on mobile devices may cause the WebGL rendering context to
2969         be lost at any time and require the application to rebuild it;
2970         see <a href="#WEBGLCONTEXTEVENT">WebGLContextEvent</a> for more details. The
2971         following method assists in detecting context lost events.
2972     </p>
2973
2974     <dl class="methods">
2975         <dt class="idl-code">[WebGLHandlesContextLoss] boolean isContextLost()
2976         <dd>
2977             Return true if the <a href="#webgl-context-lost-flag">webgl context lost flag</a> is
2978             set, otherwise return false.
2979     </dl>
2980     
2981 <!-- ======================================================================================================= -->
2982
2983     <h4>Detecting and enabling extensions</h4>
2984
2985     <p>
2986         An implementation of WebGL must not support any additional parameters, constants or functions
2987         without first enabling that functionality through the extension mechanism. The 
2988         <code>getSupportedExtensions</code> function returns an array of the extension strings
2989         supported by this implementation. An extension is enabled by passing one of those strings to
2990         the <code>getExtension</code> function. This call returns an object which contains any
2991         constants or functions defined by that extension. The definition of that object is specific
2992         to the extension and must be defined by the extension specification.
2993     </p>
2994     <p>
2995         Once an extension is enabled, it is only disabled if the WebGL rendering context is lost (see
2996         below), with the exception of the "WEBGL_lose_context" extension which remains active through
2997         any loss of context. Any objects referenced by a disabled extension, such as the object returned
2998         by <code>getExtension</code>, are no longer associated with the WebGL rendering context. Any
2999         extension objects that derive from <code>WebGLObject</code> have their
3000         <a href="#webgl-object-invalidated-flag">invalidated</a> flag set to true. Any use of a disabled
3001         extension or its referenced objects generates an INVALID_OPERATION error.
3002     <p>
3003         There are no other mechanisms to disable an extension.
3004     </p>
3005     <p>
3006         Multiple calls to <code>getExtension</code> with the same extension string, taking into account
3007         case-insensitive comparison, must return the same object as long as the extension is enabled. An
3008         attempt to use any features of an extension without first calling getExtension to enable it must
3009         generate an appropriate GL error and must not make use of the feature.
3010     </p>
3011     <p>
3012         This specification does not define any extensions. A separate <a href="#refsREGISTRY">WebGL
3013         extension registry</a> defines extensions that may be supported by a particular WebGL
3014         implementation.
3015     </p>
3016
3017     <dl class="methods">
3018         <dt class="idl-code">sequence&lt;DOMString&gt;? getSupportedExtensions()
3019         <dd>
3020             Returns a list of all the supported extension strings.
3021             
3022         <dt class="idl-code">object? getExtension(DOMString name)
3023         <dd>
3024             Returns an object if, and only if, <em>name</em> is
3025             an <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/infrastructure.html#ascii-case-insensitive">ASCII
3026             case-insensitive match</a> <a href="#refsHTML">[HTML]</a> for one of the names returned
3027             from <code>getSupportedExtensions</code>; otherwise, returns <code>null</code>. The
3028             object returned from <code>getExtension</code> contains any constants or functions
3029             provided by the extension. A returned object may have no constants or functions if the
3030             extension does not define any, but a unique object must still be returned. That object
3031             is used to indicate that the extension has been enabled.
3032     </dl>
3033
3034 <!-- ======================================================================================================= -->
3035
3036     <h3><a name="WEBGLCONTEXTEVENT">WebGLContextEvent</a></h3>
3037
3038     <p>
3039         WebGL generates a <code>WebGLContextEvent</code> event in response to a status change to the
3040         WebGL rendering context associated with the HTMLCanvasElement which has a listener for this
3041         event. Events are sent using the DOM Event
3042         System <a href="#refsDOM3EVENTS">[DOM3EVENTS]</a>. Event types can include the loss or
3043         restoration of state, or the inability to create a context.
3044         <a href="http://www.w3.org/TR/domcore/#eventinit">EventInit</a> is defined in the DOM4
3045         specification <a href="#refsDOM4">[DOM4]</a>.
3046     </p>
3047         To <b><a name="fire-a-webgl-context-event">fire a WebGL context event named e</a></b> means
3048         that an <a href="http://www.w3.org/TR/domcore/#concept-event">event</a> using
3049         the <code>WebGLContextEvent</code> interface, with
3050         its <a href="http://www.w3.org/TR/domcore/#dom-event-type"><code>type</code></a>
3051         attribute <a href="#refsDOM4">[DOM4]</a> initialized to <em>e</em>, its
3052         <code>cancelable</code> attribute initialized to true, and
3053         its <a href="http://www.w3.org/TR/domcore/#dom-event-istrusted"><code>isTrusted</code></a>
3054         attribute <a href="#refsDOM4">[DOM4]</a> initialized to true, is to
3055         be <a href="http://www.w3.org/TR/domcore/#concept-event-dispatch">dispatched</a> at the
3056         given object.
3057     <p>
3058     </p>
3059     <pre class="idl">
3060 [Constructor(DOMString type, optional WebGLContextEventInit eventInit)]
3061 interface <dfn id="WebGLContextLostEvent">WebGLContextEvent</dfn> : <a href="http://www.w3.org/TR/domcore/#event">Event</a> {
3062     readonly attribute DOMString statusMessage;
3063 };
3064
3065 // EventInit is defined in the DOM4 specification.
3066 dictionary WebGLContextEventInit : <a href="http://www.w3.org/TR/domcore/#eventinit">EventInit</a> {
3067     DOMString statusMessage;
3068 };</pre>
3069
3070     <p>
3071     The <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#task-source">task
3072     source</a> for
3073     all <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#concept-task">tasks</a> <a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/webappapis.html#queue-a-task">queued</a> <a href="#refsHTML">[HTML]</a>
3074     in this section is the <b>WebGL task source</b>.
3075     </p>
3076
3077     <h4>Attributes</h4>
3078
3079     <p>
3080         The following attributes are available:
3081     </p>
3082
3083     <dl class="methods">
3084         <dt><span class="prop-name"><code>statusMessage</code></span> of type <code>DOMString</code>
3085         <dd>
3086             A string containing additional information, or the empty string if no additional information
3087             is available.
3088     </dl>
3089
3090     <h4><a name="CONTEXT_LOST">The Context Lost Event</a></h4>
3091
3092     <p>
3093         When the user agent detects that the <em>drawing buffer</em> associated with
3094         a <code>WebGLRenderingContext</code> <em>context</em> has been lost, it must run the
3095         following steps:
3096
3097         <ol class="nestedlist">
3098
3099         <li> Let <em>canvas</em> be the <em>context's</em>
3100         <a href="#context-canvas">canvas</a>. </li>
3101
3102         <li> If </em>context's</em> <a href="#webgl-context-lost-flag">webgl context lost</a> flag
3103         is set, abort these steps. </li>
3104
3105         <li> Set <em>context's</em> <a href="#webgl-context-lost-flag">webgl context lost</a>
3106         flag. </li>
3107
3108         <li> Set the <a href="#webgl-object-invalidated-flag">invalidated flag</a> of
3109         each <code>WebGLObject</code> instance created by this context. </li>
3110
3111         <li> Disable all extensions except "WEBGL_lose_context". </li>
3112
3113         <li> <a href="http://dev.w3.org/html5/spec/webappapis.html#queue-a-task">Queue a task</a> to
3114         perform the following steps:
3115
3116             <ol class="nestedlist">
3117
3118             <li> <a href="#fire-a-webgl-context-event">Fire a WebGL context event</a> named
3119             "webglcontextlost" at <em>canvas</em>, with its <code>statusMessage</code> attribute set
3120             to "". </li>
3121
3122             <li> If the
3123             event's <a href="http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#canceled-flag">canceled
3124             flag</a> is not set, abort these steps. </li>
3125
3126             <li> Perform the following steps asynchronously. </li>
3127
3128             <li> Await a restorable <em>drawing buffer</em>. </li>
3129
3130             <li> Queue a task to <a href="#restore-the-drawing-buffer">restore the drawing
3131             buffer</a> for <em>context</em>. </li>
3132
3133             </ol>
3134
3135         </li>
3136         </ol>
3137     </p>
3138     <div class="example">
3139         The following code prevents the default behavior of the <code>webglcontextlost</code>
3140         event and enables the <code>webglcontextrestored</code> event to be delivered:
3141     <pre>canvas.addEventListener("webglcontextlost", function(e) { e.preventDefault(); }, false); </pre>
3142     </div>
3143
3144     <h4>The Context Restored Event</h4>
3145
3146     <p>
3147
3148         When the user agent is to <b><a name="restore-the-drawing-buffer">restore the drawing
3149         buffer</a></b> for a <code>WebGLRenderingContext</code> <em>context</em>, it must run the
3150         following steps:
3151
3152         <ol class="nestedlist">
3153
3154         <li> Let <em>canvas</em> be the canvas object associated with <em>context</em>.
3155
3156         <li> If <em>context's</em> <a href="#webgl-context-lost-flag">webgl context lost flag</a> is
3157         not set, abort these steps.
3158
3159         <li> <a href="#create-a-drawing-buffer">Create a <em>drawing buffer</em></a> using the
3160         settings specified in <em>context's</em> <a href="#context-creation-parameters">context
3161         creation parameters</a>, and associate the <em>drawing buffer</em> with <em>context</em>,
3162         discarding any previous <em>drawing buffer</em>.
3163
3164         <li> Clear <em>context's</em> <a href="#webgl-context-lost-flag">webgl context lost
3165         flag</a>.
3166
3167         <li> Reset <em>context's</em> OpenGL error state.
3168
3169         <li> <a href="#fire-a-webgl-context-event">Fire a WebGL context event</a> named
3170         "webglcontextrestored" at <em>canvas</em>, with its <code>statusMessage</code> attribute set
3171         to "".
3172
3173         </ol>
3174
3175     </p>
3176
3177     <div class="note"> 
3178         Once the context is restored, WebGL resources such as textures and buffers that were created
3179         before the context was lost are no longer valid. The application needs to reinitialize the
3180         context's state and recreate all such resources.
3181     </div>
3182
3183     <div class="example">
3184         The following code illustrates how an application can handle context loss and restoration:
3185 <pre>function initializeGame() {
3186   initializeWorld();
3187   initializeResources();
3188 }
3189
3190 function initializeResources() {
3191   initializeShaders();
3192   initializeBuffers();
3193   initializeTextures();
3194
3195   // ready to draw, start the main loop
3196   renderFrame();
3197 }
3198
3199 function renderFrame() {
3200   updateWorld();
3201   drawSkyBox();
3202   drawWalls();
3203   drawMonsters();
3204
3205   requestId = window.requestAnimationFrame(
3206       renderFrame, canvas);
3207 }
3208
3209 canvas.addEventListener(
3210     "webglcontextlost", function (event) {
3211
3212   // inform WebGL that we handle context restoration
3213   event.preventDefault();
3214
3215   // Stop rendering
3216   window.cancelAnimationFrame(requestId);
3217 }, false);
3218
3219 canvas.addEventListener(
3220     "webglcontextrestored", function (event) {
3221
3222   initializeResources();
3223 }, false);
3224
3225 initializeGame();</pre>
3226     </div>
3227
3228     <h4>The Context Creation Error Event</h4>
3229
3230     <p>
3231         When the user agent is to <b><a name="fire-a-webgl-context-creation-error">fire a WebGL
3232         context creation error</a></b> at a <em>canvas</em>, it must perform the following steps:
3233
3234         <ol class="nestedlist">
3235
3236         <li> <a href="#fire-a-webgl-context-event">Fire a WebGL context event</a> named
3237         "webglcontextcreationerror" at <em>canvas</em>, optionally with its <code>statusMessage</code>
3238         attribute set to a platform dependent string about the nature of the failure. </li>
3239
3240         </ol>
3241
3242     </p>
3243
3244     <div class="example">
3245
3246         The following code illustrates how an application can retrieve information about context creation failure:
3247
3248 <pre>var errorInfo = "";
3249 function onContextCreationError(event) {
3250
3251   canvas.removeEventListener(
3252      "webglcontextcreationerror",
3253      onContextCreationError, false);
3254
3255   errorInfo = e.statusMessage || "Unknown";
3256 }
3257
3258 canvas.addEventListener(
3259     "webglcontextcreationerror",
3260     onContextCreationError, false);
3261
3262 var gl = canvas.getContext("experimental-webgl");
3263 if(!gl) {
3264   alert("A WebGL context could not be created.\nReason: " +
3265         errorInfo);
3266 }</pre>
3267     </div>
3268
3269 <!-- ======================================================================================================= -->
3270
3271     <h2><a name="webgl_gl_differences">Differences Between WebGL and OpenGL ES 2.0</a></h2>
3272     
3273 <p>
3274
3275 This section describes changes made to the WebGL API relative to the OpenGL ES 2.0 API to improve
3276 portability across various operating systems and devices.
3277
3278 </p>
3279
3280     <h3><a name="BUFFER_OBJECT_BINDING">Buffer Object Binding</a></h3>
3281
3282 <p>
3283
3284 In the WebGL API, a given buffer object may only be bound to one of the <code>ARRAY_BUFFER</code> or
3285 <code>ELEMENT_ARRAY_BUFFER</code> binding points in its lifetime. This restriction implies that a
3286 given buffer object may contain either vertices or indices, but not both.
3287
3288 </p>
3289 <p>
3290
3291 The type of a WebGLBuffer is initialized the first time it is passed as an argument
3292 to <code>bindBuffer</code>. A subsequent call to <code>bindBuffer</code> which attempts to bind the
3293 same WebGLBuffer to the other binding point will generate an <code>INVALID_OPERATION</code> error, and
3294 the state of the binding point will remain untouched.
3295
3296 </p>
3297
3298     <h3>No Client Side Arrays</h3>
3299
3300 <p>
3301
3302 The WebGL API does not support client-side arrays. If <code>vertexAttribPointer</code> is called
3303 without a <code>WebGLBuffer</code> bound to the <code>ARRAY_BUFFER</code> binding point,
3304 an <code>INVALID_OPERATION</code> error is generated. If <code>drawElements</code> is called with
3305 a <code>count</code> greater than zero, and no <code>WebGLBuffer</code> is bound to
3306 the <code>ELEMENT_ARRAY_BUFFER</code> binding point, an <code>INVALID_OPERATION</code> error is
3307 generated.
3308
3309 </p>
3310
3311     <h3>No Default Textures</h3>
3312
3313 <p>
3314
3315 The WebGL API does not support default textures. A non-null <code>WebGLTexture</code> object must be
3316 bound in order for texture-related operations and queries to succeed.
3317
3318 </p>
3319
3320     <h3><a name="BUFFER_OFFSET_AND_STRIDE">Buffer Offset and Stride Requirements</a></h3>
3321
3322 <p>
3323
3324 The <code>offset</code> arguments to <code>drawElements</code> and <code>vertexAttribPointer</code>,
3325 and the <code>stride</code> argument to <code>vertexAttribPointer</code>, must be a multiple of the
3326 size of the data type passed to the call, or an <code>INVALID_OPERATION</code> error is generated.
3327
3328 </p>
3329
3330
3331     <h3><a name="ATTRIBS_AND_RANGE_CHECKING">Enabled Vertex Attributes and Range Checking</a></h3>
3332
3333 <p>
3334
3335 If a vertex attribute is enabled as an array via <code>enableVertexAttribArray</code> but no buffer
3336 is bound to that attribute via <code>bindBuffer</code> and <code>vertexAttribPointer</code>, then
3337 calls to <code>drawArrays</code> or <code>drawElements</code> will generate an
3338 <code>INVALID_OPERATION</code> error.
3339
3340 </p>
3341 <p>
3342
3343 If a vertex attribute is enabled as an array, a buffer is bound to that attribute, and the attribute
3344 is consumed by the current program, then calls to <code>drawArrays</code>
3345 and <code>drawElements</code> will verify that each referenced vertex lies within the storage of the
3346 bound buffer. If the range specified in <code>drawArrays</code> or any referenced index
3347 in <code>drawElements</code> lies outside the storage of the bound buffer, an INVALID_OPERATION
3348 error is generated and no geometry is drawn.
3349
3350 </p>
3351 <p>
3352
3353 If a vertex attribute is enabled as an array, a buffer is bound to that attribute, but the attribute
3354 is not consumed by the current program, then regardless of the size of the bound buffer, it will not
3355 cause any error to be generated during a call to <code>drawArrays</code>
3356 or <code>drawElements</code>.
3357
3358 </p>
3359
3360     <h3><a name="FBO_ATTACHMENTS">Framebuffer Object Attachments</a></h3>
3361
3362 <p>
3363
3364 WebGL adds the <code>DEPTH_STENCIL_ATTACHMENT</code> framebuffer object attachment point and
3365 the <code>DEPTH_STENCIL</code> renderbuffer internal format. To attach both depth and stencil
3366 buffers to a framebuffer object, call <code>renderbufferStorage</code> with
3367 the <code>DEPTH_STENCIL</code> internal format, and then call <code>framebufferRenderbuffer</code>
3368 with the <code>DEPTH_STENCIL_ATTACHMENT</code> attachment point.
3369
3370 </p>
3371 <p>
3372
3373 A renderbuffer attached to the <code>DEPTH_ATTACHMENT</code> attachment point must be allocated with
3374 the <code>DEPTH_COMPONENT16</code> internal format. A renderbuffer attached to
3375 the <code>STENCIL_ATTACHMENT</code> attachment point must be allocated with
3376 the <code>STENCIL_INDEX8</code> internal format. A renderbuffer attached to
3377 the <code>DEPTH_STENCIL_ATTACHMENT</code> attachment point must be allocated with
3378 the <code>DEPTH_STENCIL</code> internal format.
3379
3380 </p>
3381 <p>
3382
3383 In the WebGL API, it is an error to concurrently attach renderbuffers to the following combinations
3384 of attachment points:
3385
3386 <ul>
3387 <li> <code>DEPTH_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT</code>
3388 <li> <code>STENCIL_ATTACHMENT + DEPTH_STENCIL_ATTACHMENT</code>
3389 <li> <code>DEPTH_ATTACHMENT + STENCIL_ATTACHMENT</code>
3390 </ul>
3391
3392 If any of the constraints above are violated, then:
3393
3394 <ul>
3395 <li> <code>checkFramebufferStatus</code> must return <code>FRAMEBUFFER_UNSUPPORTED</code>.
3396 <li> The following calls, which either modify or read the framebuffer, must generate
3397      an <code>INVALID_FRAMEBUFFER_OPERATION</code> error and return early, leaving the contents of
3398      the framebuffer, destination texture or destination memory untouched.
3399   <ul>
3400   <li> clear
3401   <li> copyTexImage2D
3402   <li> copyTexSubImage2D
3403   <li> drawArrays
3404   <li> drawElements
3405   <li> readPixels
3406   </ul>
3407 </ul>
3408
3409 The following combinations of framebuffer object attachments, when all of the attachments are
3410 framebuffer attachment complete, non-zero, and have the same width and height, must result in the
3411 framebuffer being framebuffer complete:
3412
3413 <ul>
3414 <li> <code>COLOR_ATTACHMENT0</code> = <code>RGBA/UNSIGNED_BYTE</code> texture
3415 <li> <code>COLOR_ATTACHMENT0</code> = <code>RGBA/UNSIGNED_BYTE</code> texture + <code>DEPTH_ATTACHMENT</code> = <code>DEPTH_COMPONENT16</code> renderbuffer
3416 <li> <code>COLOR_ATTACHMENT0</code> = <code>RGBA/UNSIGNED_BYTE</code> texture + <code>DEPTH_STENCIL_ATTACHMENT</code> = <code>DEPTH_STENCIL</code> renderbuffer
3417 </ul>
3418
3419 <h3><a name="TEXTURE_UPLOAD_SIZE">Texture Upload Width and Height</a></h3>
3420
3421 <p>
3422 Unless <code>width</code> and <code>height</code> parameters are explicitly specified, the width
3423 and height of the texture set by <code>texImage2D</code> and the width and height of the
3424 sub-rectangle updated by <code>texSubImage2D</code> are determined based on the uploaded
3425 <code>TexImageSource source</code> object:
3426 </p>
3427
3428     <dl>
3429         <dt><code>source</code> of type <code>ImageData</code>
3430         <dd>
3431             The width and height of the texture are set to the current values of the width and
3432             height properties of the ImageData object, representing the actual pixel width and height
3433             of the <code>ImageData</code> object.
3434         <dt><code>source</code> of type <code>HTMLImageElement</code>
3435         <dd>
3436             If a bitmap is uploaded, the width and height of the texture are set to the width and
3437             height of the uploaded bitmap in pixels. If an SVG image is uploaded, the width and
3438             height of the texture are set to the current values of the width and height properties
3439             of the <code>HTMLImageElement</code> object.
3440         <dt><code>source</code> of type <code>HTMLCanvasElement</code>
3441         <dd>
3442             The width and height of the texture are set to the current values of the width and
3443             height properties of the <code>HTMLCanvasElement</code> object.
3444         <dt><code>source</code> of type <code>HTMLVideoElement</code>
3445         <dd>
3446             The width and height of the texture are set to the width and height of the uploaded
3447             frame of the video in pixels.
3448     </dl>
3449
3450 <h3><a name="PIXEL_STORAGE_PARAMETERS">Pixel Storage Parameters</a></h3>
3451
3452 <p>
3453 The WebGL API supports the following additional parameters to <code>pixelStorei</code>.
3454
3455 <dl>
3456 <dt><code>UNPACK_FLIP_Y_WEBGL</code> of type <code>boolean</code>
3457 <dd>If set, then during any subsequent calls to <code>texImage2D</code> or
3458 <code>texSubImage2D</code>, the source data is flipped along the vertical axis, so that conceptually
3459 the last row is the first one transferred. The initial value is <code>false</code>. Any non-zero
3460 value is interpreted as <code>true</code>.
3461
3462 <dt><code>UNPACK_PREMULTIPLY_ALPHA_WEBGL</code> of type <code>boolean</code>
3463 <dd>If set, then during any subsequent calls to <code>texImage2D</code>
3464 or <code>texSubImage2D</code>, the alpha channel of the source data, if present, is multiplied into
3465 the color channels during the data transfer. The initial value is <code>false</code>. Any non-zero
3466 value is interpreted as <code>true</code>.
3467
3468 <dt><code>UNPACK_COLORSPACE_CONVERSION_WEBGL</code> of type <code>unsigned long</code>
3469 <dd>If set to <code>BROWSER_DEFAULT_WEBGL</code>, then the browser's default colorspace conversion
3470 is applied during subsequent <code>texImage2D</code> and <code>texSubImage2D</code> calls
3471 taking <code>HTMLImageElement</code>. The precise conversions may be specific to both the browser
3472 and file type. If set to <code>NONE</code>, no colorspace conversion is applied. The initial value
3473 is <code>BROWSER_DEFAULT_WEBGL</code>.
3474
3475 </dl>
3476
3477 <h3><a name="READS_OUTSIDE_FRAMEBUFFER">Reading Pixels Outside the Framebuffer</a></h3>
3478
3479 <p>
3480 In the WebGL API, functions which read the framebuffer
3481 (<code>copyTexImage2D</code>, <code>copyTexSubImage2D</code>, and <code>readPixels</code>) are
3482 defined to generate the RGBA value (0, 0, 0, 0) for any pixel which is outside of the bound
3483 framebuffer.
3484 </p>
3485
3486 <h3><a name="STENCIL_SEPARATE_LIMIT">Stencil Separate Mask and Reference Value</a></h3>
3487
3488 <p>
3489 In the WebGL API it is illegal to specify a different mask or reference value for front facing and
3490 back facing triangles in stencil operations. A call to <code>drawArrays</code>
3491 or <code>drawElements</code> will generate an <code>INVALID_OPERATION</code> error if:
3492
3493 <ul>
3494 <li> <code>STENCIL_WRITEMASK</code> != <code>STENCIL_BACK_WRITEMASK</code> (as specified by <code>stencilMaskSeparate</code> for the <code>mask</code> parameter associated with the FRONT and BACK values of <code>face</code>, respectively)
3495 <li> <code>STENCIL_VALUE_MASK</code> != <code>STENCIL_BACK_VALUE_MASK</code> (as specified by <code>stencilFuncSeparate</code> for the <code>mask</code> parameter associated with the FRONT and BACK values of <code>face</code>, respectively)
3496 <li> <code>STENCIL_REF</code> != <code>STENCIL_BACK_REF</code> (as specified by <code>stencilFuncSeparate</code> for the <code>ref</code> parameter associated with the FRONT and BACK values of <code>face</code>, respectively)
3497 </ul>
3498
3499 </p>
3500
3501     <h3><a name="VERTEX_STRIDE">Vertex Attribute Data Stride</a></h3>
3502
3503 <p>
3504 The WebGL API supports vertex attribute data strides up to 255 bytes. A call to
3505 <code>vertexAttribPointer</code> will generate an <code>INVALID_VALUE</code> error if the value for
3506 the stride parameter exceeds 255.
3507 </p>
3508
3509     <h3><a name="VIEWPORT_DEPTH_RANGE">Viewport Depth Range</a></h3>
3510
3511 <p>
3512 The WebGL API does not support depth ranges with where the near plane is mapped to a value greater
3513 than that of the far plane. A call to <code>depthRange</code> will generate an
3514 <code>INVALID_OPERATION</code> error if <code>zNear</code> is greater than <code>zFar</code>.
3515 </p>
3516
3517     <h3><a name="CONSTANT_COLOR_BLEND">Blending With Constant Color</a></h3>
3518
3519 <p>
3520 In the WebGL API, constant color and constant alpha cannot be used together as source and
3521 destination factors in the blend function. A call to <code>blendFunc</code> will generate an
3522 <code>INVALID_OPERATION</code> error if one of the two factors is set to <code>CONSTANT_COLOR</code>
3523 or <code>ONE_MINUS_CONSTANT_COLOR</code> and the other to <code>CONSTANT_ALPHA</code> or
3524 <code>ONE_MINUS_CONSTANT_ALPHA</code>. A call to <code>blendFuncSeparate</code> will generate an
3525 <code>INVALID_OPERATION</code> error if <code>srcRGB</code> is set to <code>CONSTANT_COLOR</code>
3526 or <code>ONE_MINUS_CONSTANT_COLOR</code> and <code>dstRGB</code> is set to <code>CONSTANT_ALPHA</code> or
3527 <code>ONE_MINUS_CONSTANT_ALPHA</code> or vice versa.
3528 </p>
3529
3530     <h3>Fixed point support</h3>
3531
3532 The WebGL API does not support the <code>GL_FIXED</code> data type.
3533
3534     <h3><a name="GLSL_CONSTRUCTS">GLSL Constructs</a></h3>
3535
3536 <p>
3537 Per <a href="#SUPPORTED_GLSL_CONSTRUCTS">Supported GLSL Constructs</a>, identifiers starting with
3538 "webgl_" and "_webgl_" are reserved for use by WebGL.
3539 </p>
3540
3541     <h3><a name="EXTENSION_QUERIES">Extension Queries</a></h3>
3542
3543 <p>
3544
3545 In the OpenGL ES 2.0 API, the available extensions are determined by calling
3546 <code>glGetString(GL_EXTENSIONS)</code>, which returns a space-separated list of extension strings.
3547 In the WebGL API, the <code>EXTENSIONS</code> enumerant has been removed.
3548 Instead, <code>getSupportedExtensions</code> must be called to determine the set of available
3549 extensions.
3550
3551 </p>
3552
3553     <h3><a name="COMPRESSED_TEXTURE_SUPPORT">Compressed Texture Support</a></h3>
3554
3555 <p>
3556     The core WebGL specification does not define any supported compressed texture formats.
3557     Therefore, in the absence of any other extensions being enabled:
3558
3559     <ul>
3560
3561       <li> The <a href="#COMPRESSEDTEXIMAGE2D"><code>compressedTexImage2D</code></a>
3562            and <a href="#COMPRESSEDTEXSUBIMAGE2D"><code>compressedTexSubImage2D</code></a> methods
3563            generate an <code>INVALID_ENUM</code> error. </li>
3564
3565       <li> Calling <a href="#GETPARAMETER"><code>getParameter</code></a> with the
3566            argument <code>COMPRESSED_TEXTURE_FORMATS</code> returns a zero-length array (of
3567            type <code>Uint32Array</code>). </li>
3568
3569     </ul>
3570 </p>
3571
3572     <h3><a name="MAX_GLSL_TOKEN_SIZE">Maximum GLSL Token Size</a></h3>
3573
3574 <p>
3575     The GLSL ES spec <a href="#refsGLES20GLSL">[GLES20GLSL]</a> does not define a limit to the
3576     length of tokens. WebGL requires support of tokens up to 256 characters in length. Shaders
3577     containing tokens longer than 256 characters must fail to compile.
3578 </p>
3579
3580     <h3><a name="CHARACTERS_OUTSIDE_VALID_SET">Characters Outside the GLSL Source Character Set</a></h3>
3581
3582 <p>
3583     The GLSL ES spec <a href="#refsGLES20GLSL">[GLES20GLSL]</a> defines the source character set for
3584     the OpenGL ES shading language to be ISO/IEC 646:1991, commonly called ASCII <a href="#refsASCII">[ASCII]</a>. 
3585     If a string containing a character not in this set is passed to any of the shader-related entry
3586     points <code>bindAttribLocation</code>, <code>getAttribLocation</code>, <code>getUniformLocation</code>,
3587     or <code>shaderSource</code>, an <code>INVALID_VALUE</code> error will be generated. The exception is
3588     that any character allowed in an HTML DOMString <a href="#refsDOMSTRING">[DOMSTRING]</a> may be used
3589     in GLSL comments. Such use must not generate an error.
3590 </p>
3591
3592 <div class="note">        
3593     <p>
3594         Some GLSL implementations disallow characters outside the ASCII range, even in comments. The
3595         WebGL implementation needs to prevent errors in such cases. The recommended technique is to
3596         preprocess the GLSL string, removing all comments, but maintaining the line numbering for
3597         debugging purposes by inserting newline characters as needed. 
3598     </p>
3599 </div>
3600     
3601     <h3><a name="MAX_STRUCT_NESTING">Maximum Nesting of Structures in GLSL Shaders</a></h3>
3602
3603 <p>
3604     WebGL imposes a limit on the nesting of structures in GLSL shaders. Nesting occurs when a field
3605     in a struct refers to another struct type; the GLSL ES
3606     spec <a href="#refsGLES20GLSL">[GLES20GLSL]</a> forbids embedded structure definitions. The
3607     fields in a top-level struct definition have a nesting level of 1.
3608 </p>
3609 <p>
3610     WebGL requires support of a structure nesting level of 4. Shaders containing structures nested
3611     more than 4 levels deep must fail to compile.
3612 </p>
3613
3614     <h3><a name="MAX_LOCATION_LENGTHS">Maximum Uniform and Attribute Location Lengths</a></h3>
3615
3616 <p>
3617     WebGL imposes a limit of 256 characters on the lengths of uniform and attribute locations.
3618 </p>
3619
3620     <h3><a name="STRING_LENGTH_QUERIES">String Length Queries</a></h3>
3621
3622 <p>
3623     In the WebGL API, the enumerants <code>INFO_LOG_LENGTH</code>, <code>SHADER_SOURCE_LENGTH</code>,
3624     <code>ACTIVE_UNIFORM_MAX_LENGTH</code>, and <code>ACTIVE_ATTRIBUTE_MAX_LENGTH</code> have been removed. In
3625     the OpenGL ES 2.0 API, these enumerants are needed to determine the size of buffers passed to calls
3626     like <code>glGetActiveAttrib</code>. In the WebGL API, the analogous calls (<code>getActiveAttrib</code>,
3627     <code>getActiveUniform</code>, <code>getProgramInfoLog</code>, <code>getShaderInfoLog</code>, and
3628     <code>getShaderSource</code>) all return <code>DOMString</code>.
3629 </p>
3630
3631 <h3>Texture Type in TexSubImage2D Calls</h3>
3632
3633 <p>
3634     In the WebGL API, the <em>type</em> argument passed to <code>texSubImage2D</code> must match the
3635     type used to originally define the texture object (i.e., using <code>texImage2D</code>).
3636 </p>
3637
3638     <h3><a name="PACKING_RESTRICTIONS">Packing Restrictions for Uniforms and Varyings</a></h3>
3639
3640 <p>
3641     The OpenGL ES Shading Language, Version 1.00 <a href="#refsGLES20GLSL">[GLES20GLSL]</a>,
3642     Appendix A, Section 7 "Counting of Varyings and Uniforms" defines a conservative algorithm for
3643     computing the storage required for all of the uniform and varying variables in a shader. The
3644     GLSL ES specification requires that if the packing algorithm defined in Appendix A succeeds,
3645     then the shader must succeed compilation on the target platform. The WebGL API further requires
3646     that if the packing algorithm fails either for the uniform variables of a shader or for the
3647     varying variables of a program, compilation or linking must fail.
3648 </p>
3649 <p>
3650     Instead of using a fixed size grid of registers, the number of rows in the target architecture
3651     is determined in the following ways:
3652
3653     <ul>
3654     <li> when counting uniform variables in a vertex shader: <code>getParameter(MAX_VERTEX_UNIFORM_VECTORS)</code>
3655     <li> when counting uniform variables in a fragment shader: <code>getParameter(MAX_FRAGMENT_UNIFORM_VECTORS)</code>
3656     <li> when counting varying variables: <code>getParameter(MAX_VARYING_VECTORS)</code>
3657     </ul>
3658 </p>
3659
3660 <h3>Feedback Loops Between Textures and the Framebuffer</h3>
3661 <p>
3662     In the OpenGL ES 2.0 API, it's possible to make calls that both write to and read from
3663     the same texture, creating a feedback loop.
3664     It specifies that where these feedback loops exist, undefined behavior results.
3665 </p>
3666 <p>
3667     In the WebGL API, such operations that would cause such feedback loops (by the definitions
3668     in the OpenGL ES 2.0 spec) will instead generate an <code>INVALID_OPERATION</code> error.
3669 </p>
3670
3671 <h3><a name="READING_FROM_MISSING_ATTACHMENT">Reading From a Missing Attachment</a></h3>
3672 <p>
3673     In the OpenGL ES 2.0 API, it is not specified what happens when a command tries to source
3674     data from a missing attachment, such as ReadPixels of color data from a complete framebuffer
3675     that does not have a color attachment.
3676 </p>
3677 <p>
3678     In the WebGL API, such operations that require data from an attachment that is missing will
3679     generate an <code>INVALID_OPERATION</code> error. This applies to the following functions:
3680     
3681     <ul>
3682     <li> <code>copyTexImage2D</code>
3683     <li> <code>copyTexSubImage2D</code>
3684     <li> <code>readPixels</code>
3685     </ul>
3686 </p>
3687
3688 <h3><a name="NAN_LINE_WIDTH">NaN Line Width</a></h3>
3689 <p>
3690     In the WebGL API, if the <code>width</code> parameter passed to <code>lineWidth</code> is set
3691     to NaN, an <code>INVALID_VALUE</code> error is generated and the line width is not changed.
3692 </p>
3693
3694 <h3><a name="ATTRIBUTE_ALIASING">Attribute Aliasing</a></h3>
3695 <p>
3696     It is possible for an application to bind more than one attribute name to the
3697     same location. This is referred to as aliasing. When more than one attributes that
3698     are aliased to the same location are active in the executable program,
3699     <code>linkProgram</code> should fail.
3700 </p>
3701
3702 <!-- ======================================================================================================= -->
3703
3704     <h2>References</h2>
3705     
3706     <h3>Normative references</h3>
3707     <dl>
3708     
3709         <dt id="refsCANVAS">[CANVAS]</dt>
3710         <dd><cite><a href="http://www.w3.org/TR/html5/the-canvas-element.html">
3711             HTML5: The Canvas Element</a></cite>,
3712             World Wide Web Consortium (W3C).
3713         </dd>
3714
3715         <dt id="refsCANVASCONTEXTS">[CANVASCONTEXTS]</dt>
3716         <dd><cite><a href="http://wiki.whatwg.org/wiki/CanvasContexts">
3717             Canvas Context Registry</a></cite>,
3718             WHATWG.
3719         </dd>
3720         <dt id="refsTYPEDARRAYS">[TYPEDARRAYS]</dt>
3721         <dd><cite><a href="http://www.khronos.org/registry/typedarray/specs/latest/">
3722             Typed Array Specification: Editor's Draft</a></cite>,
3723             V. Vukicevic, K. Russell, May 2010.
3724         </dd>
3725         <dt id="refsGLES20">[GLES20]</dt>
3726         <dd><cite><a href="http://www.khronos.org/registry/gles/specs/2.0/es_full_spec_2.0.25.pdf">
3727             OpenGL&reg; ES Common Profile Specification Version 2.0.25</a></cite>, 
3728             A. Munshi, J. Leech, November 2010.
3729         </dd>
3730         <dt id="refsGLES20GLSL">[GLES20GLSL]</dt>
3731         <dd><cite><a href="http://www.khronos.org/registry/gles/specs/2.0/GLSL_ES_Specification_1.0.17.pdf">
3732             The OpenGL&reg; ES Shading Language Version 1.00</a></cite>, 
3733             R. Simpson, May 2009.
3734         </dd>
3735         <dt id="refsREGISTRY">[REGISTRY]</dt>
3736         <dd><cite><a href="http://www.khronos.org/registry/webgl/extensions/">
3737             WebGL Extension Registry</a></cite>
3738         </dd>
3739         <dt id="refsRFC2119">[RFC2119]</dt>
3740         <dd><cite><a href="http://www.ietf.org/rfc/rfc2119.txt">
3741             Key words for use in RFCs to Indicate Requirement Levels</a></cite>,
3742             S. Bradner. IETF, March 1997.
3743         </dd>
3744         <dt id="refsCSS">[CSS]</dt>
3745         <dd><cite><a href="http://www.w3.org/TR/CSS21/">
3746             Cascading Style Sheets Level 2 Revision 1 (CSS 2.1) Specification</a></cite>,
3747             B. Bos, T. Celik, I. Hickson, H. W. Lie, June 2011.
3748         </dd>
3749         <dt id="refsCORS">[CORS]</dt>
3750         <dd><cite><a href="http://www.w3.org/TR/cors/">
3751             Cross-Origin Resource Sharing</a></cite>,
3752             A. van Kesteren, July 2010.
3753         </dd>
3754         <dt id="refsDOM4">[DOM4]</dt>
3755         <dd><cite><a href="http://www.w3.org/TR/domcore/">
3756             DOM4</a></cite>,
3757             A. van Kesteren, A. Gregor, Ms2ger.
3758         </dd>
3759         <dt id="refsDOM3EVENTS">[DOM3EVENTS]</dt>
3760         <dd><cite><a href="http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html">
3761             Document Object Model (DOM) Level 3 Events Specification</a></cite>,
3762             Doug Schepers and Jacob Rossi. W3C.
3763         </dd>
3764         <dt id="refsHTML">[HTML]</dt>
3765         <dd><cite><a href="http://www.whatwg.org/specs/web-apps/current-work/multipage/">
3766             HTML</a></cite>,
3767             I. Hickson, June 2011.
3768         </dd>
3769         <dt id="refsWEBIDL">[WEBIDL]</dt>
3770         <dd><cite><a href="http://dev.w3.org/2006/webapi/WebIDL/">
3771             Web IDL: W3C Editor’s Draft</a></cite>, 
3772             C. McCormack.
3773         </dd>
3774         <dt id="refsASCII">[ASCII]</dt>
3775         <dd><cite>International Standard ISO/IEC 646:1991. Information technology - 
3776             ISO 7-bit coded character set for information interchange</cite>
3777         </dd>
3778         <dt id="refsDOMSTRING">[DOMSTRING]</dt>
3779         <dd><cite><a href="http://www.w3.org/TR/DOM-Level-2-Core/core.html#DOMString">
3780             Document Object Model Core: The DOMString type</a></cite>,
3781             World Wide Web Consortium (W3C).
3782         </dd>
3783     </dl>
3784
3785     <h3>Other references</h3>
3786
3787 <!-- ======================================================================================================= -->
3788     
3789     <h2>Acknowledgments</h2>
3790     <p>This specification is produced by the Khronos WebGL Working Group.</p>
3791     
3792     <p>
3793         Special thanks to: Arun Ranganathan (Mozilla), Chris Marrin (Apple), Jon Leech, Kenneth
3794         Russell (Google), Kenneth Waters (Google), Mark Callow (HI), Mark Steele (Mozilla), Oliver
3795         Hunt (Apple), Tim Johansson (Opera), Vangelis Kokkevis (Google), Vladimir Vukicevic
3796         (Mozilla), Gregg Tavares (Google)
3797     </p>
3798     <p>
3799         Additional thanks to: Alan Hudson (Yumetech), Benoit Jacob (Mozilla), Bill Licea Kane (AMD),
3800         Boris Zbarsky (Mozilla), Cameron McCormack (Mozilla), Cedric Vivier (Zegami), Dan Gessel
3801         (Apple), David Ligon (Qualcomm), David Sheets (Ashima Arts), Glenn Maynard, Greg Roth
3802         (Nvidia), Jacob Strom  (Ericsson), Jeff Gilbert (Mozilla), Kari Pulli (Nokia), Teddie Stenvi
3803         (ST-Ericsson), Neil Trevett (Nvidia), Per Wennersten (Ericsson), Per-Erik Brodin (Ericsson),
3804         Shiki Okasaka (Google), Tom Olson (ARM), Zhengrong Yao (Ericsson), and the members of the
3805         Khronos WebGL Working Group.
3806     </p>
3807
3808 </body>
3809 </html>