From d00c030fce9af1727bf68ffe3620c6d68f823c0a Mon Sep 17 00:00:00 2001 From: Shannon Booth Date: Sun, 5 Nov 2023 11:43:00 +1300 Subject: [PATCH] LibWeb: Port Element::set_attribute_value namespace to FlyString --- Userland/Libraries/LibWeb/DOM/Element.cpp | 4 ++-- Userland/Libraries/LibWeb/DOM/Element.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 8d3f00763c..0604117571 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -265,7 +265,7 @@ WebIDL::ExceptionOr Element::set_attribute_ns(Optional const& name auto extracted_qualified_name = TRY(validate_and_extract(realm(), namespace_to_use, qualified_name.to_deprecated_fly_string())); // 2. Set an attribute value for this using localName, value, and also prefix and namespace. - set_attribute_value(extracted_qualified_name.local_name(), value.to_deprecated_fly_string(), extracted_qualified_name.prefix(), extracted_qualified_name.deprecated_namespace_()); + set_attribute_value(extracted_qualified_name.local_name(), value.to_deprecated_fly_string(), extracted_qualified_name.prefix(), extracted_qualified_name.namespace_()); return {}; } @@ -277,7 +277,7 @@ void Element::append_attribute(Attr& attribute) } // https://dom.spec.whatwg.org/#concept-element-attributes-set-value -void Element::set_attribute_value(FlyString const& local_name, DeprecatedString const& value, Optional const& prefix, DeprecatedFlyString const& namespace_) +void Element::set_attribute_value(FlyString const& local_name, DeprecatedString const& value, Optional const& prefix, Optional const& namespace_) { // 1. Let attribute be the result of getting an attribute given namespace, localName, and element. auto* attribute = m_attributes->get_attribute_ns(namespace_, local_name); diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index d4c4eb4ce0..5577a6c299 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -118,7 +118,7 @@ public: // FIXME: This should be taking an Optional WebIDL::ExceptionOr set_attribute_ns(Optional const& namespace_, FlyString const& qualified_name, FlyString const& value); - void set_attribute_value(FlyString const& local_name, DeprecatedString const& value, Optional const& prefix = {}, DeprecatedFlyString const& namespace_ = {}); + void set_attribute_value(FlyString const& local_name, DeprecatedString const& value, Optional const& prefix = {}, Optional const& namespace_ = {}); WebIDL::ExceptionOr> set_attribute_node(Attr&); WebIDL::ExceptionOr> set_attribute_node_ns(Attr&);