mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 20:29:18 +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(),
|
selector.specificity(),
|
||||||
cascade_origin,
|
cascade_origin,
|
||||||
false,
|
false,
|
||||||
false,
|
|
||||||
SelectorEngine::can_use_fast_matches(selector),
|
SelectorEngine::can_use_fast_matches(selector),
|
||||||
};
|
};
|
||||||
|
|
||||||
|
bool contains_root_pseudo_class = false;
|
||||||
|
|
||||||
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
||||||
if (!matching_rule.contains_pseudo_element) {
|
if (!matching_rule.contains_pseudo_element) {
|
||||||
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoElement) {
|
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;
|
++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
|
if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoClass
|
||||||
&& simple_selector.pseudo_class().type == CSS::PseudoClass::Root) {
|
&& simple_selector.pseudo_class().type == CSS::PseudoClass::Root) {
|
||||||
matching_rule.contains_root_pseudo_class = true;
|
contains_root_pseudo_class = true;
|
||||||
++num_root_rules;
|
++num_root_rules;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2752,7 +2753,7 @@ NonnullOwnPtr<StyleComputer::RuleCache> StyleComputer::make_rule_cache_for_casca
|
||||||
if (!added_to_bucket) {
|
if (!added_to_bucket) {
|
||||||
if (matching_rule.contains_pseudo_element) {
|
if (matching_rule.contains_pseudo_element) {
|
||||||
rule_cache->pseudo_element_rules.append(move(matching_rule));
|
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));
|
rule_cache->root_rules.append(move(matching_rule));
|
||||||
} else {
|
} else {
|
||||||
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
for (auto const& simple_selector : selector.compound_selectors().last().simple_selectors) {
|
||||||
|
|
|
@ -91,7 +91,6 @@ struct MatchingRule {
|
||||||
u32 specificity { 0 };
|
u32 specificity { 0 };
|
||||||
CascadeOrigin cascade_origin;
|
CascadeOrigin cascade_origin;
|
||||||
bool contains_pseudo_element { false };
|
bool contains_pseudo_element { false };
|
||||||
bool contains_root_pseudo_class { false };
|
|
||||||
bool can_use_fast_matches { false };
|
bool can_use_fast_matches { false };
|
||||||
bool skip { false };
|
bool skip { false };
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue