2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2024-03-19 10:36:08 +01:00
|
|
|
* Copyright (c) 2018-2024, Andreas Kling <kling@serenityos.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
2019-10-08 15:33:58 +02:00
|
|
|
#pragma once
|
|
|
|
|
2020-03-07 10:32:51 +01:00
|
|
|
#include <LibWeb/CSS/Selector.h>
|
2020-07-26 19:37:56 +02:00
|
|
|
#include <LibWeb/DOM/Element.h>
|
2019-10-08 15:33:58 +02:00
|
|
|
|
2020-07-26 19:37:56 +02:00
|
|
|
namespace Web::SelectorEngine {
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2024-07-13 09:19:30 -07:00
|
|
|
enum class SelectorKind {
|
|
|
|
Normal,
|
|
|
|
Relative,
|
|
|
|
};
|
|
|
|
|
|
|
|
bool matches(CSS::Selector const&, Optional<CSS::CSSStyleSheet const&> style_sheet_for_rule, DOM::Element const&, Optional<CSS::Selector::PseudoElement::Type> = {}, JS::GCPtr<DOM::ParentNode const> scope = {}, SelectorKind selector_kind = SelectorKind::Normal);
|
2020-03-07 10:27:02 +01:00
|
|
|
|
2024-03-19 10:36:08 +01:00
|
|
|
[[nodiscard]] bool fast_matches(CSS::Selector const&, Optional<CSS::CSSStyleSheet const&> style_sheet_for_rule, DOM::Element const&);
|
|
|
|
[[nodiscard]] bool can_use_fast_matches(CSS::Selector const&);
|
|
|
|
|
2020-03-07 10:27:02 +01:00
|
|
|
}
|