diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp index 766ec0e88d..b2c4f8d843 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.cpp @@ -55,9 +55,9 @@ TextEncoderEncodeIntoResult TextEncoder::encode_into(String const& source, JS::H auto& data = destination->viewed_array_buffer()->buffer(); // 1. Let read be 0. - unsigned long long read = 0; + WebIDL::UnsignedLongLong read = 0; // 2. Let written be 0. - unsigned long long written = 0; + WebIDL::UnsignedLongLong written = 0; // NOTE: The AK::String is always UTF-8, so most of these steps are no-ops. // 3. Let encoder be an instance of the UTF-8 encoder. diff --git a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h index 3e405b4305..463cd6033a 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextEncoder.h +++ b/Userland/Libraries/LibWeb/Encoding/TextEncoder.h @@ -13,13 +13,14 @@ #include #include #include +#include namespace Web::Encoding { // https://encoding.spec.whatwg.org/#dictdef-textencoderencodeintoresult struct TextEncoderEncodeIntoResult { - unsigned long long read; - unsigned long long written; + WebIDL::UnsignedLongLong read; + WebIDL::UnsignedLongLong written; }; // https://encoding.spec.whatwg.org/#textencoder diff --git a/Userland/Libraries/LibWeb/FileAPI/FileList.h b/Userland/Libraries/LibWeb/FileAPI/FileList.h index 40c4469d71..d7b9205a02 100644 --- a/Userland/Libraries/LibWeb/FileAPI/FileList.h +++ b/Userland/Libraries/LibWeb/FileAPI/FileList.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace Web::FileAPI { @@ -23,7 +24,7 @@ public: virtual ~FileList() override; // https://w3c.github.io/FileAPI/#dfn-length - unsigned long length() const { return m_files.size(); } + WebIDL::UnsignedLong length() const { return m_files.size(); } // https://w3c.github.io/FileAPI/#dfn-item File* item(size_t index) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp index c0902bb29a..1d3c4a2282 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.cpp @@ -1740,19 +1740,19 @@ WebIDL::ExceptionOr HTMLInputElement::set_value_as_number(double value) } // https://html.spec.whatwg.org/multipage/input.html#dom-input-stepup -WebIDL::ExceptionOr HTMLInputElement::step_up(long n) +WebIDL::ExceptionOr HTMLInputElement::step_up(WebIDL::Long n) { return step_up_or_down(false, n); } // https://html.spec.whatwg.org/multipage/input.html#dom-input-stepdown -WebIDL::ExceptionOr HTMLInputElement::step_down(long n) +WebIDL::ExceptionOr HTMLInputElement::step_down(WebIDL::Long n) { return step_up_or_down(true, n); } // https://html.spec.whatwg.org/multipage/input.html#dom-input-stepup -WebIDL::ExceptionOr HTMLInputElement::step_up_or_down(bool is_down, long n) +WebIDL::ExceptionOr HTMLInputElement::step_up_or_down(bool is_down, WebIDL::Long n) { // 1. If the stepDown() and stepUp() methods do not apply, as defined for the input element's type attribute's current state, then throw an "InvalidStateError" DOMException. if (!step_up_or_down_applies()) diff --git a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h index 278d5d1532..7f17abe58d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLInputElement.h @@ -118,8 +118,8 @@ public: double value_as_number() const; WebIDL::ExceptionOr set_value_as_number(double value); - WebIDL::ExceptionOr step_up(long n = 1); - WebIDL::ExceptionOr step_down(long n = 1); + WebIDL::ExceptionOr step_up(WebIDL::Long n = 1); + WebIDL::ExceptionOr step_down(WebIDL::Long n = 1); WebIDL::ExceptionOr check_validity(); WebIDL::ExceptionOr report_validity(); @@ -221,7 +221,7 @@ private: double step_scale_factor() const; Optional allowed_value_step() const; double step_base() const; - WebIDL::ExceptionOr step_up_or_down(bool is_down, long n); + WebIDL::ExceptionOr step_up_or_down(bool is_down, WebIDL::Long n); static TypeAttributeState parse_type_attribute(StringView); void create_shadow_tree_if_needed(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 97493cb168..2161e219a7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -382,7 +382,7 @@ JS::NonnullGCPtr HTMLTableElement::rows() } // https://html.spec.whatwg.org/multipage/tables.html#dom-table-insertrow -WebIDL::ExceptionOr> HTMLTableElement::insert_row(long index) +WebIDL::ExceptionOr> HTMLTableElement::insert_row(WebIDL::Long index) { auto rows = this->rows(); auto rows_length = rows->length(); @@ -408,7 +408,7 @@ WebIDL::ExceptionOr> HTMLTableElement::ins } // https://html.spec.whatwg.org/multipage/tables.html#dom-table-deleterow -WebIDL::ExceptionOr HTMLTableElement::delete_row(long index) +WebIDL::ExceptionOr HTMLTableElement::delete_row(WebIDL::Long index) { auto rows = this->rows(); auto rows_length = rows->length(); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h index 8f6c3bba0b..04e935228b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.h @@ -11,6 +11,7 @@ #include #include #include +#include namespace Web::HTML { @@ -40,8 +41,8 @@ public: JS::NonnullGCPtr create_t_body(); JS::NonnullGCPtr rows(); - WebIDL::ExceptionOr> insert_row(long index); - WebIDL::ExceptionOr delete_row(long index); + WebIDL::ExceptionOr> insert_row(WebIDL::Long index); + WebIDL::ExceptionOr delete_row(WebIDL::Long index); // https://www.w3.org/TR/html-aria/#el-table virtual Optional default_role() const override { return ARIA::Role::table; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index 52c349ff50..8399379717 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -49,7 +49,7 @@ JS::NonnullGCPtr HTMLTableSectionElement::rows() const } // https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-insertrow -WebIDL::ExceptionOr> HTMLTableSectionElement::insert_row(long index) +WebIDL::ExceptionOr> HTMLTableSectionElement::insert_row(WebIDL::Long index) { auto rows_collection = rows(); auto rows_collection_size = static_cast(rows_collection->length()); @@ -73,7 +73,7 @@ WebIDL::ExceptionOr> HTMLTableSectionEleme } // https://html.spec.whatwg.org/multipage/tables.html#dom-tbody-deleterow -WebIDL::ExceptionOr HTMLTableSectionElement::delete_row(long index) +WebIDL::ExceptionOr HTMLTableSectionElement::delete_row(WebIDL::Long index) { auto rows_collection = rows(); auto rows_collection_size = static_cast(rows_collection->length()); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h index 1cc3569f42..0d8eeda150 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.h @@ -9,6 +9,7 @@ #include #include +#include namespace Web::HTML { @@ -20,8 +21,8 @@ public: virtual ~HTMLTableSectionElement() override; JS::NonnullGCPtr rows() const; - WebIDL::ExceptionOr> insert_row(long index); - WebIDL::ExceptionOr delete_row(long index); + WebIDL::ExceptionOr> insert_row(WebIDL::Long index); + WebIDL::ExceptionOr delete_row(WebIDL::Long index); // https://www.w3.org/TR/html-aria/#el-tbody // https://www.w3.org/TR/html-aria/#el-tfoot diff --git a/Userland/Libraries/LibWeb/HTML/History.cpp b/Userland/Libraries/LibWeb/HTML/History.cpp index 1c4179f5a9..31bb36efd6 100644 --- a/Userland/Libraries/LibWeb/HTML/History.cpp +++ b/Userland/Libraries/LibWeb/HTML/History.cpp @@ -78,7 +78,7 @@ WebIDL::ExceptionOr History::state() const } // https://html.spec.whatwg.org/multipage/history.html#dom-history-go -WebIDL::ExceptionOr History::go(long delta = 0) +WebIDL::ExceptionOr History::go(WebIDL::Long delta = 0) { // 1. Let document be this's associated Document. diff --git a/Userland/Libraries/LibWeb/HTML/History.h b/Userland/Libraries/LibWeb/HTML/History.h index d8b4c1efaf..6135583cb8 100644 --- a/Userland/Libraries/LibWeb/HTML/History.h +++ b/Userland/Libraries/LibWeb/HTML/History.h @@ -10,6 +10,7 @@ #include #include #include +#include namespace Web::HTML { @@ -24,7 +25,7 @@ public: WebIDL::ExceptionOr push_state(JS::Value data, String const& unused, Optional const& url = {}); WebIDL::ExceptionOr replace_state(JS::Value data, String const& unused, Optional const& url = {}); - WebIDL::ExceptionOr go(long delta); + WebIDL::ExceptionOr go(WebIDL::Long delta); WebIDL::ExceptionOr back(); WebIDL::ExceptionOr forward(); WebIDL::ExceptionOr length() const; diff --git a/Userland/Libraries/LibWeb/HTML/NavigatorConcurrentHardware.h b/Userland/Libraries/LibWeb/HTML/NavigatorConcurrentHardware.h index 0276641b35..fe1649c56e 100644 --- a/Userland/Libraries/LibWeb/HTML/NavigatorConcurrentHardware.h +++ b/Userland/Libraries/LibWeb/HTML/NavigatorConcurrentHardware.h @@ -6,12 +6,14 @@ #pragma once +#include + namespace Web::HTML { class NavigatorConcurrentHardwareMixin { public: // https://html.spec.whatwg.org/multipage/workers.html#dom-navigator-hardwareconcurrency - unsigned long long hardware_concurrency() { return 1; } + WebIDL::UnsignedLongLong hardware_concurrency() { return 1; } }; } diff --git a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h index cc82e20962..dff0d57c26 100644 --- a/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/WheelEvent.h @@ -8,10 +8,11 @@ #include #include +#include namespace Web::UIEvents { -enum class WheelDeltaMode : unsigned long { +enum class WheelDeltaMode : WebIDL::UnsignedLong { DOM_DELTA_PIXEL = 0, DOM_DELTA_LINE = 1, DOM_DELTA_PAGE = 2, @@ -38,7 +39,7 @@ public: double delta_x() const { return m_delta_x; } double delta_y() const { return m_delta_y; } double delta_z() const { return m_delta_z; } - unsigned long delta_mode() const { return to_underlying(m_delta_mode); } + WebIDL::UnsignedLong delta_mode() const { return to_underlying(m_delta_mode); } private: WheelEvent(JS::Realm&, FlyString const& event_name, WheelEventInit const& event_init, double page_x, double page_y, double offset_x, double offset_y);