From 13867600c3ddc65bbcfe2d6ccf76147e0c4acf5e Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Wed, 17 Feb 2021 22:53:20 +0100 Subject: [PATCH] LibWeb: Add constructor to XMLHttpRequest IDL interface --- Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h | 10 +++++++++- Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h index a8050a315d8..3071ba3aa26 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h @@ -30,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -51,7 +52,14 @@ public: using WrapperType = Bindings::XMLHttpRequestWrapper; - static NonnullRefPtr create(DOM::Window& window) { return adopt(*new XMLHttpRequest(window)); } + static NonnullRefPtr create(DOM::Window& window) + { + return adopt(*new XMLHttpRequest(window)); + } + static NonnullRefPtr create_with_global_object(Bindings::WindowObject& window) + { + return XMLHttpRequest::create(window.impl()); + } virtual ~XMLHttpRequest() override; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl index b4529f02837..f6e25809b5d 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.idl @@ -1,5 +1,7 @@ interface XMLHttpRequest : XMLHttpRequestEventTarget { + constructor(); + const unsigned short UNSENT = 0; const unsigned short OPENED = 1; const unsigned short HEADERS_RECEIVED = 2;