From e5e4920e66886399e229b5e838c4405cec7cd473 Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 1 Oct 2023 15:10:40 +1300 Subject: [PATCH] LibWeb: Make Element::has_attribute_ns take a StringView Similar to Element::has_attribute, ideally this would take a `FlyString const&`, but NamedNodeMap::get_attribute_ns already takes a StringView. To aid in porting away from DeprecatedString, just take a StringView for now. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Element.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 164ef4c4dd..a8f2a4b4c4 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -310,7 +310,7 @@ bool Element::has_attribute(StringView name) const } // https://dom.spec.whatwg.org/#dom-element-hasattributens -bool Element::has_attribute_ns(DeprecatedFlyString namespace_, DeprecatedFlyString const& name) const +bool Element::has_attribute_ns(StringView namespace_, StringView name) const { // 1. If namespace is the empty string, then set it to null. if (namespace_.is_empty()) diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 3abe140779..d703c6b405 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -93,7 +93,7 @@ public: // FIXME: This should be taking a 'FlyString const&' bool has_attribute(StringView name) const; - bool has_attribute_ns(DeprecatedFlyString namespace_, DeprecatedFlyString const& name) const; + bool has_attribute_ns(StringView namespace_, StringView name) const; bool has_attributes() const; // FIXME: This should be taking a 'FlyString const&'