diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index cede5c8531..4767b385c1 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -1468,7 +1468,7 @@ WebIDL::ExceptionOr Element::insert_adjacent_html(String const& position, } // https://dom.spec.whatwg.org/#insert-adjacent -WebIDL::ExceptionOr> Element::insert_adjacent(ByteString const& where, JS::NonnullGCPtr node) +WebIDL::ExceptionOr> Element::insert_adjacent(StringView where, JS::NonnullGCPtr node) { // To insert adjacent, given an element element, string where, and a node node, run the steps associated with the first ASCII case-insensitive match for where: if (Infra::is_ascii_case_insensitive_match(where, "beforebegin"sv)) { @@ -1512,7 +1512,7 @@ WebIDL::ExceptionOr> Element::insert_adjacent(ByteString const& WebIDL::ExceptionOr> Element::insert_adjacent_element(String const& where, JS::NonnullGCPtr element) { // The insertAdjacentElement(where, element) method steps are to return the result of running insert adjacent, give this, where, and element. - auto returned_node = TRY(insert_adjacent(where.to_byte_string(), move(element))); + auto returned_node = TRY(insert_adjacent(where, element)); if (!returned_node) return JS::GCPtr { nullptr }; return JS::GCPtr { verify_cast(*returned_node) }; @@ -1526,7 +1526,7 @@ WebIDL::ExceptionOr Element::insert_adjacent_text(String const& where, Str // 2. Run insert adjacent, given this, where, and text. // Spec Note: This method returns nothing because it existed before we had a chance to design it. - (void)TRY(insert_adjacent(where.to_byte_string(), text)); + (void)TRY(insert_adjacent(where, text)); return {}; } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 2f7e4a504d..d14a94f6be 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -391,7 +391,7 @@ private: void invalidate_style_after_attribute_change(FlyString const& attribute_name); - WebIDL::ExceptionOr> insert_adjacent(ByteString const& where, JS::NonnullGCPtr node); + WebIDL::ExceptionOr> insert_adjacent(StringView where, JS::NonnullGCPtr node); void enqueue_an_element_on_the_appropriate_element_queue();