mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
LibWeb: Avoid copying the CSS @namespace every time we run a selector
This commit is contained in:
parent
a378303629
commit
038e0ceee7
Notes:
sideshowbarker
2024-07-16 23:23:26 +09:00
Author: https://github.com/awesomekling
Commit: 038e0ceee7
Pull-request: https://github.com/SerenityOS/serenity/pull/23602
2 changed files with 5 additions and 3 deletions
|
@ -295,9 +295,9 @@ StyleComputer::RuleCache const& StyleComputer::rule_cache_for_cascade_origin(Cas
|
|||
[[nodiscard]] static bool filter_namespace_rule(DOM::Element const& element, MatchingRule const& rule)
|
||||
{
|
||||
// FIXME: Filter out non-default namespace using prefixes
|
||||
auto namespace_uri = rule.sheet->default_namespace();
|
||||
if (namespace_uri.has_value() && namespace_uri.value() != element.namespace_uri()) {
|
||||
return false;
|
||||
if (auto namespace_rule = rule.sheet->default_namespace_rule()) {
|
||||
if (namespace_rule->namespace_uri() != element.namespace_uri())
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue