Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / webidl / WebGLRenderingContext.webidl
blob00585a06bf66bdd0d96a17b3b52d3f56f88095a2
1 /* -*- Mode: IDL; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4  * You can obtain one at http://mozilla.org/MPL/2.0/.
5  *
6  * The origin of this IDL file is
7  * https://www.khronos.org/registry/webgl/specs/latest/webgl.idl
8  *
9  * Copyright © 2012 Khronos Group
10  */
12 // WebGL IDL definitions scraped from the Khronos specification:
13 // https://www.khronos.org/registry/webgl/specs/latest/
15 // This IDL depends on the typed array specification defined at:
16 // https://www.khronos.org/registry/typedarray/specs/latest/typedarrays.idl
18 typedef unsigned long  GLenum;
19 typedef boolean        GLboolean;
20 typedef unsigned long  GLbitfield;
21 typedef byte           GLbyte;         /* 'byte' should be a signed 8 bit type. */
22 typedef short          GLshort;
23 typedef long           GLint;
24 typedef long           GLsizei;
25 typedef long long      GLintptr;
26 typedef long long      GLsizeiptr;
27 // Ideally the typedef below would use 'unsigned byte', but that doesn't currently exist in Web IDL.
28 typedef octet          GLubyte;        /* 'octet' should be an unsigned 8 bit type. */
29 typedef unsigned short GLushort;
30 typedef unsigned long  GLuint;
31 typedef unrestricted float GLfloat;
32 typedef unrestricted float GLclampf;
33 typedef unsigned long long GLuint64EXT;
35 // The power preference settings are documented in the WebGLContextAttributes
36 // section of the specification.
37 enum WebGLPowerPreference { "default", "low-power", "high-performance" };
38 enum PredefinedColorSpace { "srgb", "display-p3" };
40 [GenerateInit]
41 dictionary WebGLContextAttributes {
42     // We deviate from the spec for alpha and antialias:
43     // * alpha: Historically, we might use rgb565 instead of rgb(x)8, for
44     //          memory bandwidth optimization.
45     // * antialias: On Android, DPI is high and mem-bandwidth is low, so we
46     //              default to antialias:false if it's not set.
47     GLboolean alpha; // = true; // Default is controlled by webgl.default-no-alpha.
48     GLboolean depth = true;
49     GLboolean stencil = false;
50     GLboolean antialias; // = true; // Default is controlled by webgl.default-antialias.
51     GLboolean premultipliedAlpha = true;
52     GLboolean preserveDrawingBuffer = false;
53     GLboolean failIfMajorPerformanceCaveat = false;
54     WebGLPowerPreference powerPreference = "default";
56     // We are experimenting here, though this should be close to where we end up.
57     [Pref="webgl.colorspaces.prototype"]
58     PredefinedColorSpace colorSpace; // = "srgb"; Default is gfx::ColorSpace2::UNKNOWN for now.
61 [Exposed=(Window,Worker),
62  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
63 interface WebGLBuffer {
66 [Exposed=(Window,Worker),
67  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
68 interface WebGLFramebuffer {
71 [Exposed=(Window,Worker),
72  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
73 interface WebGLProgram {
76 [Exposed=(Window,Worker),
77  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
78 interface WebGLRenderbuffer {
81 [Exposed=(Window,Worker),
82  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
83 interface WebGLShader {
86 [Exposed=(Window,Worker),
87  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
88 interface WebGLTexture {
91 [Exposed=(Window,Worker),
92  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
93 interface WebGLUniformLocation {
96 [Exposed=(Window,Worker),
97  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
98 interface WebGLVertexArrayObject {
101 [Exposed=(Window,Worker),
102  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
103 interface WebGLActiveInfo {
104     readonly attribute GLint size;
105     readonly attribute GLenum type;
106     readonly attribute DOMString name;
109 [Exposed=(Window,Worker),
110  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
111 interface WebGLShaderPrecisionFormat {
112     readonly attribute GLint rangeMin;
113     readonly attribute GLint rangeMax;
114     readonly attribute GLint precision;
117 typedef ([AllowShared] Float32Array or sequence<GLfloat>) Float32List;
118 typedef ([AllowShared] Int32Array or sequence<GLint>) Int32List;
120 // Shared mixin for the things that WebGLRenderingContext and
121 // WebGL2RenderingContext have in common.  This doesn't have all the things they
122 // have in common, because we don't support splitting multiple overloads of the
123 // same method across separate interfaces and pulling them in with "includes".
124 [Exposed=(Window, Worker)]
125 interface mixin WebGLRenderingContextBase {
126     /* ClearBufferMask */
127     const GLenum DEPTH_BUFFER_BIT               = 0x00000100;
128     const GLenum STENCIL_BUFFER_BIT             = 0x00000400;
129     const GLenum COLOR_BUFFER_BIT               = 0x00004000;
131     /* BeginMode */
132     const GLenum POINTS                         = 0x0000;
133     const GLenum LINES                          = 0x0001;
134     const GLenum LINE_LOOP                      = 0x0002;
135     const GLenum LINE_STRIP                     = 0x0003;
136     const GLenum TRIANGLES                      = 0x0004;
137     const GLenum TRIANGLE_STRIP                 = 0x0005;
138     const GLenum TRIANGLE_FAN                   = 0x0006;
140     /* AlphaFunction (not supported in ES20) */
141     /*      NEVER */
142     /*      LESS */
143     /*      EQUAL */
144     /*      LEQUAL */
145     /*      GREATER */
146     /*      NOTEQUAL */
147     /*      GEQUAL */
148     /*      ALWAYS */
150     /* BlendingFactorDest */
151     const GLenum ZERO                           = 0;
152     const GLenum ONE                            = 1;
153     const GLenum SRC_COLOR                      = 0x0300;
154     const GLenum ONE_MINUS_SRC_COLOR            = 0x0301;
155     const GLenum SRC_ALPHA                      = 0x0302;
156     const GLenum ONE_MINUS_SRC_ALPHA            = 0x0303;
157     const GLenum DST_ALPHA                      = 0x0304;
158     const GLenum ONE_MINUS_DST_ALPHA            = 0x0305;
160     /* BlendingFactorSrc */
161     /*      ZERO */
162     /*      ONE */
163     const GLenum DST_COLOR                      = 0x0306;
164     const GLenum ONE_MINUS_DST_COLOR            = 0x0307;
165     const GLenum SRC_ALPHA_SATURATE             = 0x0308;
166     /*      SRC_ALPHA */
167     /*      ONE_MINUS_SRC_ALPHA */
168     /*      DST_ALPHA */
169     /*      ONE_MINUS_DST_ALPHA */
171     /* BlendEquationSeparate */
172     const GLenum FUNC_ADD                       = 0x8006;
173     const GLenum BLEND_EQUATION                 = 0x8009;
174     const GLenum BLEND_EQUATION_RGB             = 0x8009;   /* same as BLEND_EQUATION */
175     const GLenum BLEND_EQUATION_ALPHA           = 0x883D;
177     /* BlendSubtract */
178     const GLenum FUNC_SUBTRACT                  = 0x800A;
179     const GLenum FUNC_REVERSE_SUBTRACT          = 0x800B;
181     /* Separate Blend Functions */
182     const GLenum BLEND_DST_RGB                  = 0x80C8;
183     const GLenum BLEND_SRC_RGB                  = 0x80C9;
184     const GLenum BLEND_DST_ALPHA                = 0x80CA;
185     const GLenum BLEND_SRC_ALPHA                = 0x80CB;
186     const GLenum CONSTANT_COLOR                 = 0x8001;
187     const GLenum ONE_MINUS_CONSTANT_COLOR       = 0x8002;
188     const GLenum CONSTANT_ALPHA                 = 0x8003;
189     const GLenum ONE_MINUS_CONSTANT_ALPHA       = 0x8004;
190     const GLenum BLEND_COLOR                    = 0x8005;
192     /* Buffer Objects */
193     const GLenum ARRAY_BUFFER                   = 0x8892;
194     const GLenum ELEMENT_ARRAY_BUFFER           = 0x8893;
195     const GLenum ARRAY_BUFFER_BINDING           = 0x8894;
196     const GLenum ELEMENT_ARRAY_BUFFER_BINDING   = 0x8895;
198     const GLenum STREAM_DRAW                    = 0x88E0;
199     const GLenum STATIC_DRAW                    = 0x88E4;
200     const GLenum DYNAMIC_DRAW                   = 0x88E8;
202     const GLenum BUFFER_SIZE                    = 0x8764;
203     const GLenum BUFFER_USAGE                   = 0x8765;
205     const GLenum CURRENT_VERTEX_ATTRIB          = 0x8626;
207     /* CullFaceMode */
208     const GLenum FRONT                          = 0x0404;
209     const GLenum BACK                           = 0x0405;
210     const GLenum FRONT_AND_BACK                 = 0x0408;
212     /* DepthFunction */
213     /*      NEVER */
214     /*      LESS */
215     /*      EQUAL */
216     /*      LEQUAL */
217     /*      GREATER */
218     /*      NOTEQUAL */
219     /*      GEQUAL */
220     /*      ALWAYS */
222     /* EnableCap */
223     /* TEXTURE_2D */
224     const GLenum CULL_FACE                      = 0x0B44;
225     const GLenum BLEND                          = 0x0BE2;
226     const GLenum DITHER                         = 0x0BD0;
227     const GLenum STENCIL_TEST                   = 0x0B90;
228     const GLenum DEPTH_TEST                     = 0x0B71;
229     const GLenum SCISSOR_TEST                   = 0x0C11;
230     const GLenum POLYGON_OFFSET_FILL            = 0x8037;
231     const GLenum SAMPLE_ALPHA_TO_COVERAGE       = 0x809E;
232     const GLenum SAMPLE_COVERAGE                = 0x80A0;
234     /* ErrorCode */
235     const GLenum NO_ERROR                       = 0;
236     const GLenum INVALID_ENUM                   = 0x0500;
237     const GLenum INVALID_VALUE                  = 0x0501;
238     const GLenum INVALID_OPERATION              = 0x0502;
239     const GLenum OUT_OF_MEMORY                  = 0x0505;
241     /* FrontFaceDirection */
242     const GLenum CW                             = 0x0900;
243     const GLenum CCW                            = 0x0901;
245     /* GetPName */
246     const GLenum LINE_WIDTH                     = 0x0B21;
247     const GLenum ALIASED_POINT_SIZE_RANGE       = 0x846D;
248     const GLenum ALIASED_LINE_WIDTH_RANGE       = 0x846E;
249     const GLenum CULL_FACE_MODE                 = 0x0B45;
250     const GLenum FRONT_FACE                     = 0x0B46;
251     const GLenum DEPTH_RANGE                    = 0x0B70;
252     const GLenum DEPTH_WRITEMASK                = 0x0B72;
253     const GLenum DEPTH_CLEAR_VALUE              = 0x0B73;
254     const GLenum DEPTH_FUNC                     = 0x0B74;
255     const GLenum STENCIL_CLEAR_VALUE            = 0x0B91;
256     const GLenum STENCIL_FUNC                   = 0x0B92;
257     const GLenum STENCIL_FAIL                   = 0x0B94;
258     const GLenum STENCIL_PASS_DEPTH_FAIL        = 0x0B95;
259     const GLenum STENCIL_PASS_DEPTH_PASS        = 0x0B96;
260     const GLenum STENCIL_REF                    = 0x0B97;
261     const GLenum STENCIL_VALUE_MASK             = 0x0B93;
262     const GLenum STENCIL_WRITEMASK              = 0x0B98;
263     const GLenum STENCIL_BACK_FUNC              = 0x8800;
264     const GLenum STENCIL_BACK_FAIL              = 0x8801;
265     const GLenum STENCIL_BACK_PASS_DEPTH_FAIL   = 0x8802;
266     const GLenum STENCIL_BACK_PASS_DEPTH_PASS   = 0x8803;
267     const GLenum STENCIL_BACK_REF               = 0x8CA3;
268     const GLenum STENCIL_BACK_VALUE_MASK        = 0x8CA4;
269     const GLenum STENCIL_BACK_WRITEMASK         = 0x8CA5;
270     const GLenum VIEWPORT                       = 0x0BA2;
271     const GLenum SCISSOR_BOX                    = 0x0C10;
272     /*      SCISSOR_TEST */
273     const GLenum COLOR_CLEAR_VALUE              = 0x0C22;
274     const GLenum COLOR_WRITEMASK                = 0x0C23;
275     const GLenum UNPACK_ALIGNMENT               = 0x0CF5;
276     const GLenum PACK_ALIGNMENT                 = 0x0D05;
277     const GLenum MAX_TEXTURE_SIZE               = 0x0D33;
278     const GLenum MAX_VIEWPORT_DIMS              = 0x0D3A;
279     const GLenum SUBPIXEL_BITS                  = 0x0D50;
280     const GLenum RED_BITS                       = 0x0D52;
281     const GLenum GREEN_BITS                     = 0x0D53;
282     const GLenum BLUE_BITS                      = 0x0D54;
283     const GLenum ALPHA_BITS                     = 0x0D55;
284     const GLenum DEPTH_BITS                     = 0x0D56;
285     const GLenum STENCIL_BITS                   = 0x0D57;
286     const GLenum POLYGON_OFFSET_UNITS           = 0x2A00;
287     /*      POLYGON_OFFSET_FILL */
288     const GLenum POLYGON_OFFSET_FACTOR          = 0x8038;
289     const GLenum TEXTURE_BINDING_2D             = 0x8069;
290     const GLenum SAMPLE_BUFFERS                 = 0x80A8;
291     const GLenum SAMPLES                        = 0x80A9;
292     const GLenum SAMPLE_COVERAGE_VALUE          = 0x80AA;
293     const GLenum SAMPLE_COVERAGE_INVERT         = 0x80AB;
295     /* GetTextureParameter */
296     /*      TEXTURE_MAG_FILTER */
297     /*      TEXTURE_MIN_FILTER */
298     /*      TEXTURE_WRAP_S */
299     /*      TEXTURE_WRAP_T */
301     const GLenum COMPRESSED_TEXTURE_FORMATS     = 0x86A3;
303     /* HintMode */
304     const GLenum DONT_CARE                      = 0x1100;
305     const GLenum FASTEST                        = 0x1101;
306     const GLenum NICEST                         = 0x1102;
308     /* HintTarget */
309     const GLenum GENERATE_MIPMAP_HINT            = 0x8192;
311     /* DataType */
312     const GLenum BYTE                           = 0x1400;
313     const GLenum UNSIGNED_BYTE                  = 0x1401;
314     const GLenum SHORT                          = 0x1402;
315     const GLenum UNSIGNED_SHORT                 = 0x1403;
316     const GLenum INT                            = 0x1404;
317     const GLenum UNSIGNED_INT                   = 0x1405;
318     const GLenum FLOAT                          = 0x1406;
320     /* PixelFormat */
321     const GLenum DEPTH_COMPONENT                = 0x1902;
322     const GLenum ALPHA                          = 0x1906;
323     const GLenum RGB                            = 0x1907;
324     const GLenum RGBA                           = 0x1908;
325     const GLenum LUMINANCE                      = 0x1909;
326     const GLenum LUMINANCE_ALPHA                = 0x190A;
328     /* PixelType */
329     /*      UNSIGNED_BYTE */
330     const GLenum UNSIGNED_SHORT_4_4_4_4         = 0x8033;
331     const GLenum UNSIGNED_SHORT_5_5_5_1         = 0x8034;
332     const GLenum UNSIGNED_SHORT_5_6_5           = 0x8363;
334     /* Shaders */
335     const GLenum FRAGMENT_SHADER                  = 0x8B30;
336     const GLenum VERTEX_SHADER                    = 0x8B31;
337     const GLenum MAX_VERTEX_ATTRIBS               = 0x8869;
338     const GLenum MAX_VERTEX_UNIFORM_VECTORS       = 0x8DFB;
339     const GLenum MAX_VARYING_VECTORS              = 0x8DFC;
340     const GLenum MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D;
341     const GLenum MAX_VERTEX_TEXTURE_IMAGE_UNITS   = 0x8B4C;
342     const GLenum MAX_TEXTURE_IMAGE_UNITS          = 0x8872;
343     const GLenum MAX_FRAGMENT_UNIFORM_VECTORS     = 0x8DFD;
344     const GLenum SHADER_TYPE                      = 0x8B4F;
345     const GLenum DELETE_STATUS                    = 0x8B80;
346     const GLenum LINK_STATUS                      = 0x8B82;
347     const GLenum VALIDATE_STATUS                  = 0x8B83;
348     const GLenum ATTACHED_SHADERS                 = 0x8B85;
349     const GLenum ACTIVE_UNIFORMS                  = 0x8B86;
350     const GLenum ACTIVE_ATTRIBUTES                = 0x8B89;
351     const GLenum SHADING_LANGUAGE_VERSION         = 0x8B8C;
352     const GLenum CURRENT_PROGRAM                  = 0x8B8D;
354     /* StencilFunction */
355     const GLenum NEVER                          = 0x0200;
356     const GLenum LESS                           = 0x0201;
357     const GLenum EQUAL                          = 0x0202;
358     const GLenum LEQUAL                         = 0x0203;
359     const GLenum GREATER                        = 0x0204;
360     const GLenum NOTEQUAL                       = 0x0205;
361     const GLenum GEQUAL                         = 0x0206;
362     const GLenum ALWAYS                         = 0x0207;
364     /* StencilOp */
365     /*      ZERO */
366     const GLenum KEEP                           = 0x1E00;
367     const GLenum REPLACE                        = 0x1E01;
368     const GLenum INCR                           = 0x1E02;
369     const GLenum DECR                           = 0x1E03;
370     const GLenum INVERT                         = 0x150A;
371     const GLenum INCR_WRAP                      = 0x8507;
372     const GLenum DECR_WRAP                      = 0x8508;
374     /* StringName */
375     const GLenum VENDOR                         = 0x1F00;
376     const GLenum RENDERER                       = 0x1F01;
377     const GLenum VERSION                        = 0x1F02;
379     /* TextureMagFilter */
380     const GLenum NEAREST                        = 0x2600;
381     const GLenum LINEAR                         = 0x2601;
383     /* TextureMinFilter */
384     /*      NEAREST */
385     /*      LINEAR */
386     const GLenum NEAREST_MIPMAP_NEAREST         = 0x2700;
387     const GLenum LINEAR_MIPMAP_NEAREST          = 0x2701;
388     const GLenum NEAREST_MIPMAP_LINEAR          = 0x2702;
389     const GLenum LINEAR_MIPMAP_LINEAR           = 0x2703;
391     /* TextureParameterName */
392     const GLenum TEXTURE_MAG_FILTER             = 0x2800;
393     const GLenum TEXTURE_MIN_FILTER             = 0x2801;
394     const GLenum TEXTURE_WRAP_S                 = 0x2802;
395     const GLenum TEXTURE_WRAP_T                 = 0x2803;
397     /* TextureTarget */
398     const GLenum TEXTURE_2D                     = 0x0DE1;
399     const GLenum TEXTURE                        = 0x1702;
401     const GLenum TEXTURE_CUBE_MAP               = 0x8513;
402     const GLenum TEXTURE_BINDING_CUBE_MAP       = 0x8514;
403     const GLenum TEXTURE_CUBE_MAP_POSITIVE_X    = 0x8515;
404     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_X    = 0x8516;
405     const GLenum TEXTURE_CUBE_MAP_POSITIVE_Y    = 0x8517;
406     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Y    = 0x8518;
407     const GLenum TEXTURE_CUBE_MAP_POSITIVE_Z    = 0x8519;
408     const GLenum TEXTURE_CUBE_MAP_NEGATIVE_Z    = 0x851A;
409     const GLenum MAX_CUBE_MAP_TEXTURE_SIZE      = 0x851C;
411     /* TextureUnit */
412     const GLenum TEXTURE0                       = 0x84C0;
413     const GLenum TEXTURE1                       = 0x84C1;
414     const GLenum TEXTURE2                       = 0x84C2;
415     const GLenum TEXTURE3                       = 0x84C3;
416     const GLenum TEXTURE4                       = 0x84C4;
417     const GLenum TEXTURE5                       = 0x84C5;
418     const GLenum TEXTURE6                       = 0x84C6;
419     const GLenum TEXTURE7                       = 0x84C7;
420     const GLenum TEXTURE8                       = 0x84C8;
421     const GLenum TEXTURE9                       = 0x84C9;
422     const GLenum TEXTURE10                      = 0x84CA;
423     const GLenum TEXTURE11                      = 0x84CB;
424     const GLenum TEXTURE12                      = 0x84CC;
425     const GLenum TEXTURE13                      = 0x84CD;
426     const GLenum TEXTURE14                      = 0x84CE;
427     const GLenum TEXTURE15                      = 0x84CF;
428     const GLenum TEXTURE16                      = 0x84D0;
429     const GLenum TEXTURE17                      = 0x84D1;
430     const GLenum TEXTURE18                      = 0x84D2;
431     const GLenum TEXTURE19                      = 0x84D3;
432     const GLenum TEXTURE20                      = 0x84D4;
433     const GLenum TEXTURE21                      = 0x84D5;
434     const GLenum TEXTURE22                      = 0x84D6;
435     const GLenum TEXTURE23                      = 0x84D7;
436     const GLenum TEXTURE24                      = 0x84D8;
437     const GLenum TEXTURE25                      = 0x84D9;
438     const GLenum TEXTURE26                      = 0x84DA;
439     const GLenum TEXTURE27                      = 0x84DB;
440     const GLenum TEXTURE28                      = 0x84DC;
441     const GLenum TEXTURE29                      = 0x84DD;
442     const GLenum TEXTURE30                      = 0x84DE;
443     const GLenum TEXTURE31                      = 0x84DF;
444     const GLenum ACTIVE_TEXTURE                 = 0x84E0;
446     /* TextureWrapMode */
447     const GLenum REPEAT                         = 0x2901;
448     const GLenum CLAMP_TO_EDGE                  = 0x812F;
449     const GLenum MIRRORED_REPEAT                = 0x8370;
451     /* Uniform Types */
452     const GLenum FLOAT_VEC2                     = 0x8B50;
453     const GLenum FLOAT_VEC3                     = 0x8B51;
454     const GLenum FLOAT_VEC4                     = 0x8B52;
455     const GLenum INT_VEC2                       = 0x8B53;
456     const GLenum INT_VEC3                       = 0x8B54;
457     const GLenum INT_VEC4                       = 0x8B55;
458     const GLenum BOOL                           = 0x8B56;
459     const GLenum BOOL_VEC2                      = 0x8B57;
460     const GLenum BOOL_VEC3                      = 0x8B58;
461     const GLenum BOOL_VEC4                      = 0x8B59;
462     const GLenum FLOAT_MAT2                     = 0x8B5A;
463     const GLenum FLOAT_MAT3                     = 0x8B5B;
464     const GLenum FLOAT_MAT4                     = 0x8B5C;
465     const GLenum SAMPLER_2D                     = 0x8B5E;
466     const GLenum SAMPLER_CUBE                   = 0x8B60;
468     /* Vertex Arrays */
469     const GLenum VERTEX_ATTRIB_ARRAY_ENABLED        = 0x8622;
470     const GLenum VERTEX_ATTRIB_ARRAY_SIZE           = 0x8623;
471     const GLenum VERTEX_ATTRIB_ARRAY_STRIDE         = 0x8624;
472     const GLenum VERTEX_ATTRIB_ARRAY_TYPE           = 0x8625;
473     const GLenum VERTEX_ATTRIB_ARRAY_NORMALIZED     = 0x886A;
474     const GLenum VERTEX_ATTRIB_ARRAY_POINTER        = 0x8645;
475     const GLenum VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F;
477     /* Read Format */
478     const GLenum IMPLEMENTATION_COLOR_READ_TYPE   = 0x8B9A;
479     const GLenum IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B;
481     /* Shader Source */
482     const GLenum COMPILE_STATUS                 = 0x8B81;
484     /* Shader Precision-Specified Types */
485     const GLenum LOW_FLOAT                      = 0x8DF0;
486     const GLenum MEDIUM_FLOAT                   = 0x8DF1;
487     const GLenum HIGH_FLOAT                     = 0x8DF2;
488     const GLenum LOW_INT                        = 0x8DF3;
489     const GLenum MEDIUM_INT                     = 0x8DF4;
490     const GLenum HIGH_INT                       = 0x8DF5;
492     /* Framebuffer Object. */
493     const GLenum FRAMEBUFFER                    = 0x8D40;
494     const GLenum RENDERBUFFER                   = 0x8D41;
496     const GLenum RGBA4                          = 0x8056;
497     const GLenum RGB5_A1                        = 0x8057;
498     const GLenum RGB565                         = 0x8D62;
499     const GLenum DEPTH_COMPONENT16              = 0x81A5;
500     const GLenum STENCIL_INDEX8                 = 0x8D48;
501     const GLenum DEPTH_STENCIL                  = 0x84F9;
503     const GLenum RENDERBUFFER_WIDTH             = 0x8D42;
504     const GLenum RENDERBUFFER_HEIGHT            = 0x8D43;
505     const GLenum RENDERBUFFER_INTERNAL_FORMAT   = 0x8D44;
506     const GLenum RENDERBUFFER_RED_SIZE          = 0x8D50;
507     const GLenum RENDERBUFFER_GREEN_SIZE        = 0x8D51;
508     const GLenum RENDERBUFFER_BLUE_SIZE         = 0x8D52;
509     const GLenum RENDERBUFFER_ALPHA_SIZE        = 0x8D53;
510     const GLenum RENDERBUFFER_DEPTH_SIZE        = 0x8D54;
511     const GLenum RENDERBUFFER_STENCIL_SIZE      = 0x8D55;
513     const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE           = 0x8CD0;
514     const GLenum FRAMEBUFFER_ATTACHMENT_OBJECT_NAME           = 0x8CD1;
515     const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL         = 0x8CD2;
516     const GLenum FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3;
518     const GLenum COLOR_ATTACHMENT0              = 0x8CE0;
519     const GLenum DEPTH_ATTACHMENT               = 0x8D00;
520     const GLenum STENCIL_ATTACHMENT             = 0x8D20;
521     const GLenum DEPTH_STENCIL_ATTACHMENT       = 0x821A;
523     const GLenum NONE                           = 0;
525     const GLenum FRAMEBUFFER_COMPLETE                      = 0x8CD5;
526     const GLenum FRAMEBUFFER_INCOMPLETE_ATTACHMENT         = 0x8CD6;
527     const GLenum FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7;
528     const GLenum FRAMEBUFFER_INCOMPLETE_DIMENSIONS         = 0x8CD9;
529     const GLenum FRAMEBUFFER_UNSUPPORTED                   = 0x8CDD;
531     const GLenum FRAMEBUFFER_BINDING            = 0x8CA6;
532     const GLenum RENDERBUFFER_BINDING           = 0x8CA7;
533     const GLenum MAX_RENDERBUFFER_SIZE          = 0x84E8;
535     const GLenum INVALID_FRAMEBUFFER_OPERATION  = 0x0506;
537     /* WebGL-specific enums */
538     const GLenum UNPACK_FLIP_Y_WEBGL            = 0x9240;
539     const GLenum UNPACK_PREMULTIPLY_ALPHA_WEBGL = 0x9241;
540     const GLenum CONTEXT_LOST_WEBGL             = 0x9242;
541     const GLenum UNPACK_COLORSPACE_CONVERSION_WEBGL = 0x9243;
542     const GLenum BROWSER_DEFAULT_WEBGL          = 0x9244;
544     // The canvas might actually be null in some cases, apparently.
545     readonly attribute CanvasSource? canvas;
546     readonly attribute GLsizei drawingBufferWidth;
547     readonly attribute GLsizei drawingBufferHeight;
549     [WebGLHandlesContextLoss] WebGLContextAttributes? getContextAttributes();
550     [WebGLHandlesContextLoss] boolean isContextLost();
552     [NeedsCallerType]
553     sequence<DOMString>? getSupportedExtensions();
555     [Throws, NeedsCallerType]
556     object? getExtension(DOMString name);
558     undefined activeTexture(GLenum texture);
559     undefined attachShader(WebGLProgram program, WebGLShader shader);
560     undefined bindAttribLocation(WebGLProgram program, GLuint index, DOMString name);
561     undefined bindBuffer(GLenum target, WebGLBuffer? buffer);
562     undefined bindFramebuffer(GLenum target, WebGLFramebuffer? framebuffer);
563     undefined bindRenderbuffer(GLenum target, WebGLRenderbuffer? renderbuffer);
564     undefined bindTexture(GLenum target, WebGLTexture? texture);
565     undefined blendColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
566     undefined blendEquation(GLenum mode);
567     undefined blendEquationSeparate(GLenum modeRGB, GLenum modeAlpha);
568     undefined blendFunc(GLenum sfactor, GLenum dfactor);
569     undefined blendFuncSeparate(GLenum srcRGB, GLenum dstRGB,
570                                 GLenum srcAlpha, GLenum dstAlpha);
572     [WebGLHandlesContextLoss] GLenum checkFramebufferStatus(GLenum target);
573     undefined clear(GLbitfield mask);
574     undefined clearColor(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
575     undefined clearDepth(GLclampf depth);
576     undefined clearStencil(GLint s);
577     undefined colorMask(GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
578     undefined compileShader(WebGLShader shader);
580     undefined copyTexImage2D(GLenum target, GLint level, GLenum internalformat,
581                              GLint x, GLint y, GLsizei width, GLsizei height,
582                              GLint border);
583     undefined copyTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
584                                 GLint x, GLint y, GLsizei width, GLsizei height);
586     WebGLBuffer? createBuffer();
587     WebGLFramebuffer? createFramebuffer();
588     WebGLProgram? createProgram();
589     WebGLRenderbuffer? createRenderbuffer();
590     WebGLShader? createShader(GLenum type);
591     WebGLTexture? createTexture();
593     undefined cullFace(GLenum mode);
595     undefined deleteBuffer(WebGLBuffer? buffer);
596     undefined deleteFramebuffer(WebGLFramebuffer? framebuffer);
597     undefined deleteProgram(WebGLProgram? program);
598     undefined deleteRenderbuffer(WebGLRenderbuffer? renderbuffer);
599     undefined deleteShader(WebGLShader? shader);
600     undefined deleteTexture(WebGLTexture? texture);
602     undefined depthFunc(GLenum func);
603     undefined depthMask(GLboolean flag);
604     undefined depthRange(GLclampf zNear, GLclampf zFar);
605     undefined detachShader(WebGLProgram program, WebGLShader shader);
606     undefined disable(GLenum cap);
607     undefined disableVertexAttribArray(GLuint index);
608     undefined drawArrays(GLenum mode, GLint first, GLsizei count);
609     undefined drawElements(GLenum mode, GLsizei count, GLenum type, GLintptr offset);
611     undefined enable(GLenum cap);
612     undefined enableVertexAttribArray(GLuint index);
613     undefined finish();
614     undefined flush();
615     undefined framebufferRenderbuffer(GLenum target, GLenum attachment,
616                                       GLenum renderbuffertarget,
617                                       WebGLRenderbuffer? renderbuffer);
618     undefined framebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget,
619                                    WebGLTexture? texture, GLint level);
620     undefined frontFace(GLenum mode);
622     undefined generateMipmap(GLenum target);
624     [NewObject]
625     WebGLActiveInfo? getActiveAttrib(WebGLProgram program, GLuint index);
626     [NewObject]
627     WebGLActiveInfo? getActiveUniform(WebGLProgram program, GLuint index);
629     sequence<WebGLShader>? getAttachedShaders(WebGLProgram program);
631     [WebGLHandlesContextLoss] GLint getAttribLocation(WebGLProgram program, DOMString name);
633     any getBufferParameter(GLenum target, GLenum pname);
634     [Throws]
635     any getParameter(GLenum pname);
637     [WebGLHandlesContextLoss] GLenum getError();
639     [Throws]
640     any getFramebufferAttachmentParameter(GLenum target, GLenum attachment,
641                                           GLenum pname);
642     any getProgramParameter(WebGLProgram program, GLenum pname);
643     DOMString? getProgramInfoLog(WebGLProgram program);
644     any getRenderbufferParameter(GLenum target, GLenum pname);
645     any getShaderParameter(WebGLShader shader, GLenum pname);
647     [NewObject]
648     WebGLShaderPrecisionFormat? getShaderPrecisionFormat(GLenum shadertype, GLenum precisiontype);
650     DOMString? getShaderInfoLog(WebGLShader shader);
652     DOMString? getShaderSource(WebGLShader shader);
654     any getTexParameter(GLenum target, GLenum pname);
656     any getUniform(WebGLProgram program, WebGLUniformLocation location);
658     [NewObject]
659     WebGLUniformLocation? getUniformLocation(WebGLProgram program, DOMString name);
661     [Throws]
662     any getVertexAttrib(GLuint index, GLenum pname);
664     [WebGLHandlesContextLoss] GLintptr getVertexAttribOffset(GLuint index, GLenum pname);
666     undefined hint(GLenum target, GLenum mode);
667     [WebGLHandlesContextLoss] GLboolean isBuffer(WebGLBuffer? buffer);
668     [WebGLHandlesContextLoss] GLboolean isEnabled(GLenum cap);
669     [WebGLHandlesContextLoss] GLboolean isFramebuffer(WebGLFramebuffer? framebuffer);
670     [WebGLHandlesContextLoss] GLboolean isProgram(WebGLProgram? program);
671     [WebGLHandlesContextLoss] GLboolean isRenderbuffer(WebGLRenderbuffer? renderbuffer);
672     [WebGLHandlesContextLoss] GLboolean isShader(WebGLShader? shader);
673     [WebGLHandlesContextLoss] GLboolean isTexture(WebGLTexture? texture);
674     undefined lineWidth(GLfloat width);
675     undefined linkProgram(WebGLProgram program);
676     undefined pixelStorei(GLenum pname, GLint param);
677     undefined polygonOffset(GLfloat factor, GLfloat units);
679     undefined renderbufferStorage(GLenum target, GLenum internalformat,
680                              GLsizei width, GLsizei height);
681     undefined sampleCoverage(GLclampf value, GLboolean invert);
682     undefined scissor(GLint x, GLint y, GLsizei width, GLsizei height);
684     undefined shaderSource(WebGLShader shader, DOMString source);
686     undefined stencilFunc(GLenum func, GLint ref, GLuint mask);
687     undefined stencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask);
688     undefined stencilMask(GLuint mask);
689     undefined stencilMaskSeparate(GLenum face, GLuint mask);
690     undefined stencilOp(GLenum fail, GLenum zfail, GLenum zpass);
691     undefined stencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
693     undefined texParameterf(GLenum target, GLenum pname, GLfloat param);
694     undefined texParameteri(GLenum target, GLenum pname, GLint param);
696     undefined uniform1f(WebGLUniformLocation? location, GLfloat x);
697     undefined uniform2f(WebGLUniformLocation? location, GLfloat x, GLfloat y);
698     undefined uniform3f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z);
699     undefined uniform4f(WebGLUniformLocation? location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
701     undefined uniform1i(WebGLUniformLocation? location, GLint x);
702     undefined uniform2i(WebGLUniformLocation? location, GLint x, GLint y);
703     undefined uniform3i(WebGLUniformLocation? location, GLint x, GLint y, GLint z);
704     undefined uniform4i(WebGLUniformLocation? location, GLint x, GLint y, GLint z, GLint w);
706     undefined useProgram(WebGLProgram? program);
707     undefined validateProgram(WebGLProgram program);
709     undefined vertexAttrib1f(GLuint indx, GLfloat x);
710     undefined vertexAttrib1fv(GLuint indx, Float32List values);
711     undefined vertexAttrib2f(GLuint indx, GLfloat x, GLfloat y);
712     undefined vertexAttrib2fv(GLuint indx, Float32List values);
713     undefined vertexAttrib3f(GLuint indx, GLfloat x, GLfloat y, GLfloat z);
714     undefined vertexAttrib3fv(GLuint indx, Float32List values);
715     undefined vertexAttrib4f(GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
716     undefined vertexAttrib4fv(GLuint indx, Float32List values);
717     undefined vertexAttribPointer(GLuint indx, GLint size, GLenum type,
718                                   GLboolean normalized, GLsizei stride, GLintptr offset);
720     undefined viewport(GLint x, GLint y, GLsizei width, GLsizei height);
723 [Exposed=(Window,Worker),
724  Func="mozilla::dom::OffscreenCanvas::PrefEnabledOnWorkerThread"]
725 interface WebGLRenderingContext {
726     // bufferData has WebGL2 overloads.
727     undefined bufferData(GLenum target, GLsizeiptr size, GLenum usage);
728     undefined bufferData(GLenum target, [AllowShared] ArrayBuffer? data, GLenum usage);
729     undefined bufferData(GLenum target, [AllowShared] ArrayBufferView data, GLenum usage);
730     // bufferSubData has WebGL2 overloads.
731     undefined bufferSubData(GLenum target, GLintptr offset, [AllowShared] ArrayBuffer data);
732     undefined bufferSubData(GLenum target, GLintptr offset, [AllowShared] ArrayBufferView data);
734     // compressedTexImage2D has WebGL2 overloads.
735     undefined compressedTexImage2D(GLenum target, GLint level, GLenum internalformat,
736                                    GLsizei width, GLsizei height, GLint border,
737                                    [AllowShared] ArrayBufferView data);
738     // compressedTexSubImage2D has WebGL2 overloads.
739     undefined compressedTexSubImage2D(GLenum target, GLint level,
740                                       GLint xoffset, GLint yoffset,
741                                       GLsizei width, GLsizei height, GLenum format,
742                                       [AllowShared] ArrayBufferView data);
744     // readPixels has WebGL2 overloads.
745     [Throws, NeedsCallerType]
746     undefined readPixels(GLint x, GLint y, GLsizei width, GLsizei height,
747                     GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
749     // texImage2D has WebGL2 overloads.
750     // Overloads must share [Throws].
751     [Throws] // Can't actually throw.
752     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
753                          GLsizei width, GLsizei height, GLint border, GLenum format,
754                          GLenum type, [AllowShared] ArrayBufferView? pixels);
755     [Throws] // Can't actually throw.
756     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
757                          GLenum format, GLenum type, ImageBitmap pixels);
758     [Throws] // Can't actually throw.
759     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
760                          GLenum format, GLenum type, ImageData pixels);
761     [Throws]
762     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
763                          GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException
764     [Throws]
765     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
766                          GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
767     [Throws]
768     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
769                          GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
770     [Throws]
771     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
772                          GLenum format, GLenum type, OffscreenCanvas canvas); // May throw DOMException
773     [Throws]
774     undefined texImage2D(GLenum target, GLint level, GLint internalformat,
775                          GLenum format, GLenum type, VideoFrame videoFrame); // May throw DOMException
777     // texSubImage2D has WebGL2 overloads.
778     [Throws] // Can't actually throw.
779     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
780                             GLsizei width, GLsizei height,
781                             GLenum format, GLenum type, [AllowShared] ArrayBufferView? pixels);
782     [Throws] // Can't actually throw.
783     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
784                             GLenum format, GLenum type, ImageBitmap pixels);
785     [Throws] // Can't actually throw.
786     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
787                             GLenum format, GLenum type, ImageData pixels);
788     [Throws]
789     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
790                             GLenum format, GLenum type, HTMLImageElement image); // May throw DOMException
791     [Throws]
792     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
793                             GLenum format, GLenum type, HTMLCanvasElement canvas); // May throw DOMException
794     [Throws]
795     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
796                             GLenum format, GLenum type, HTMLVideoElement video); // May throw DOMException
797     [Throws]
798     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
799                             GLenum format, GLenum type, OffscreenCanvas canvas); // May throw DOMException
800     [Throws]
801     undefined texSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset,
802                             GLenum format, GLenum type, VideoFrame videoFrame); // May throw DOMException
804     // uniform*fv have WebGL2 overloads, or rather extensions, that are not
805     // distinguishable from the WebGL1 versions when called with two arguments.
806     undefined uniform1fv(WebGLUniformLocation? location, Float32List data);
807     undefined uniform2fv(WebGLUniformLocation? location, Float32List data);
808     undefined uniform3fv(WebGLUniformLocation? location, Float32List data);
809     undefined uniform4fv(WebGLUniformLocation? location, Float32List data);
811     // uniform*iv have WebGL2 overloads, or rather extensions, that are not
812     // distinguishable from the WebGL1 versions when called with two arguments.
813     undefined uniform1iv(WebGLUniformLocation? location, Int32List data);
814     undefined uniform2iv(WebGLUniformLocation? location, Int32List data);
815     undefined uniform3iv(WebGLUniformLocation? location, Int32List data);
816     undefined uniform4iv(WebGLUniformLocation? location, Int32List data);
818     // uniformMatrix*fv have WebGL2 overloads, or rather extensions, that are
819     // not distinguishable from the WebGL1 versions when called with two
820     // arguments.
821     undefined uniformMatrix2fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
822     undefined uniformMatrix3fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
823     undefined uniformMatrix4fv(WebGLUniformLocation? location, GLboolean transpose, Float32List data);
826 WebGLRenderingContext includes WebGLRenderingContextBase;
828 ////////////////////////////////////////
829 // specific extension interfaces
831 [LegacyNoInterfaceObject,
832  Exposed=(Window,Worker)]
833 interface EXT_texture_compression_bptc {
834     const GLenum COMPRESSED_RGBA_BPTC_UNORM_EXT = 0x8E8C;
835     const GLenum COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT = 0x8E8D;
836     const GLenum COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT = 0x8E8E;
837     const GLenum COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT = 0x8E8F;
840 [LegacyNoInterfaceObject,
841  Exposed=(Window,Worker)]
842 interface EXT_texture_compression_rgtc {
843     const GLenum COMPRESSED_RED_RGTC1_EXT = 0x8DBB;
844     const GLenum COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC;
845     const GLenum COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD;
846     const GLenum COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE;
849 // https://www.khronos.org/registry/webgl/extensions/EXT_texture_norm16/
850 [LegacyNoInterfaceObject,
851  Exposed=(Window,Worker)]
852 interface EXT_texture_norm16 {
853   const GLenum R16_EXT = 0x822A;
854   const GLenum RG16_EXT = 0x822C;
855   const GLenum RGB16_EXT = 0x8054;
856   const GLenum RGBA16_EXT = 0x805B;
857   const GLenum R16_SNORM_EXT = 0x8F98;
858   const GLenum RG16_SNORM_EXT = 0x8F99;
859   const GLenum RGB16_SNORM_EXT = 0x8F9A;
860   const GLenum RGBA16_SNORM_EXT = 0x8F9B;
863 [LegacyNoInterfaceObject,
864  Exposed=(Window,Worker)]
865 interface WEBGL_compressed_texture_s3tc
867     const GLenum COMPRESSED_RGB_S3TC_DXT1_EXT  = 0x83F0;
868     const GLenum COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1;
869     const GLenum COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2;
870     const GLenum COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3;
873 [LegacyNoInterfaceObject,
874  Exposed=(Window,Worker)]
875 interface WEBGL_compressed_texture_s3tc_srgb {
876     /* Compressed Texture Formats */
877     const GLenum COMPRESSED_SRGB_S3TC_DXT1_EXT        = 0x8C4C;
878     const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT  = 0x8C4D;
879     const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT  = 0x8C4E;
880     const GLenum COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT  = 0x8C4F;
883 [LegacyNoInterfaceObject,
884  Exposed=(Window,Worker)]
885 interface WEBGL_compressed_texture_astc {
886     /* Compressed Texture Format */
887     const GLenum COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0;
888     const GLenum COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1;
889     const GLenum COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2;
890     const GLenum COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3;
891     const GLenum COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4;
892     const GLenum COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5;
893     const GLenum COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6;
894     const GLenum COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7;
895     const GLenum COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8;
896     const GLenum COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9;
897     const GLenum COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA;
898     const GLenum COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB;
899     const GLenum COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC;
900     const GLenum COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD;
902     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0;
903     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1;
904     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2;
905     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3;
906     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4;
907     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5;
908     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6;
909     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7;
910     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8;
911     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9;
912     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA;
913     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB;
914     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC;
915     const GLenum COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD;
917     // Profile query support.
918     sequence<DOMString>? getSupportedProfiles();
921 [LegacyNoInterfaceObject,
922  Exposed=(Window,Worker)]
923 interface WEBGL_compressed_texture_etc
925     const GLenum COMPRESSED_R11_EAC                                 = 0x9270;
926     const GLenum COMPRESSED_SIGNED_R11_EAC                          = 0x9271;
927     const GLenum COMPRESSED_RG11_EAC                                = 0x9272;
928     const GLenum COMPRESSED_SIGNED_RG11_EAC                         = 0x9273;
929     const GLenum COMPRESSED_RGB8_ETC2                               = 0x9274;
930     const GLenum COMPRESSED_SRGB8_ETC2                              = 0x9275;
931     const GLenum COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2           = 0x9276;
932     const GLenum COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2          = 0x9277;
933     const GLenum COMPRESSED_RGBA8_ETC2_EAC                          = 0x9278;
934     const GLenum COMPRESSED_SRGB8_ALPHA8_ETC2_EAC                   = 0x9279;
937 [LegacyNoInterfaceObject,
938  Exposed=(Window,Worker)]
939 interface WEBGL_compressed_texture_etc1
941     const GLenum COMPRESSED_RGB_ETC1_WEBGL = 0x8D64;
944 [LegacyNoInterfaceObject,
945  Exposed=(Window,Worker)]
946 interface WEBGL_compressed_texture_pvrtc
948     const GLenum COMPRESSED_RGB_PVRTC_4BPPV1_IMG  = 0x8C00;
949     const GLenum COMPRESSED_RGB_PVRTC_2BPPV1_IMG  = 0x8C01;
950     const GLenum COMPRESSED_RGBA_PVRTC_4BPPV1_IMG = 0x8C02;
951     const GLenum COMPRESSED_RGBA_PVRTC_2BPPV1_IMG = 0x8C03;
954 [LegacyNoInterfaceObject,
955  Exposed=(Window,Worker)]
956 interface WEBGL_debug_renderer_info
958     const GLenum UNMASKED_VENDOR_WEBGL        = 0x9245;
959     const GLenum UNMASKED_RENDERER_WEBGL      = 0x9246;
962 [LegacyNoInterfaceObject,
963  Exposed=(Window,Worker)]
964 interface WEBGL_debug_shaders
966     DOMString getTranslatedShaderSource(WebGLShader shader);
969 [LegacyNoInterfaceObject,
970  Exposed=(Window,Worker)]
971 interface WEBGL_depth_texture
973     const GLenum UNSIGNED_INT_24_8_WEBGL = 0x84FA;
976 [LegacyNoInterfaceObject,
977  Exposed=(Window,Worker)]
978 interface OES_element_index_uint
982 [LegacyNoInterfaceObject,
983  Exposed=(Window,Worker)]
984 interface EXT_frag_depth
988 [LegacyNoInterfaceObject,
989  Exposed=(Window,Worker)]
990 interface WEBGL_lose_context {
991     undefined loseContext();
992     undefined restoreContext();
995 [LegacyNoInterfaceObject,
996  Exposed=(Window,Worker)]
997 interface EXT_texture_filter_anisotropic
999     const GLenum TEXTURE_MAX_ANISOTROPY_EXT     = 0x84FE;
1000     const GLenum MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF;
1003 [LegacyNoInterfaceObject,
1004  Exposed=(Window,Worker)]
1005 interface EXT_sRGB
1007     const GLenum SRGB_EXT                                  = 0x8C40;
1008     const GLenum SRGB_ALPHA_EXT                            = 0x8C42;
1009     const GLenum SRGB8_ALPHA8_EXT                          = 0x8C43;
1010     const GLenum FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT = 0x8210;
1013 [LegacyNoInterfaceObject,
1014  Exposed=(Window,Worker)]
1015 interface OES_standard_derivatives {
1016     const GLenum FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
1019 [LegacyNoInterfaceObject,
1020  Exposed=(Window,Worker)]
1021 interface OES_texture_float
1025 [LegacyNoInterfaceObject,
1026  Exposed=(Window,Worker)]
1027 interface WEBGL_draw_buffers {
1028     const GLenum COLOR_ATTACHMENT0_WEBGL     = 0x8CE0;
1029     const GLenum COLOR_ATTACHMENT1_WEBGL     = 0x8CE1;
1030     const GLenum COLOR_ATTACHMENT2_WEBGL     = 0x8CE2;
1031     const GLenum COLOR_ATTACHMENT3_WEBGL     = 0x8CE3;
1032     const GLenum COLOR_ATTACHMENT4_WEBGL     = 0x8CE4;
1033     const GLenum COLOR_ATTACHMENT5_WEBGL     = 0x8CE5;
1034     const GLenum COLOR_ATTACHMENT6_WEBGL     = 0x8CE6;
1035     const GLenum COLOR_ATTACHMENT7_WEBGL     = 0x8CE7;
1036     const GLenum COLOR_ATTACHMENT8_WEBGL     = 0x8CE8;
1037     const GLenum COLOR_ATTACHMENT9_WEBGL     = 0x8CE9;
1038     const GLenum COLOR_ATTACHMENT10_WEBGL    = 0x8CEA;
1039     const GLenum COLOR_ATTACHMENT11_WEBGL    = 0x8CEB;
1040     const GLenum COLOR_ATTACHMENT12_WEBGL    = 0x8CEC;
1041     const GLenum COLOR_ATTACHMENT13_WEBGL    = 0x8CED;
1042     const GLenum COLOR_ATTACHMENT14_WEBGL    = 0x8CEE;
1043     const GLenum COLOR_ATTACHMENT15_WEBGL    = 0x8CEF;
1045     const GLenum DRAW_BUFFER0_WEBGL          = 0x8825;
1046     const GLenum DRAW_BUFFER1_WEBGL          = 0x8826;
1047     const GLenum DRAW_BUFFER2_WEBGL          = 0x8827;
1048     const GLenum DRAW_BUFFER3_WEBGL          = 0x8828;
1049     const GLenum DRAW_BUFFER4_WEBGL          = 0x8829;
1050     const GLenum DRAW_BUFFER5_WEBGL          = 0x882A;
1051     const GLenum DRAW_BUFFER6_WEBGL          = 0x882B;
1052     const GLenum DRAW_BUFFER7_WEBGL          = 0x882C;
1053     const GLenum DRAW_BUFFER8_WEBGL          = 0x882D;
1054     const GLenum DRAW_BUFFER9_WEBGL          = 0x882E;
1055     const GLenum DRAW_BUFFER10_WEBGL         = 0x882F;
1056     const GLenum DRAW_BUFFER11_WEBGL         = 0x8830;
1057     const GLenum DRAW_BUFFER12_WEBGL         = 0x8831;
1058     const GLenum DRAW_BUFFER13_WEBGL         = 0x8832;
1059     const GLenum DRAW_BUFFER14_WEBGL         = 0x8833;
1060     const GLenum DRAW_BUFFER15_WEBGL         = 0x8834;
1062     const GLenum MAX_COLOR_ATTACHMENTS_WEBGL = 0x8CDF;
1063     const GLenum MAX_DRAW_BUFFERS_WEBGL      = 0x8824;
1065     undefined drawBuffersWEBGL(sequence<GLenum> buffers);
1068 [LegacyNoInterfaceObject,
1069  Exposed=(Window,Worker)]
1070 interface OES_texture_float_linear
1074 [LegacyNoInterfaceObject,
1075  Exposed=(Window,Worker)]
1076 interface EXT_shader_texture_lod
1080 [LegacyNoInterfaceObject,
1081  Exposed=(Window,Worker)]
1082 interface OES_texture_half_float
1084     const GLenum HALF_FLOAT_OES = 0x8D61;
1087 [LegacyNoInterfaceObject,
1088  Exposed=(Window,Worker)]
1089 interface OES_texture_half_float_linear
1093 [LegacyNoInterfaceObject,
1094  Exposed=(Window,Worker)]
1095 interface WEBGL_color_buffer_float
1097     const GLenum RGBA32F_EXT = 0x8814;
1098     const GLenum RGB32F_EXT = 0x8815;
1099     const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
1100     const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
1103 [LegacyNoInterfaceObject,
1104  Exposed=(Window,Worker)]
1105 interface EXT_color_buffer_half_float
1107     const GLenum RGBA16F_EXT = 0x881A;
1108     const GLenum RGB16F_EXT = 0x881B;
1109     const GLenum FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT = 0x8211;
1110     const GLenum UNSIGNED_NORMALIZED_EXT = 0x8C17;
1113 [LegacyNoInterfaceObject,
1114  Exposed=(Window,Worker)]
1115 interface OES_vertex_array_object {
1116     const GLenum VERTEX_ARRAY_BINDING_OES = 0x85B5;
1118     WebGLVertexArrayObject? createVertexArrayOES();
1119     undefined deleteVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1120     [WebGLHandlesContextLoss] GLboolean isVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1121     undefined bindVertexArrayOES(WebGLVertexArrayObject? arrayObject);
1124 [LegacyNoInterfaceObject,
1125  Exposed=(Window,Worker)]
1126 interface ANGLE_instanced_arrays {
1127     const GLenum VERTEX_ATTRIB_ARRAY_DIVISOR_ANGLE = 0x88FE;
1129     undefined drawArraysInstancedANGLE(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
1130     undefined drawElementsInstancedANGLE(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei primcount);
1131     undefined vertexAttribDivisorANGLE(GLuint index, GLuint divisor);
1134 [LegacyNoInterfaceObject,
1135  Exposed=(Window,Worker)]
1136 interface EXT_blend_minmax {
1137     const GLenum MIN_EXT = 0x8007;
1138     const GLenum MAX_EXT = 0x8008;
1141 [Exposed=(Window,Worker)]
1142 interface WebGLQuery {
1145 [LegacyNoInterfaceObject,
1146  Exposed=(Window,Worker)]
1147 interface EXT_disjoint_timer_query {
1148     const GLenum QUERY_COUNTER_BITS_EXT = 0x8864;
1149     const GLenum CURRENT_QUERY_EXT = 0x8865;
1150     const GLenum QUERY_RESULT_EXT = 0x8866;
1151     const GLenum QUERY_RESULT_AVAILABLE_EXT = 0x8867;
1152     const GLenum TIME_ELAPSED_EXT = 0x88BF;
1153     const GLenum TIMESTAMP_EXT = 0x8E28;
1154     const GLenum GPU_DISJOINT_EXT = 0x8FBB;
1156     WebGLQuery? createQueryEXT();
1157     undefined deleteQueryEXT(WebGLQuery? query);
1158     [WebGLHandlesContextLoss] boolean isQueryEXT(WebGLQuery? query);
1159     undefined beginQueryEXT(GLenum target, WebGLQuery query);
1160     undefined endQueryEXT(GLenum target);
1161     undefined queryCounterEXT(WebGLQuery query, GLenum target);
1162     any getQueryEXT(GLenum target, GLenum pname);
1163     any getQueryObjectEXT(WebGLQuery query, GLenum pname);
1166 [LegacyNoInterfaceObject,
1167  Exposed=(Window,Worker)]
1168 interface MOZ_debug {
1169     const GLenum EXTENSIONS = 0x1F03;
1171     const GLenum WSI_INFO   = 0x10000;
1172     const GLenum UNPACK_REQUIRE_FASTPATH = 0x10001;
1173     const GLenum DOES_INDEX_VALIDATION   = 0x10002;
1175     [Throws]
1176     any getParameter(GLenum pname);
1179 [LegacyNoInterfaceObject,
1180  Exposed=(Window,Worker)]
1181 interface EXT_float_blend {
1184 [LegacyNoInterfaceObject,
1185  Exposed=(Window,Worker)]
1186 interface OES_fbo_render_mipmap {
1189 [LegacyNoInterfaceObject,
1190  Exposed=(Window,Worker)]
1191 interface WEBGL_explicit_present {
1192     undefined present();
1195 // https://www.khronos.org/registry/webgl/extensions/OES_draw_buffers_indexed/
1196 [Exposed=(Window,Worker), LegacyNoInterfaceObject]
1197 interface OES_draw_buffers_indexed {
1198   undefined enableiOES(GLenum target, GLuint index);
1200   undefined disableiOES(GLenum target, GLuint index);
1202   undefined blendEquationiOES(GLuint buf, GLenum mode);
1204   undefined blendEquationSeparateiOES(GLuint buf,
1205                                       GLenum modeRGB, GLenum modeAlpha);
1207   undefined blendFunciOES(GLuint buf,
1208                           GLenum src, GLenum dst);
1210   undefined blendFuncSeparateiOES(GLuint buf,
1211                                   GLenum srcRGB, GLenum dstRGB,
1212                                   GLenum srcAlpha, GLenum dstAlpha);
1214   undefined colorMaskiOES(GLuint buf,
1215                           GLboolean r, GLboolean g, GLboolean b, GLboolean a);
1218 [Exposed=(Window,Worker), LegacyNoInterfaceObject]
1219 interface WEBGL_provoking_vertex {
1220     const GLenum FIRST_VERTEX_CONVENTION_WEBGL = 0x8E4D;
1221     const GLenum LAST_VERTEX_CONVENTION_WEBGL  = 0x8E4E; // default
1222     const GLenum PROVOKING_VERTEX_WEBGL        = 0x8E4F;
1224     undefined provokingVertexWEBGL(GLenum provokeMode);
1227 // https://immersive-web.github.io/webxr/#dom-webglcontextattributes-xrcompatible
1228 partial dictionary WebGLContextAttributes {
1229     [Pref="dom.vr.webxr.enabled"]
1230     boolean xrCompatible = false;
1233 // https://immersive-web.github.io/webxr/#dom-webglrenderingcontextbase-makexrcompatible
1234 partial interface mixin WebGLRenderingContextBase {
1235     [NewObject, Pref="dom.vr.webxr.enabled"]
1236     Promise<undefined> makeXRCompatible();