mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-29 07:48:47 +00:00
The traversal for these was incorrect and awkward. Now it's less incorrect but still very awkward. We should find better ways to implement this, but for now this at least passes many more WPT tests.
26 lines
952 B
C++
26 lines
952 B
C++
/*
|
|
* Copyright (c) 2018-2024, Andreas Kling <andreas@ladybird.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/CSS/Selector.h>
|
|
#include <LibWeb/DOM/Element.h>
|
|
|
|
namespace Web::SelectorEngine {
|
|
|
|
enum class SelectorKind {
|
|
Normal,
|
|
Relative,
|
|
};
|
|
|
|
bool matches(CSS::Selector const&, Optional<CSS::CSSStyleSheet const&> style_sheet_for_rule, DOM::Element const&, JS::GCPtr<DOM::Element const> shadow_host, Optional<CSS::Selector::PseudoElement::Type> = {}, JS::GCPtr<DOM::ParentNode const> scope = {}, SelectorKind selector_kind = SelectorKind::Normal, JS::GCPtr<DOM::Element const> anchor = nullptr);
|
|
|
|
[[nodiscard]] bool fast_matches(CSS::Selector const&, Optional<CSS::CSSStyleSheet const&> style_sheet_for_rule, DOM::Element const&, JS::GCPtr<DOM::Element const> shadow_host);
|
|
[[nodiscard]] bool can_use_fast_matches(CSS::Selector const&);
|
|
|
|
[[nodiscard]] bool matches_hover_pseudo_class(DOM::Element const&);
|
|
|
|
}
|