mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-02 22:29:10 +00:00
LibWeb: Avoid FlyString copy when matching tag selector namespace URI
This commit is contained in:
parent
e3e6af39bc
commit
22465e80fe
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/awesomekling
Commit: 22465e80fe
Pull-request: https://github.com/SerenityOS/serenity/pull/23634
Reviewed-by: https://github.com/AtkinsSJ ✅
1 changed files with 2 additions and 2 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue