From 22465e80fef0138cc4112f5fee08496ce5a5a9e1 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 18 Mar 2024 15:54:40 +0100 Subject: [PATCH] LibWeb: Avoid FlyString copy when matching tag selector namespace URI --- Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp index 7d06318f6d8..720b06269ad 100644 --- a/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp +++ b/Userland/Libraries/LibWeb/CSS/SelectorEngine.cpp @@ -569,10 +569,10 @@ static inline bool matches(CSS::Selector::SimpleSelector const& component, Optio switch (qualified_name.namespace_type) { case CSS::Selector::SimpleSelector::QualifiedName::NamespaceType::Default: // "if no default namespace has been declared for selectors, this is equivalent to *|E." - if (!style_sheet_for_rule.has_value() || !style_sheet_for_rule->default_namespace().has_value()) + if (!style_sheet_for_rule.has_value() || !style_sheet_for_rule->default_namespace_rule()) return true; // "Otherwise it is equivalent to ns|E where ns is the default namespace." - return element.namespace_uri() == style_sheet_for_rule->default_namespace(); + return element.namespace_uri() == style_sheet_for_rule->default_namespace_rule()->namespace_uri(); case CSS::Selector::SimpleSelector::QualifiedName::NamespaceType::None: // "elements with name E without a namespace" return !element.namespace_uri().has_value();