From 338ada66fac356549f9ac56719f26c8eb7824df6 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Sun, 13 Nov 2022 14:09:46 +0000 Subject: LibWeb: Add spec comments and links to XHR members --- Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h | 66 ++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) (limited to 'Userland/Libraries/LibWeb') 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 m_window; + Fetch::Infrastructure::Status m_status { 0 }; + HashMap 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 m_request_headers; - HashMap 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 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 m_override_mime_type; }; -- cgit v1.2.3