1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 15:38:10 +00:00

LibWeb: Remove unecessary dependence on Window from WebGL and WebSocket

These classes only needed Window to get at its realm. Pass a realm
directly to construct WebGL and WebSocket classes.
This commit is contained in:
Andrew Kaster 2022-09-25 18:12:50 -06:00 committed by Linus Groh
parent 4bb6345b2f
commit beb3519a49
9 changed files with 42 additions and 42 deletions

View file

@ -97,7 +97,7 @@ JS::ThrowCompletionOr<HTMLCanvasElement::HasOrCreatedContext> HTMLCanvasElement:
if (!m_context.has<Empty>())
return m_context.has<JS::NonnullGCPtr<WebGL::WebGLRenderingContext>>() ? HasOrCreatedContext::Yes : HasOrCreatedContext::No;
auto maybe_context = TRY(WebGL::WebGLRenderingContext::create(window(), *this, options));
auto maybe_context = TRY(WebGL::WebGLRenderingContext::create(realm(), *this, options));
if (!maybe_context)
return HasOrCreatedContext::No;