1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:57:35 +00:00

LibWeb: Flesh out existing XHR methods a bit more

This makes open, send and setRequestHeader a bit more spec compliant and
adds a bunch of FIXMEs for unimplemented parts.
This commit is contained in:
Luke 2021-01-23 17:50:22 +00:00 committed by Andreas Kling
parent c68148efc5
commit 4f2e154dbe
8 changed files with 359 additions and 29 deletions

View file

@ -28,6 +28,7 @@
#include <AK/ByteBuffer.h>
#include <AK/RefCounted.h>
#include <AK/URL.h>
#include <AK/Weakable.h>
#include <LibWeb/Bindings/Wrappable.h>
#include <LibWeb/DOM/EventTarget.h>
@ -71,19 +72,26 @@ private:
virtual JS::Object* create_wrapper(JS::GlobalObject&) override;
void set_ready_state(ReadyState);
void fire_progress_event(const String&, u64, u64);
explicit XMLHttpRequest(DOM::Window&);
NonnullRefPtr<DOM::Window> m_window;
ReadyState m_ready_state { ReadyState::Unsent };
bool m_send { false };
String m_method;
String m_url;
URL m_url;
HashMap<String, String, CaseInsensitiveStringTraits> m_request_headers;
ByteBuffer m_response;
bool m_synchronous { false };
bool m_upload_complete { false };
bool m_upload_listener { false };
bool m_timed_out { false };
ByteBuffer m_response_object;
};
}