mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-25 04:22:50 +00:00
LibWeb: Make :hover invalidation logic reusable for all pseudo classes
We achieve this by keeping track of all checked pseudo class selectors in the SelectorEngine code. We also give StyleComputer per-pseudo-class rule caches.
This commit is contained in:
parent
ed35f9e7c2
commit
e1777f6e79
Notes:
github-actions[bot]
2025-04-17 17:47:22 +00:00
Author: https://github.com/awesomekling
Commit: e1777f6e79
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4388
13 changed files with 134 additions and 59 deletions
|
@ -101,16 +101,12 @@ Selector::Selector(Vector<CompoundSelector>&& compound_selectors)
|
|||
break;
|
||||
}
|
||||
if (simple_selector.type == SimpleSelector::Type::PseudoClass) {
|
||||
if (simple_selector.pseudo_class().type == PseudoClass::Hover) {
|
||||
m_contains_hover_pseudo_class = true;
|
||||
}
|
||||
m_contained_pseudo_classes.set(simple_selector.pseudo_class().type, true);
|
||||
for (auto const& child_selector : simple_selector.pseudo_class().argument_selector_list) {
|
||||
if (child_selector->contains_the_nesting_selector()) {
|
||||
m_contains_the_nesting_selector = true;
|
||||
}
|
||||
if (child_selector->contains_hover_pseudo_class()) {
|
||||
m_contains_hover_pseudo_class = true;
|
||||
}
|
||||
m_contained_pseudo_classes |= child_selector->m_contained_pseudo_classes;
|
||||
}
|
||||
if (m_contains_the_nesting_selector)
|
||||
break;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue