diff --git a/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp b/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp index 43d430ac906..be56135d4d9 100644 --- a/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp +++ b/Libraries/LibWeb/WebGL/WebGLRenderingContext.cpp @@ -150,4 +150,14 @@ void WebGLRenderingContext::allocate_painting_surface_if_needed() context().allocate_painting_surface_if_needed(); } +Optional> WebGLRenderingContext::get_supported_extensions() const +{ + return {}; +} + +JS::Object* WebGLRenderingContext::get_extension(String const&) +{ + return nullptr; +} + } diff --git a/Libraries/LibWeb/WebGL/WebGLRenderingContext.h b/Libraries/LibWeb/WebGL/WebGLRenderingContext.h index 7376ac477a6..c0482d736da 100644 --- a/Libraries/LibWeb/WebGL/WebGLRenderingContext.h +++ b/Libraries/LibWeb/WebGL/WebGLRenderingContext.h @@ -39,6 +39,9 @@ public: void set_size(Gfx::IntSize const&); void reset_to_default_state(); + Optional> get_supported_extensions() const; + JS::Object* get_extension(String const& name); + private: virtual void initialize(JS::Realm&) override; diff --git a/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl b/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl index 696e3b3bb98..09ce7f7af1c 100644 --- a/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl +++ b/Libraries/LibWeb/WebGL/WebGLRenderingContextBase.idl @@ -41,8 +41,8 @@ interface mixin WebGLRenderingContextBase { [FIXME] WebGLContextAttributes? getContextAttributes(); [FIXME] boolean isContextLost(); - [FIXME] sequence? getSupportedExtensions(); - [FIXME] object? getExtension(DOMString name); + sequence? getSupportedExtensions(); + object? getExtension(DOMString name); undefined activeTexture(GLenum texture); undefined attachShader(WebGLProgram program, WebGLShader shader); diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp index c34a772930d..0b4b5aab42f 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/GenerateWebGLRenderingContext.cpp @@ -171,6 +171,11 @@ public: continue; } + if (function.name == "getSupportedExtensions"sv || function.name == "getExtension"sv) { + // Implemented in WebGLRenderingContext + continue; + } + StringBuilder function_declaration; StringBuilder function_parameters;