LibWeb: Add constructor to XMLHttpRequest IDL interface

This commit is contained in:
Linus Groh 2021-02-17 22:53:20 +01:00 committed by Andreas Kling
parent 8f8f7bfd0f
commit 13867600c3
Notes: sideshowbarker 2024-07-18 22:10:24 +09:00
2 changed files with 11 additions and 1 deletions

View file

@ -30,6 +30,7 @@
#include <AK/RefCounted.h>
#include <AK/URL.h>
#include <AK/Weakable.h>
#include <LibWeb/Bindings/WindowObject.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/DOM/EventTarget.h>
#include <LibWeb/XHR/XMLHttpRequestEventTarget.h>
@ -51,7 +52,14 @@ public:
using WrapperType = Bindings::XMLHttpRequestWrapper;
static NonnullRefPtr<XMLHttpRequest> create(DOM::Window& window) { return adopt(*new XMLHttpRequest(window)); }
static NonnullRefPtr<XMLHttpRequest> create(DOM::Window& window)
{
return adopt(*new XMLHttpRequest(window));
}
static NonnullRefPtr<XMLHttpRequest> create_with_global_object(Bindings::WindowObject& window)
{
return XMLHttpRequest::create(window.impl());
}
virtual ~XMLHttpRequest() override;

View file

@ -1,5 +1,7 @@
interface XMLHttpRequest : XMLHttpRequestEventTarget {
constructor();
const unsigned short UNSENT = 0;
const unsigned short OPENED = 1;
const unsigned short HEADERS_RECEIVED = 2;