diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 74780f684a..ff1eed3ac0 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1963,7 +1963,7 @@ DeprecatedString Document::cookie(Cookie::Source source) { if (auto* page = this->page()) return page->client().page_did_request_cookie(m_url, source); - return {}; + return DeprecatedString::empty(); } void Document::set_cookie(StringView cookie_string, Cookie::Source source) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index e77c260508..745d742981 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -150,7 +150,7 @@ DeprecatedString Element::deprecated_get_attribute(StringView name) const { auto maybe_attribute = get_attribute(name); if (!maybe_attribute.has_value()) - return {}; + return DeprecatedString::empty(); return maybe_attribute->to_deprecated_string(); } diff --git a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp index 6ff1be43df..612e73d15e 100644 --- a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp +++ b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp @@ -170,9 +170,9 @@ JS::NonnullGCPtr ParentNode::get_elements_by_tag_name_ns(Depreca auto local_name = MUST(FlyString::from_deprecated_fly_string(deprecated_local_name)); // 1. If namespace is the empty string, set it to null. - DeprecatedString namespace_ = nullable_namespace; - if (namespace_.is_empty()) - namespace_ = {}; + DeprecatedFlyString namespace_; + if (!nullable_namespace.is_null() && !nullable_namespace.is_empty()) + namespace_ = nullable_namespace; // 2. If both namespace and localName are "*" (U+002A), return a HTMLCollection rooted at root, whose filter matches descendant elements. if (namespace_ == "*" && local_name == "*") { diff --git a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp index 039ca5c62b..9fe3b371ac 100644 --- a/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/FormAssociatedElement.cpp @@ -102,9 +102,9 @@ void FormAssociatedElement::reset_form_owner() // 4. If element is listed, has a form content attribute, and is connected, then: if (is_listed() && html_element.has_attribute(HTML::AttributeNames::form) && html_element.is_connected()) { // 1. If the first element in element's tree, in tree order, to have an ID that is identical to element's form content attribute's value, is a form element, then associate the element with that form element. - auto form_value = html_element.deprecated_attribute(HTML::AttributeNames::form); + auto form_value = html_element.attribute(HTML::AttributeNames::form); html_element.root().for_each_in_inclusive_subtree_of_type([this, &form_value](HTMLFormElement& form_element) { - if (form_element.deprecated_attribute(HTML::AttributeNames::id) == form_value) { + if (form_element.attribute(HTML::AttributeNames::id) == form_value) { set_form(&form_element); return IterationDecision::Break; }