Only mark an element itself dirty for interaction pseudo-class changes when matching rules can plausibly match that element. Check every style scope observing the element, and keep the normal invalidation plan for descendants and siblings. Treat pseudo-elements as neutral during the plausibility check so rules like a:hover::before still invalidate the originating element. Add text coverage for non-matching hover rules and pseudo-element hover changes.
30 lines
590 B
C++
30 lines
590 B
C++
/*
|
|
* Copyright (c) 2026-present, the Ladybird developers
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <AK/Optional.h>
|
|
#include <LibWeb/CSS/PseudoClass.h>
|
|
#include <LibWeb/CSS/Selector.h>
|
|
|
|
namespace Web::DOM {
|
|
|
|
class Element;
|
|
|
|
}
|
|
|
|
namespace Web::CSS {
|
|
|
|
class InvalidationSet;
|
|
|
|
}
|
|
|
|
namespace Web::CSS::Invalidation {
|
|
|
|
bool compound_may_match_element(DOM::Element const&, CSS::Selector::CompoundSelector const&, Optional<CSS::PseudoClass> ignored_pseudo_class = {});
|
|
bool element_matches_any_invalidation_set_property(DOM::Element const&, InvalidationSet const&);
|
|
|
|
}
|