mirror of
https://github.com/SerenityOS/serenity
synced 2026-05-05 06:32:26 +02:00
LibWeb: Filter :hover selectors early for elements that aren't hovered
Some websites (like vercel.com...) have a *lot* of :hover selectors that we can simply skip for any element that isn't currently hovered. (cherry picked from commit ef4f5ac8fb761f43839e9fbd753716a57544c795)
This commit is contained in:
committed by
Nico Weber
parent
318d53e9b4
commit
417d2005a9
@@ -140,7 +140,7 @@ static inline bool matches_link_pseudo_class(DOM::Element const& element)
|
||||
return element.has_attribute(HTML::AttributeNames::href);
|
||||
}
|
||||
|
||||
static inline bool matches_hover_pseudo_class(DOM::Element const& element)
|
||||
bool matches_hover_pseudo_class(DOM::Element const& element)
|
||||
{
|
||||
auto* hovered_node = element.document().hovered_node();
|
||||
if (!hovered_node)
|
||||
|
||||
Reference in New Issue
Block a user