tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

WebGLRenderingContext.webidl (52308B)


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