summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h66
1 files changed, 62 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
index 57cf99b227..07518a4026 100644
--- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
+++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h
@@ -83,34 +83,92 @@ private:
explicit XMLHttpRequest(HTML::Window&);
+ // Non-standard
JS::NonnullGCPtr<HTML::Window> m_window;
+ Fetch::Infrastructure::Status m_status { 0 };
+ HashMap<String, String, CaseInsensitiveStringTraits> m_response_headers;
+ // https://xhr.spec.whatwg.org/#concept-xmlhttprequest-state
+ // state
+ // One of unsent, opened, headers received, loading, and done; initially unsent.
State m_state { State::Unsent };
- Fetch::Infrastructure::Status m_status { 0 };
+
+ // https://xhr.spec.whatwg.org/#send-flag
+ // send() flag
+ // A flag, initially unset.
bool m_send { false };
+
+ // https://xhr.spec.whatwg.org/#timeout
+ // timeout
+ // An unsigned integer, initially 0.
u32 m_timeout { 0 };
+ // FIXME: https://xhr.spec.whatwg.org/#cross-origin-credentials
+
+ // https://xhr.spec.whatwg.org/#request-method
+ // request method
+ // A method.
String m_method;
- AK::URL m_url;
- Bindings::XMLHttpRequestResponseType m_response_type;
+ // https://xhr.spec.whatwg.org/#request-url
+ // request URL
+ // A URL.
+ AK::URL m_url;
+ // https://xhr.spec.whatwg.org/#author-request-headers
+ // author request headers
+ // A header list, initially empty.
HashMap<String, String, CaseInsensitiveStringTraits> m_request_headers;
- HashMap<String, String, CaseInsensitiveStringTraits> m_response_headers;
+ // FIXME: https://xhr.spec.whatwg.org/#request-body
+
+ // https://xhr.spec.whatwg.org/#synchronous-flag
+ // synchronous flag
+ // A flag, initially unset.
bool m_synchronous { false };
+
+ // https://xhr.spec.whatwg.org/#upload-complete-flag
+ // upload complete flag
+ // A flag, initially unset.
bool m_upload_complete { false };
+
+ // https://xhr.spec.whatwg.org/#upload-listener-flag
+ // upload listener flag
+ // A flag, initially unset.
bool m_upload_listener { false };
+
+ // https://xhr.spec.whatwg.org/#timed-out-flag
+ // timed out flag
+ // A flag, initially unset.
bool m_timed_out { false };
+ // FIXME: https://xhr.spec.whatwg.org/#response
+
+ // https://xhr.spec.whatwg.org/#received-bytes
+ // received bytes
+ // A byte sequence, initially the empty byte sequence.
ByteBuffer m_received_bytes;
+ // https://xhr.spec.whatwg.org/#response-type
+ // response type
+ // One of the empty string, "arraybuffer", "blob", "document", "json", and "text"; initially the empty string.
+ Bindings::XMLHttpRequestResponseType m_response_type;
+
enum class Failure {
/// ????
};
+
+ // https://xhr.spec.whatwg.org/#response-object
+ // response object
+ // An object, failure, or null, initially null.
Variant<JS::Value, Failure, Empty> m_response_object;
+ // FIXME: https://xhr.spec.whatwg.org/#xmlhttprequest-fetch-controller
+
// https://xhr.spec.whatwg.org/#override-mime-type
+ // override MIME type
+ // A MIME type or null, initially null.
+ // NOTE: Can get a value when overrideMimeType() is invoked.
Optional<MimeSniff::MimeType> m_override_mime_type;
};