From e42bda5f192e94f23f030e24e0b86b48c58b3183 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Tue, 12 Sep 2023 22:29:43 +1200 Subject: [PATCH] LibWeb: Make Document::open functions take a StringView One of these functions doesn't make any use of the arguments at all, and the other defers to an open helper which already takes a StringView. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 4 ++-- Userland/Libraries/LibWeb/DOM/Document.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 1fbd23eba0..242662e5ee 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -464,7 +464,7 @@ WebIDL::ExceptionOr Document::run_the_document_write_steps(DeprecatedStrin } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open -WebIDL::ExceptionOr Document::open(DeprecatedString const&, DeprecatedString const&) +WebIDL::ExceptionOr Document::open(StringView, StringView) { // 1. If document is an XML document, then throw an "InvalidStateError" DOMException exception. if (m_type == Type::XML) @@ -535,7 +535,7 @@ WebIDL::ExceptionOr Document::open(DeprecatedString const&, Deprecate } // https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-document-open-window -WebIDL::ExceptionOr> Document::open(DeprecatedString const& url, DeprecatedString const& name, DeprecatedString const& features) +WebIDL::ExceptionOr> Document::open(StringView url, StringView name, StringView features) { // 1. If this is not fully active, then throw an "InvalidAccessError" DOMException exception. if (!is_fully_active()) diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 75fad76b84..986e1f1cb6 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -319,8 +319,8 @@ public: WebIDL::ExceptionOr write(Vector const& strings); WebIDL::ExceptionOr writeln(Vector const& strings); - WebIDL::ExceptionOr open(DeprecatedString const& = "", DeprecatedString const& = ""); - WebIDL::ExceptionOr> open(DeprecatedString const& url, DeprecatedString const& name, DeprecatedString const& features); + WebIDL::ExceptionOr open(StringView = ""sv, StringView = ""sv); + WebIDL::ExceptionOr> open(StringView url, StringView name, StringView features); WebIDL::ExceptionOr close(); HTML::Window* default_view() { return m_window.ptr(); }