From 5560d8a25dd380c60bddb21944aa79d1322129b9 Mon Sep 17 00:00:00 2001 From: Igor Pissolati Date: Mon, 4 Apr 2022 10:12:19 -0300 Subject: [PATCH] LibWeb: Use correct global object in legacy factories --- Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp | 2 +- Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index b657468de5..d735f17660 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -38,7 +38,7 @@ JS::ThrowCompletionOr AudioConstructor::call() JS::ThrowCompletionOr AudioConstructor::construct(FunctionObject&) { // 1. Let document be the current global object's associated Document. - auto& window = static_cast(global_object()); + auto& window = static_cast(HTML::current_global_object()); auto& document = window.impl().associated_document(); // 2. Let audio be the result of creating an element given document, audio, and the HTML namespace. diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index 2c0a9adf9f..6f839b1acc 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -38,7 +38,7 @@ JS::ThrowCompletionOr ImageConstructor::call() JS::ThrowCompletionOr ImageConstructor::construct(FunctionObject&) { // 1. Let document be the current global object's associated Document. - auto& window = static_cast(global_object()); + auto& window = static_cast(HTML::current_global_object()); auto& document = window.impl().associated_document(); // 2. Let img be the result of creating an element given document, img, and the HTML namespace.