diff --git a/Libraries/LibCore/ConfigFile.cpp b/Libraries/LibCore/ConfigFile.cpp index ef572f6a547..6c0c7e68cbc 100644 --- a/Libraries/LibCore/ConfigFile.cpp +++ b/Libraries/LibCore/ConfigFile.cpp @@ -138,7 +138,7 @@ ErrorOr ConfigFile::reparse() return {}; } -Optional ConfigFile::read_entry_optional(const AK::ByteString& group, const AK::ByteString& key) const +Optional ConfigFile::read_entry_optional(AK::ByteString const& group, AK::ByteString const& key) const { if (!has_key(group, key)) return {}; diff --git a/Libraries/LibJS/Runtime/Shape.h b/Libraries/LibJS/Runtime/Shape.h index 0075e1fa449..c4409584990 100644 --- a/Libraries/LibJS/Runtime/Shape.h +++ b/Libraries/LibJS/Runtime/Shape.h @@ -150,7 +150,7 @@ private: template<> struct AK::Traits : public DefaultTraits { - static unsigned hash(const JS::TransitionKey& key) + static unsigned hash(JS::TransitionKey const& key) { return pair_int_hash(key.attributes.bits(), Traits::hash(key.property_key)); } diff --git a/Libraries/LibRequests/RequestClient.cpp b/Libraries/LibRequests/RequestClient.cpp index e07427c75f0..c5770f5874e 100644 --- a/Libraries/LibRequests/RequestClient.cpp +++ b/Libraries/LibRequests/RequestClient.cpp @@ -99,7 +99,7 @@ void RequestClient::certificate_requested(i32 request_id) } } -RefPtr RequestClient::websocket_connect(const URL::URL& url, ByteString const& origin, Vector const& protocols, Vector const& extensions, HTTP::HeaderMap const& request_headers) +RefPtr RequestClient::websocket_connect(URL::URL const& url, ByteString const& origin, Vector const& protocols, Vector const& extensions, HTTP::HeaderMap const& request_headers) { auto websocket_id = m_next_websocket_id++; IPCProxy::async_websocket_connect(websocket_id, url, origin, protocols, extensions, request_headers); diff --git a/Libraries/LibRequests/RequestClient.h b/Libraries/LibRequests/RequestClient.h index 5c74e3edd78..2d338f3f73b 100644 --- a/Libraries/LibRequests/RequestClient.h +++ b/Libraries/LibRequests/RequestClient.h @@ -32,7 +32,7 @@ public: RefPtr start_request(ByteString const& method, URL::URL const&, HTTP::HeaderMap const& request_headers = {}, ReadonlyBytes request_body = {}, Core::ProxyData const& = {}); - RefPtr websocket_connect(const URL::URL&, ByteString const& origin = {}, Vector const& protocols = {}, Vector const& extensions = {}, HTTP::HeaderMap const& request_headers = {}); + RefPtr websocket_connect(URL::URL const&, ByteString const& origin = {}, Vector const& protocols = {}, Vector const& extensions = {}, HTTP::HeaderMap const& request_headers = {}); void ensure_connection(URL::URL const&, ::RequestServer::CacheLevel); diff --git a/Libraries/LibWeb/CSS/ComputedValues.h b/Libraries/LibWeb/CSS/ComputedValues.h index 32d9ff9fde0..7fb8e206d8c 100644 --- a/Libraries/LibWeb/CSS/ComputedValues.h +++ b/Libraries/LibWeb/CSS/ComputedValues.h @@ -546,8 +546,8 @@ public: CSS::ShapeRendering shape_rendering() const { return m_noninherited.shape_rendering; } CSS::LengthBox const& inset() const { return m_noninherited.inset; } - const CSS::LengthBox& margin() const { return m_noninherited.margin; } - const CSS::LengthBox& padding() const { return m_noninherited.padding; } + CSS::LengthBox const& margin() const { return m_noninherited.margin; } + CSS::LengthBox const& padding() const { return m_noninherited.padding; } BorderData const& border_left() const { return m_noninherited.border_left; } BorderData const& border_top() const { return m_noninherited.border_top; } @@ -555,10 +555,10 @@ public: BorderData const& border_bottom() const { return m_noninherited.border_bottom; } bool has_noninitial_border_radii() const { return m_noninherited.has_noninitial_border_radii; } - const CSS::BorderRadiusData& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; } - const CSS::BorderRadiusData& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; } - const CSS::BorderRadiusData& border_top_left_radius() const { return m_noninherited.border_top_left_radius; } - const CSS::BorderRadiusData& border_top_right_radius() const { return m_noninherited.border_top_right_radius; } + CSS::BorderRadiusData const& border_bottom_left_radius() const { return m_noninherited.border_bottom_left_radius; } + CSS::BorderRadiusData const& border_bottom_right_radius() const { return m_noninherited.border_bottom_right_radius; } + CSS::BorderRadiusData const& border_top_left_radius() const { return m_noninherited.border_top_left_radius; } + CSS::BorderRadiusData const& border_top_right_radius() const { return m_noninherited.border_top_right_radius; } CSS::Overflow overflow_x() const { return m_noninherited.overflow_x; } CSS::Overflow overflow_y() const { return m_noninherited.overflow_y; } @@ -921,8 +921,8 @@ public: void set_min_height(CSS::Size const& height) { m_noninherited.min_height = height; } void set_max_height(CSS::Size const& height) { m_noninherited.max_height = height; } void set_inset(CSS::LengthBox const& inset) { m_noninherited.inset = inset; } - void set_margin(const CSS::LengthBox& margin) { m_noninherited.margin = margin; } - void set_padding(const CSS::LengthBox& padding) { m_noninherited.padding = padding; } + void set_margin(CSS::LengthBox const& margin) { m_noninherited.margin = margin; } + void set_padding(CSS::LengthBox const& padding) { m_noninherited.padding = padding; } void set_overflow_x(CSS::Overflow value) { m_noninherited.overflow_x = value; } void set_overflow_y(CSS::Overflow value) { m_noninherited.overflow_y = value; } void set_list_style_type(CSS::ListStyleType value) { m_inherited.list_style_type = value; } diff --git a/Libraries/LibWeb/Cookie/Cookie.cpp b/Libraries/LibWeb/Cookie/Cookie.cpp index 223a9bcb945..341605ccb39 100644 --- a/Libraries/LibWeb/Cookie/Cookie.cpp +++ b/Libraries/LibWeb/Cookie/Cookie.cpp @@ -58,7 +58,7 @@ SameSite same_site_from_string(StringView same_site_mode) } // https://www.ietf.org/archive/id/draft-ietf-httpbis-rfc6265bis-15.html#section-5.1.2 -Optional canonicalize_domain(const URL::URL& url) +Optional canonicalize_domain(URL::URL const& url) { if (!url.host().has_value()) return {}; diff --git a/Libraries/LibWeb/Cookie/Cookie.h b/Libraries/LibWeb/Cookie/Cookie.h index 71c5998b3cd..6e0b9b42328 100644 --- a/Libraries/LibWeb/Cookie/Cookie.h +++ b/Libraries/LibWeb/Cookie/Cookie.h @@ -48,7 +48,7 @@ struct WEB_API Cookie { WEB_API StringView same_site_to_string(SameSite same_site_mode); WEB_API SameSite same_site_from_string(StringView same_site_mode); -WEB_API Optional canonicalize_domain(const URL::URL& url); +WEB_API Optional canonicalize_domain(URL::URL const& url); WEB_API bool path_matches(StringView request_path, StringView cookie_path); } diff --git a/Libraries/LibWeb/DOM/Document.cpp b/Libraries/LibWeb/DOM/Document.cpp index abf5cc2f8ac..fdbe3b592d7 100644 --- a/Libraries/LibWeb/DOM/Document.cpp +++ b/Libraries/LibWeb/DOM/Document.cpp @@ -458,7 +458,7 @@ GC::Ref Document::create_for_fragment_parsing(JS::Realm& realm) return realm.create(realm, URL::about_blank(), TemporaryDocumentForFragmentParsing::Yes); } -Document::Document(JS::Realm& realm, const URL::URL& url, TemporaryDocumentForFragmentParsing temporary_document_for_fragment_parsing) +Document::Document(JS::Realm& realm, URL::URL const& url, TemporaryDocumentForFragmentParsing temporary_document_for_fragment_parsing) : ParentNode(realm, *this, NodeType::DOCUMENT_NODE) , m_page(Bindings::principal_host_defined_page(realm)) , m_style_computer(realm.heap().allocate(*this)) diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index 54f21703f43..50c9bf4fb92 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -246,7 +246,7 @@ public: Optional encoding_parse_and_serialize_url(StringView) const; CSS::StyleComputer& style_computer() { return *m_style_computer; } - const CSS::StyleComputer& style_computer() const { return *m_style_computer; } + CSS::StyleComputer const& style_computer() const { return *m_style_computer; } CSS::StyleSheetList& style_sheets(); CSS::StyleSheetList const& style_sheets() const; diff --git a/Libraries/LibWeb/DOM/Element.cpp b/Libraries/LibWeb/DOM/Element.cpp index a29fc6a2f02..da53e433556 100644 --- a/Libraries/LibWeb/DOM/Element.cpp +++ b/Libraries/LibWeb/DOM/Element.cpp @@ -3398,7 +3398,7 @@ i32 Element::ordinal_value() auto reversed = false; if (owner->is_html_olist_element()) { - auto const* ol_element = static_cast(owner); + auto const* ol_element = static_cast(owner); numbering = ol_element->starting_value().value(); reversed = ol_element->has_attribute(HTML::AttributeNames::reversed); } diff --git a/Libraries/LibWeb/DOM/Node.cpp b/Libraries/LibWeb/DOM/Node.cpp index 8877a8fae53..d24d426e1a4 100644 --- a/Libraries/LibWeb/DOM/Node.cpp +++ b/Libraries/LibWeb/DOM/Node.cpp @@ -133,7 +133,7 @@ String Node::base_uri() const return document().base_url().to_string(); } -const HTML::HTMLAnchorElement* Node::enclosing_link_element() const +HTML::HTMLAnchorElement const* Node::enclosing_link_element() const { for (auto* node = this; node; node = node->parent()) { auto const* anchor_element = as_if(*node); @@ -145,12 +145,12 @@ const HTML::HTMLAnchorElement* Node::enclosing_link_element() const return nullptr; } -const HTML::HTMLElement* Node::enclosing_html_element() const +HTML::HTMLElement const* Node::enclosing_html_element() const { return first_ancestor_of_type(); } -const HTML::HTMLElement* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const +HTML::HTMLElement const* Node::enclosing_html_element_with_attribute(FlyString const& attribute) const { for (auto* node = this; node; node = node->parent()) { if (auto* html_element = as_if(*node); html_element && html_element->has_attribute(attribute)) diff --git a/Libraries/LibWeb/DOM/Node.h b/Libraries/LibWeb/DOM/Node.h index 86b2043dd45..0c46419a367 100644 --- a/Libraries/LibWeb/DOM/Node.h +++ b/Libraries/LibWeb/DOM/Node.h @@ -291,9 +291,9 @@ public: GC::Ptr owner_document() const; - const HTML::HTMLAnchorElement* enclosing_link_element() const; - const HTML::HTMLElement* enclosing_html_element() const; - const HTML::HTMLElement* enclosing_html_element_with_attribute(FlyString const&) const; + HTML::HTMLAnchorElement const* enclosing_link_element() const; + HTML::HTMLElement const* enclosing_html_element() const; + HTML::HTMLElement const* enclosing_html_element_with_attribute(FlyString const&) const; Utf16String child_text_content() const; diff --git a/Libraries/LibWeb/DOM/ParentNode.cpp b/Libraries/LibWeb/DOM/ParentNode.cpp index 27e6c604584..f2d87122005 100644 --- a/Libraries/LibWeb/DOM/ParentNode.cpp +++ b/Libraries/LibWeb/DOM/ParentNode.cpp @@ -23,7 +23,7 @@ namespace Web::DOM { GC_DEFINE_ALLOCATOR(ParentNode); -static bool contains_named_namespace(const CSS::SelectorList& selectors) +static bool contains_named_namespace(CSS::SelectorList const& selectors) { for (auto const& selector : selectors) { for (auto const& compound_selector : selector->compound_selectors()) { diff --git a/Libraries/LibWeb/DOMURL/DOMURL.cpp b/Libraries/LibWeb/DOMURL/DOMURL.cpp index f0e3e456a59..d59ac451b32 100644 --- a/Libraries/LibWeb/DOMURL/DOMURL.cpp +++ b/Libraries/LibWeb/DOMURL/DOMURL.cpp @@ -467,13 +467,13 @@ Optional parse(StringView input, Optional base_url, O if (blob_url_entry.has_value()) { url->set_blob_url_entry(URL::BlobURLEntry { .object = blob_url_entry->object.visit( - [](const GC::Root& blob) -> URL::BlobURLEntry::Object { + [](GC::Root const& blob) -> URL::BlobURLEntry::Object { return URL::BlobURLEntry::Blob { .type = blob->type(), .data = MUST(ByteBuffer::copy(blob->raw_bytes())), }; }, - [](const GC::Root&) -> URL::BlobURLEntry::Object { return URL::BlobURLEntry::MediaSource {}; }), + [](GC::Root const&) -> URL::BlobURLEntry::Object { return URL::BlobURLEntry::MediaSource {}; }), .environment { .origin = blob_url_entry->environment->origin() }, }); } diff --git a/Libraries/LibWeb/FileAPI/Blob.cpp b/Libraries/LibWeb/FileAPI/Blob.cpp index c4c5293cf6b..93de7567c3a 100644 --- a/Libraries/LibWeb/FileAPI/Blob.cpp +++ b/Libraries/LibWeb/FileAPI/Blob.cpp @@ -386,7 +386,7 @@ GC::Ref Blob::text() return WebIDL::upon_fulfillment(*promise, GC::create_function(heap(), [&vm](JS::Value first_argument) -> WebIDL::ExceptionOr { auto const& object = first_argument.as_object(); VERIFY(is(object)); - auto const& buffer = static_cast(object).buffer(); + auto const& buffer = static_cast(object).buffer(); auto decoder = TextCodec::decoder_for("UTF-8"sv); auto utf8_text = TRY_OR_THROW_OOM(vm, TextCodec::convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(*decoder, buffer)); @@ -415,7 +415,7 @@ GC::Ref Blob::array_buffer() return WebIDL::upon_fulfillment(*promise, GC::create_function(heap(), [&realm](JS::Value first_argument) -> WebIDL::ExceptionOr { auto const& object = first_argument.as_object(); VERIFY(is(object)); - auto const& buffer = static_cast(object).buffer(); + auto const& buffer = static_cast(object).buffer(); return JS::ArrayBuffer::create(realm, buffer); })); diff --git a/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index d49e1704204..ea838cd0dee 100644 --- a/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -510,7 +510,7 @@ void HTMLDialogElement::invoker_command_steps(DOM::Element& invoker, String& com } // https://html.spec.whatwg.org/multipage/interactive-elements.html#nearest-clicked-dialog -GC::Ptr HTMLDialogElement::nearest_clicked_dialog(UIEvents::PointerEvent const& event, const GC::Ptr target) +GC::Ptr HTMLDialogElement::nearest_clicked_dialog(UIEvents::PointerEvent const& event, GC::Ptr const target) { // To find the nearest clicked dialog, given a PointerEvent event: @@ -542,7 +542,7 @@ GC::Ptr HTMLDialogElement::nearest_clicked_dialog(UIEvents::P } // https://html.spec.whatwg.org/multipage/interactive-elements.html#light-dismiss-open-dialogs -void HTMLDialogElement::light_dismiss_open_dialogs(UIEvents::PointerEvent const& event, const GC::Ptr target) +void HTMLDialogElement::light_dismiss_open_dialogs(UIEvents::PointerEvent const& event, GC::Ptr const target) { // To light dismiss open dialogs, given a PointerEvent event: diff --git a/Libraries/LibWeb/HTML/ImageData.cpp b/Libraries/LibWeb/HTML/ImageData.cpp index 96f695e2419..85d3e52ecc7 100644 --- a/Libraries/LibWeb/HTML/ImageData.cpp +++ b/Libraries/LibWeb/HTML/ImageData.cpp @@ -174,7 +174,7 @@ JS::Uint8ClampedArray* ImageData::data() return m_data; } -const JS::Uint8ClampedArray* ImageData::data() const +JS::Uint8ClampedArray const* ImageData::data() const { return m_data; } diff --git a/Libraries/LibWeb/HTML/ImageData.h b/Libraries/LibWeb/HTML/ImageData.h index 328540c590c..e89e2240aa7 100644 --- a/Libraries/LibWeb/HTML/ImageData.h +++ b/Libraries/LibWeb/HTML/ImageData.h @@ -42,7 +42,7 @@ public: Gfx::Bitmap const& bitmap() const { return *m_bitmap; } JS::Uint8ClampedArray* data(); - const JS::Uint8ClampedArray* data() const; + JS::Uint8ClampedArray const* data() const; Bindings::PredefinedColorSpace color_space() const { return m_color_space; } diff --git a/Libraries/LibWeb/HTML/NavigableContainer.cpp b/Libraries/LibWeb/HTML/NavigableContainer.cpp index a64a0a94d18..13a6157aee4 100644 --- a/Libraries/LibWeb/HTML/NavigableContainer.cpp +++ b/Libraries/LibWeb/HTML/NavigableContainer.cpp @@ -149,7 +149,7 @@ WebIDL::ExceptionOr NavigableContainer::create_new_child_navigable(GC::Ptr } // https://html.spec.whatwg.org/multipage/browsers.html#concept-bcc-content-document -const DOM::Document* NavigableContainer::content_document() const +DOM::Document const* NavigableContainer::content_document() const { // 1. If container's content navigable is null, then return null. if (m_content_navigable == nullptr) @@ -175,7 +175,7 @@ DOM::Document const* NavigableContainer::content_document_without_origin_check() } // https://html.spec.whatwg.org/multipage/embedded-content-other.html#dom-media-getsvgdocument -const DOM::Document* NavigableContainer::get_svg_document() const +DOM::Document const* NavigableContainer::get_svg_document() const { // 1. Let document be this element's content document. auto const* document = content_document(); diff --git a/Libraries/LibWeb/HTML/NavigableContainer.h b/Libraries/LibWeb/HTML/NavigableContainer.h index 8ab47b64f0f..7da85c65ce2 100644 --- a/Libraries/LibWeb/HTML/NavigableContainer.h +++ b/Libraries/LibWeb/HTML/NavigableContainer.h @@ -25,7 +25,7 @@ public: GC::Ptr content_navigable() { return m_content_navigable; } GC::Ptr content_navigable() const { return m_content_navigable.ptr(); } - const DOM::Document* content_document() const; + DOM::Document const* content_document() const; DOM::Document const* content_document_without_origin_check() const; HTML::WindowProxy* content_window(); diff --git a/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 851adee4df5..f025ae0ccfa 100644 --- a/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -260,7 +260,7 @@ void HTMLParser::run(HTMLTokenizer::StopAtInsertionPoint stop_at_insertion_point flush_character_insertions(); } -void HTMLParser::run(const URL::URL& url, HTMLTokenizer::StopAtInsertionPoint stop_at_insertion_point) +void HTMLParser::run(URL::URL const& url, HTMLTokenizer::StopAtInsertionPoint stop_at_insertion_point) { m_document->set_url(url); m_document->set_source(m_tokenizer.source()); diff --git a/Libraries/LibWeb/HTML/Parser/HTMLParser.h b/Libraries/LibWeb/HTML/Parser/HTMLParser.h index b06421532d2..2db8c1b4f24 100644 --- a/Libraries/LibWeb/HTML/Parser/HTMLParser.h +++ b/Libraries/LibWeb/HTML/Parser/HTMLParser.h @@ -66,7 +66,7 @@ public: static GC::Ref create(DOM::Document&, StringView input, StringView encoding); void run(HTMLTokenizer::StopAtInsertionPoint = HTMLTokenizer::StopAtInsertionPoint::No); - void run(const URL::URL&, HTMLTokenizer::StopAtInsertionPoint = HTMLTokenizer::StopAtInsertionPoint::No); + void run(URL::URL const&, HTMLTokenizer::StopAtInsertionPoint = HTMLTokenizer::StopAtInsertionPoint::No); static void the_end(GC::Ref, GC::Ptr = nullptr); diff --git a/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp b/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp index 342467a59c8..a9a6ab9451a 100644 --- a/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp +++ b/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.cpp @@ -28,7 +28,7 @@ void ListOfActiveFormattingElements::add_marker() m_entries.append({ nullptr }); } -bool ListOfActiveFormattingElements::contains(const DOM::Element& element) const +bool ListOfActiveFormattingElements::contains(DOM::Element const& element) const { for (auto& entry : m_entries) { if (entry.element.ptr() == &element) diff --git a/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h b/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h index 5dd56af00dd..ed8b83ac886 100644 --- a/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h +++ b/Libraries/LibWeb/HTML/Parser/ListOfActiveFormattingElements.h @@ -23,7 +23,7 @@ public: }; bool is_empty() const { return m_entries.is_empty(); } - bool contains(const DOM::Element&) const; + bool contains(DOM::Element const&) const; void add(DOM::Element& element); void add_marker(); diff --git a/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp b/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp index 2efe5bce987..ba65e08a2c6 100644 --- a/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp +++ b/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.cpp @@ -36,7 +36,7 @@ bool StackOfOpenElements::has_in_scope(FlyString const& tag_name) const return has_in_scope_impl(tag_name, s_base_list); } -bool StackOfOpenElements::has_in_scope_impl(const DOM::Element& target_node, Vector const& list) const +bool StackOfOpenElements::has_in_scope_impl(DOM::Element const& target_node, Vector const& list) const { for (auto& element : m_elements.in_reverse()) { if (element.ptr() == &target_node) @@ -47,7 +47,7 @@ bool StackOfOpenElements::has_in_scope_impl(const DOM::Element& target_node, Vec VERIFY_NOT_REACHED(); } -bool StackOfOpenElements::has_in_scope(const DOM::Element& target_node) const +bool StackOfOpenElements::has_in_scope(DOM::Element const& target_node) const { return has_in_scope_impl(target_node, s_base_list); } @@ -97,7 +97,7 @@ bool StackOfOpenElements::has_in_select_scope(FlyString const& tag_name) const VERIFY_NOT_REACHED(); } -bool StackOfOpenElements::contains(const DOM::Element& element) const +bool StackOfOpenElements::contains(DOM::Element const& element) const { for (auto& element_on_stack : m_elements) { if (&element == element_on_stack.ptr()) diff --git a/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h b/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h index 540a6224e63..b219b2ed727 100644 --- a/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h +++ b/Libraries/LibWeb/HTML/Parser/StackOfOpenElements.h @@ -32,7 +32,7 @@ public: void replace(DOM::Element const& to_remove, GC::Ref to_add); void insert_immediately_below(GC::Ref element_to_add, DOM::Element const& target); - const DOM::Element& current_node() const { return *m_elements.last(); } + DOM::Element const& current_node() const { return *m_elements.last(); } DOM::Element& current_node() { return *m_elements.last(); } bool has_in_scope(FlyString const& tag_name) const; @@ -41,9 +41,9 @@ public: bool has_in_list_item_scope(FlyString const& tag_name) const; bool has_in_select_scope(FlyString const& tag_name) const; - bool has_in_scope(const DOM::Element&) const; + bool has_in_scope(DOM::Element const&) const; - bool contains(const DOM::Element&) const; + bool contains(DOM::Element const&) const; [[nodiscard]] bool contains_template_element() const; auto const& elements() const { return m_elements; } @@ -64,7 +64,7 @@ public: private: bool has_in_scope_impl(FlyString const& tag_name, Vector const&) const; - bool has_in_scope_impl(const DOM::Element& target_node, Vector const&) const; + bool has_in_scope_impl(DOM::Element const& target_node, Vector const&) const; Vector> m_elements; }; diff --git a/Libraries/LibWeb/HTML/PotentialCORSRequest.h b/Libraries/LibWeb/HTML/PotentialCORSRequest.h index a36d981d1ef..d8bbfd5311b 100644 --- a/Libraries/LibWeb/HTML/PotentialCORSRequest.h +++ b/Libraries/LibWeb/HTML/PotentialCORSRequest.h @@ -19,6 +19,6 @@ enum class SameOriginFallbackFlag { Yes, }; -[[nodiscard]] WEB_API GC::Ref create_potential_CORS_request(JS::VM&, const URL::URL&, Optional, CORSSettingAttribute, SameOriginFallbackFlag = SameOriginFallbackFlag::No); +[[nodiscard]] WEB_API GC::Ref create_potential_CORS_request(JS::VM&, URL::URL const&, Optional, CORSSettingAttribute, SameOriginFallbackFlag = SameOriginFallbackFlag::No); } diff --git a/Libraries/LibWeb/HTML/Scripting/Fetching.cpp b/Libraries/LibWeb/HTML/Scripting/Fetching.cpp index 36a203b0cd7..1cab8d9dfc3 100644 --- a/Libraries/LibWeb/HTML/Scripting/Fetching.cpp +++ b/Libraries/LibWeb/HTML/Scripting/Fetching.cpp @@ -314,7 +314,7 @@ ScriptFetchOptions get_descendant_script_fetch_options(ScriptFetchOptions const& } // https://html.spec.whatwg.org/multipage/webappapis.html#resolving-a-module-integrity-metadata -String resolve_a_module_integrity_metadata(const URL::URL& url, EnvironmentSettingsObject& settings_object) +String resolve_a_module_integrity_metadata(URL::URL const& url, EnvironmentSettingsObject& settings_object) { // 1. Let map be settingsObject's global object's import map. auto map = as(settings_object.global_object()).import_map(); diff --git a/Libraries/LibWeb/HTML/TextTrackList.cpp b/Libraries/LibWeb/HTML/TextTrackList.cpp index cccde80f95e..b5d7eb24329 100644 --- a/Libraries/LibWeb/HTML/TextTrackList.cpp +++ b/Libraries/LibWeb/HTML/TextTrackList.cpp @@ -34,7 +34,7 @@ void TextTrackList::visit_edges(JS::Cell::Visitor& visitor) } // https://html.spec.whatwg.org/multipage/media.html#dom-texttracklist-item -JS::ThrowCompletionOr> TextTrackList::internal_get_own_property(const JS::PropertyKey& property_name) const +JS::ThrowCompletionOr> TextTrackList::internal_get_own_property(JS::PropertyKey const& property_name) const { // To determine the value of an indexed property of a TextTrackList object for a given index index, the user // agent must return the indexth text track in the list represented by the TextTrackList object. diff --git a/Libraries/LibWeb/Layout/BreakNode.h b/Libraries/LibWeb/Layout/BreakNode.h index a3a69225eb0..af5f7ddac3f 100644 --- a/Libraries/LibWeb/Layout/BreakNode.h +++ b/Libraries/LibWeb/Layout/BreakNode.h @@ -19,7 +19,7 @@ public: BreakNode(DOM::Document&, HTML::HTMLBRElement&, GC::Ref); virtual ~BreakNode() override; - const HTML::HTMLBRElement& dom_node() const { return as(*Node::dom_node()); } + HTML::HTMLBRElement const& dom_node() const { return as(*Node::dom_node()); } private: virtual bool is_break_node() const final { return true; } diff --git a/Libraries/LibWeb/Layout/FormattingContext.cpp b/Libraries/LibWeb/Layout/FormattingContext.cpp index a0aadb6a08b..80c185044b1 100644 --- a/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -886,7 +886,7 @@ void FormattingContext::compute_width_for_absolutely_positioned_replaced_element auto margin_right = computed_values.margin().right(); auto static_position = m_state.get(box).static_position(); - auto to_px = [&](const CSS::LengthPercentage& l) { + auto to_px = [&](CSS::LengthPercentage const& l) { return l.to_px(box, width_of_containing_block); }; @@ -1305,7 +1305,7 @@ void FormattingContext::compute_height_for_absolutely_positioned_replaced_elemen auto margin_bottom = computed_values.margin().bottom(); auto static_position = m_state.get(box).static_position(); - auto to_px = [&](const CSS::LengthPercentage& l) { + auto to_px = [&](CSS::LengthPercentage const& l) { return l.to_px(box, height_of_containing_block); }; diff --git a/Libraries/LibWeb/Layout/Label.h b/Libraries/LibWeb/Layout/Label.h index f8d4628c0ee..eac47035f11 100644 --- a/Libraries/LibWeb/Layout/Label.h +++ b/Libraries/LibWeb/Layout/Label.h @@ -23,7 +23,7 @@ public: static bool is_inside_associated_label(LabelableNode const&, CSSPixelPoint); static bool is_associated_label_hovered(LabelableNode const&); - const HTML::HTMLLabelElement& dom_node() const { return static_cast(*BlockContainer::dom_node()); } + HTML::HTMLLabelElement const& dom_node() const { return static_cast(*BlockContainer::dom_node()); } HTML::HTMLLabelElement& dom_node() { return static_cast(*BlockContainer::dom_node()); } void handle_mousedown_on_label(Badge, CSSPixelPoint, unsigned button); diff --git a/Libraries/LibWeb/Layout/Node.h b/Libraries/LibWeb/Layout/Node.h index 6fd5fc9f12c..5cbe2fb4266 100644 --- a/Libraries/LibWeb/Layout/Node.h +++ b/Libraries/LibWeb/Layout/Node.h @@ -247,7 +247,7 @@ public: Gfx::Font const& first_available_font() const; Vector const& background_layers() const { return computed_values().background_layers(); } - const CSS::AbstractImageStyleValue* list_style_image() const { return m_list_style_image; } + CSS::AbstractImageStyleValue const* list_style_image() const { return m_list_style_image; } GC::Ref create_anonymous_wrapper() const; @@ -334,7 +334,7 @@ inline Gfx::Font const& Node::font(float scale_factor) const return font.with_size(font.point_size() * scale_factor); } -inline const CSS::ImmutableComputedValues& Node::computed_values() const +inline CSS::ImmutableComputedValues const& Node::computed_values() const { VERIFY(has_style_or_parent_with_style()); diff --git a/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Libraries/LibWeb/Layout/TableFormattingContext.cpp index dfad251bdab..2979e612950 100644 --- a/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -1187,7 +1187,7 @@ bool TableFormattingContext::use_fixed_mode_layout() const return table_box().computed_values().table_layout() == CSS::TableLayout::Fixed && (width.is_length() || width.is_percentage() || width.is_min_content() || width.is_fit_content()); } -bool TableFormattingContext::border_is_less_specific(const CSS::BorderData& a, const CSS::BorderData& b) +bool TableFormattingContext::border_is_less_specific(CSS::BorderData const& a, CSS::BorderData const& b) { // Implements criteria for steps 1, 2 and 3 of border conflict resolution algorithm, as described in // https://www.w3.org/TR/CSS22/tables.html#border-conflict-resolution. @@ -1236,7 +1236,7 @@ bool TableFormattingContext::border_is_less_specific(const CSS::BorderData& a, c return false; } -const CSS::BorderData& TableFormattingContext::border_data_conflicting_edge(TableFormattingContext::ConflictingEdge const& conflicting_edge) +CSS::BorderData const& TableFormattingContext::border_data_conflicting_edge(TableFormattingContext::ConflictingEdge const& conflicting_edge) { auto const& style = conflicting_edge.element->computed_values(); switch (conflicting_edge.side) { diff --git a/Libraries/LibWeb/Layout/TableFormattingContext.h b/Libraries/LibWeb/Layout/TableFormattingContext.h index b91de915db1..66e43ac872b 100644 --- a/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -36,7 +36,7 @@ public: return as(*table_box().containing_block()); } - static bool border_is_less_specific(const CSS::BorderData& a, const CSS::BorderData& b); + static bool border_is_less_specific(CSS::BorderData const& a, CSS::BorderData const& b); virtual void parent_context_did_dimension_child_root_box() override; @@ -150,7 +150,7 @@ private: static TableFormattingContext::ConflictingEdge const& winning_conflicting_edge(TableFormattingContext::ConflictingEdge const& a, TableFormattingContext::ConflictingEdge const& b); - static const CSS::BorderData& border_data_conflicting_edge(ConflictingEdge const& conflicting_edge); + static CSS::BorderData const& border_data_conflicting_edge(ConflictingEdge const& conflicting_edge); static Painting::PaintableBox::BorderDataWithElementKind const border_data_with_element_kind_from_conflicting_edge(ConflictingEdge const& conflicting_edge); class BorderConflictFinder { diff --git a/Libraries/LibWeb/Layout/TextNode.h b/Libraries/LibWeb/Layout/TextNode.h index 985811a627c..4d651b65953 100644 --- a/Libraries/LibWeb/Layout/TextNode.h +++ b/Libraries/LibWeb/Layout/TextNode.h @@ -25,7 +25,7 @@ public: TextNode(DOM::Document&, DOM::Text&); virtual ~TextNode() override; - const DOM::Text& dom_node() const { return static_cast(*Node::dom_node()); } + DOM::Text const& dom_node() const { return static_cast(*Node::dom_node()); } Utf16String const& text_for_rendering() const; diff --git a/Libraries/LibWeb/Layout/Viewport.h b/Libraries/LibWeb/Layout/Viewport.h index fb5385e1dd1..ca0591b916d 100644 --- a/Libraries/LibWeb/Layout/Viewport.h +++ b/Libraries/LibWeb/Layout/Viewport.h @@ -31,7 +31,7 @@ public: Vector const& text_blocks(); void invalidate_text_blocks_cache() { m_text_blocks.clear(); } - const DOM::Document& dom_node() const { return static_cast(*Node::dom_node()); } + DOM::Document const& dom_node() const { return static_cast(*Node::dom_node()); } virtual void visit_edges(Visitor&) override; diff --git a/Libraries/LibWeb/Loader/ContentFilter.cpp b/Libraries/LibWeb/Loader/ContentFilter.cpp index b55d23ad2bf..2428f7cd496 100644 --- a/Libraries/LibWeb/Loader/ContentFilter.cpp +++ b/Libraries/LibWeb/Loader/ContentFilter.cpp @@ -19,7 +19,7 @@ ContentFilter::ContentFilter() = default; ContentFilter::~ContentFilter() = default; -bool ContentFilter::is_filtered(const URL::URL& url) const +bool ContentFilter::is_filtered(URL::URL const& url) const { if (!filtering_enabled()) return false; diff --git a/Libraries/LibWeb/Loader/ContentFilter.h b/Libraries/LibWeb/Loader/ContentFilter.h index d1a00a95421..7fa53210bd3 100644 --- a/Libraries/LibWeb/Loader/ContentFilter.h +++ b/Libraries/LibWeb/Loader/ContentFilter.h @@ -20,7 +20,7 @@ public: bool filtering_enabled() const { return m_filtering_enabled; } void set_filtering_enabled(bool const enabled) { m_filtering_enabled = enabled; } - bool is_filtered(const URL::URL&) const; + bool is_filtered(URL::URL const&) const; ErrorOr set_patterns(ReadonlySpan); private: diff --git a/Libraries/LibWeb/Loader/LoadRequest.cpp b/Libraries/LibWeb/Loader/LoadRequest.cpp index 434f6b05650..e97a86238dc 100644 --- a/Libraries/LibWeb/Loader/LoadRequest.cpp +++ b/Libraries/LibWeb/Loader/LoadRequest.cpp @@ -17,7 +17,7 @@ LoadRequest::LoadRequest() { } -LoadRequest LoadRequest::create_for_url_on_page(const URL::URL& url, Page* page) +LoadRequest LoadRequest::create_for_url_on_page(URL::URL const& url, Page* page) { LoadRequest request; request.set_url(url); diff --git a/Libraries/LibWeb/Loader/LoadRequest.h b/Libraries/LibWeb/Loader/LoadRequest.h index 0f2bc69a447..2940097672b 100644 --- a/Libraries/LibWeb/Loader/LoadRequest.h +++ b/Libraries/LibWeb/Loader/LoadRequest.h @@ -21,7 +21,7 @@ class WEB_API LoadRequest { public: LoadRequest(); - static LoadRequest create_for_url_on_page(const URL::URL& url, Page* page); + static LoadRequest create_for_url_on_page(URL::URL const& url, Page* page); // The main resource is the file being displayed in a frame (unlike subresources like images, scripts, etc.) // If a main resource fails with an HTTP error, we may still display its content if non-empty, e.g a custom 404 page. diff --git a/Libraries/LibWeb/Page/EventHandler.cpp b/Libraries/LibWeb/Page/EventHandler.cpp index 777c584719d..1a25b938a9a 100644 --- a/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Libraries/LibWeb/Page/EventHandler.cpp @@ -345,7 +345,7 @@ static void set_user_selection(GC::Ptr anchor_node, size_t anchor_off } // https://html.spec.whatwg.org/multipage/interactive-elements.html#run-light-dismiss-activities -static void light_dismiss_activities(UIEvents::PointerEvent const& event, const GC::Ptr target) +static void light_dismiss_activities(UIEvents::PointerEvent const& event, GC::Ptr const target) { // To run light dismiss activities, given a PointerEvent event: diff --git a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp index c1bdfeb84a6..951f4036afc 100644 --- a/Libraries/LibWeb/SVG/SVGSymbolElement.cpp +++ b/Libraries/LibWeb/SVG/SVGSymbolElement.cpp @@ -76,7 +76,7 @@ bool SVGSymbolElement::is_direct_child_of_use_shadow_tree() const return false; } - auto host = static_cast(*maybe_shadow_root).host(); + auto host = static_cast(*maybe_shadow_root).host(); return is(host); } diff --git a/Libraries/LibWeb/WebIDL/ExceptionOr.h b/Libraries/LibWeb/WebIDL/ExceptionOr.h index b5bbdf7a226..16dcb406618 100644 --- a/Libraries/LibWeb/WebIDL/ExceptionOr.h +++ b/Libraries/LibWeb/WebIDL/ExceptionOr.h @@ -170,7 +170,7 @@ struct Formatter : Formatter { if (value.is_object()) { auto& object = value.as_object(); - static const JS::PropertyKey message_property_key { "message"_utf16_fly_string }; + static JS::PropertyKey const message_property_key { "message"_utf16_fly_string }; auto has_message_or_error = object.has_own_property(message_property_key); if (!has_message_or_error.is_error() && has_message_or_error.value()) { auto message_object = object.get_without_side_effects(message_property_key); diff --git a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp index e4db8390cd5..5515b147504 100644 --- a/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp +++ b/Libraries/LibWeb/XML/XMLDocumentBuilder.cpp @@ -92,7 +92,7 @@ void XMLDocumentBuilder::set_doctype(XML::Doctype doctype) m_document->insert_before(document_type, m_document->first_child(), false); } -void XMLDocumentBuilder::element_start(const XML::Name& name, OrderedHashMap const& attributes) +void XMLDocumentBuilder::element_start(XML::Name const& name, OrderedHashMap const& attributes) { if (m_has_error) return; @@ -184,7 +184,7 @@ void XMLDocumentBuilder::element_start(const XML::Name& name, OrderedHashMap CookieJar::get_matching_cookies(const URL::URL& url, StringView canonicalized_domain, Web::Cookie::Source source, MatchingCookiesSpecMode mode) +Vector CookieJar::get_matching_cookies(URL::URL const& url, StringView canonicalized_domain, Web::Cookie::Source source, MatchingCookiesSpecMode mode) { auto now = UnixDateTime::now(); diff --git a/Libraries/LibWebView/CookieJar.h b/Libraries/LibWebView/CookieJar.h index 2177e14710f..6745b132b5e 100644 --- a/Libraries/LibWebView/CookieJar.h +++ b/Libraries/LibWebView/CookieJar.h @@ -87,8 +87,8 @@ public: ~CookieJar(); - String get_cookie(const URL::URL& url, Web::Cookie::Source source); - void set_cookie(const URL::URL& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source); + String get_cookie(URL::URL const& url, Web::Cookie::Source source); + void set_cookie(URL::URL const& url, Web::Cookie::ParsedCookie const& parsed_cookie, Web::Cookie::Source source); void update_cookie(Web::Cookie::Cookie); void dump_cookies(); void clear_all_cookies(); @@ -109,8 +109,8 @@ private: WebDriver, }; - void store_cookie(Web::Cookie::ParsedCookie const& parsed_cookie, const URL::URL& url, String canonicalized_domain, Web::Cookie::Source source); - Vector get_matching_cookies(const URL::URL& url, StringView canonicalized_domain, Web::Cookie::Source source, MatchingCookiesSpecMode mode = MatchingCookiesSpecMode::RFC6265); + void store_cookie(Web::Cookie::ParsedCookie const& parsed_cookie, URL::URL const& url, String canonicalized_domain, Web::Cookie::Source source); + Vector get_matching_cookies(URL::URL const& url, StringView canonicalized_domain, Web::Cookie::Source source, MatchingCookiesSpecMode mode = MatchingCookiesSpecMode::RFC6265); Optional m_persisted_storage; TransientStorage m_transient_storage; diff --git a/UI/Qt/Tab.cpp b/UI/Qt/Tab.cpp index 167605434cd..fe892fd59d1 100644 --- a/UI/Qt/Tab.cpp +++ b/UI/Qt/Tab.cpp @@ -142,7 +142,7 @@ Tab::Tab(BrowserWindow* window, RefPtr parent_client, m_hover_label->hide(); }; - view().on_load_start = [this](const URL::URL& url, bool) { + view().on_load_start = [this](URL::URL const& url, bool) { auto url_serialized = qstring_from_ak_string(url.serialize()); m_title = url_serialized; diff --git a/UI/Qt/WebContentView.h b/UI/Qt/WebContentView.h index 3e83e928d58..0763ff3d81b 100644 --- a/UI/Qt/WebContentView.h +++ b/UI/Qt/WebContentView.h @@ -55,7 +55,7 @@ public: WebContentView(QWidget* window, RefPtr parent_client = nullptr, size_t page_index = 0, WebContentViewInitialState initial_state = {}); virtual ~WebContentView() override; - Function on_tab_open_request; + Function on_tab_open_request; virtual void paintEvent(QPaintEvent*) override; virtual void resizeEvent(QResizeEvent*) override;