LibWeb: Match styles for pseudo-elements

Since each selector can only have zero or one pseudo-element, we match
against it as a separate step, before matching the rest of the
selector. This should be faster, but mostly I did this because I could
not figure out how else to stop selectors without a pseudo-element from
matching the pseudo-element, eg so `.foo` styles don't affect
`.foo::before`.
This commit is contained in:
Sam Atkins 2022-02-24 15:54:12 +00:00 committed by Andreas Kling
commit 7eb7396f8b
Notes: sideshowbarker 2024-07-17 18:17:54 +09:00
6 changed files with 86 additions and 49 deletions

View file

@ -11,6 +11,6 @@
namespace Web::SelectorEngine {
bool matches(CSS::Selector const&, DOM::Element const&);
bool matches(CSS::Selector const&, DOM::Element const&, Optional<CSS::Selector::PseudoElement> = {});
}