diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 3dd4a0753f..e2cb5456f8 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -562,10 +562,10 @@ static inline bool matches(CSS::Selector::SimpleSelector const& component, Optio if (!style_sheet_for_rule.has_value() || !style_sheet_for_rule->default_namespace().has_value()) return true; // "Otherwise it is equivalent to ns|E where ns is the default namespace." - return element.namespace_() == style_sheet_for_rule->default_namespace(); + return element.namespace_uri() == style_sheet_for_rule->default_namespace(); case CSS::Selector::SimpleSelector::QualifiedName::NamespaceType::None: // "elements with name E without a namespace" - return element.namespace_().is_empty(); + return !element.namespace_uri().has_value(); case CSS::Selector::SimpleSelector::QualifiedName::NamespaceType::Any: // "elements with name E in any namespace, including those without a namespace" return true; @@ -578,7 +578,7 @@ static inline bool matches(CSS::Selector::SimpleSelector const& component, Optio return false; auto selector_namespace = style_sheet_for_rule->namespace_uri(qualified_name.namespace_); - return selector_namespace.has_value() && selector_namespace.value() == element.namespace_(); + return selector_namespace.has_value() && selector_namespace.value() == element.namespace_uri(); } VERIFY_NOT_REACHED(); } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 5577a6c299..9a3e7cfed4 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -90,8 +90,6 @@ public: void set_prefix(Optional value); - DeprecatedFlyString namespace_() const { return m_qualified_name.deprecated_namespace_(); } - // NOTE: This is for the JS bindings Optional const& namespace_uri() const { return m_qualified_name.namespace_(); } diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index fada450841..d2de1f7032 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -1379,7 +1379,7 @@ bool Node::is_equal_node(Node const* other_node) const // Its namespace, namespace prefix, local name, and its attribute list’s size. auto& this_element = verify_cast(*this); auto& other_element = verify_cast(*other_node); - if (this_element.namespace_() != other_element.namespace_() + if (this_element.namespace_uri() != other_element.namespace_uri() || this_element.prefix() != other_element.prefix() || this_element.local_name() != other_element.local_name() || this_element.attribute_list_size() != other_element.attribute_list_size()) diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index dd14b40c84..2cb90e409b 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -3915,7 +3915,7 @@ DeprecatedString HTMLParser::serialize_html_fragment(DOM::Node const& node) // Otherwise, let tagname be current node's qualified name. FlyString tag_name; - if (element.namespace_().is_one_of(Namespace::HTML, Namespace::MathML, Namespace::SVG)) + if (element.namespace_uri().has_value() && element.namespace_uri()->is_one_of(Namespace::HTML, Namespace::MathML, Namespace::SVG)) tag_name = element.local_name(); else tag_name = element.qualified_name();