mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-28 11:49:44 +00:00
LibWeb: Remove MatchingRule::contains_root_pseudo_class member
This can be a local variable while building a rule cache, no need to take up space in MatchingRule.
This commit is contained in:
parent
c8f22f65d9
commit
49d2b11085
Notes:
github-actions[bot]
2024-09-09 18:13:17 +00:00
Author: https://github.com/awesomekling
Commit: 49d2b11085
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1345
2 changed files with 5 additions and 5 deletions
|
@ -2699,10 +2699,11 @@ NonnullOwnPtr<StyleComputer::RuleCache> StyleComputer::make_rule_cache_for_casca
|
|||
selector.specificity(),
|
||||
cascade_origin,
|
||||
false,
|
||||
false,
|
||||
SelectorEngine::can_use_fast_matches(selector),
|
||||
};
|
||||
|
||||
bool contains_root_pseudo_class = false;
|
||||
|
||||
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
||||
if (!matching_rule.contains_pseudo_element) {
|
||||
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoElement) {
|
||||
|
@ -2710,10 +2711,10 @@ NonnullOwnPtr<StyleComputer::RuleCache> StyleComputer::make_rule_cache_for_casca
|
|||
++num_pseudo_element_rules;
|
||||
}
|
||||
}
|
||||
if (!matching_rule.contains_root_pseudo_class) {
|
||||
if (!contains_root_pseudo_class) {
|
||||
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoClass
|
||||
&& simple_selector.pseudo_class().type == CSS::PseudoClass::Root) {
|
||||
matching_rule.contains_root_pseudo_class = true;
|
||||
contains_root_pseudo_class = true;
|
||||
++num_root_rules;
|
||||
}
|
||||
}
|
||||
|
@ -2752,7 +2753,7 @@ NonnullOwnPtr<StyleComputer::RuleCache> StyleComputer::make_rule_cache_for_casca
|
|||
if (!added_to_bucket) {
|
||||
if (matching_rule.contains_pseudo_element) {
|
||||
rule_cache->pseudo_element_rules.append(move(matching_rule));
|
||||
} else if (matching_rule.contains_root_pseudo_class) {
|
||||
} else if (contains_root_pseudo_class) {
|
||||
rule_cache->root_rules.append(move(matching_rule));
|
||||
} else {
|
||||
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue