SelectorEngine.h 904 B

1234567891011121314151617181920212223242526
  1. /*
  2. * Copyright (c) 2018-2024, Andreas Kling <andreas@ladybird.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <LibWeb/CSS/Selector.h>
  8. #include <LibWeb/DOM/Element.h>
  9. namespace Web::SelectorEngine {
  10. enum class SelectorKind {
  11. Normal,
  12. Relative,
  13. };
  14. 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);
  15. [[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);
  16. [[nodiscard]] bool can_use_fast_matches(CSS::Selector const&);
  17. [[nodiscard]] bool matches_hover_pseudo_class(DOM::Element const&);
  18. }