#include "third_party/blink/renderer/core/css/selector_checker.h"
#include <bitset>
#include <optional>
#include "third_party/blink/renderer/core/css/css_test_helpers.h"
#include "third_party/blink/renderer/core/css/selector_checker-inl.h"
#include "third_party/blink/renderer/core/css/style_rule.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/dom/shadow_root.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/style/computed_style.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"
namespace blink {
struct ScopeProximityTestData { … };
ScopeProximityTestData scope_proximity_test_data[] = …;
class ScopeProximityTest
: public PageTestBase,
public testing::WithParamInterface<ScopeProximityTestData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(ScopeProximityTest, All) { … }
struct MatchFlagsTestData { … };
constexpr MatchFlags Active() { … }
constexpr MatchFlags Drag() { … }
constexpr MatchFlags FocusWithin() { … }
constexpr MatchFlags Hover() { … }
MatchFlagsTestData result_flags_test_data[] = …;
class MatchFlagsTest : public PageTestBase,
public testing::WithParamInterface<MatchFlagsTestData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(MatchFlagsTest, All) { … }
class ImpactTest : public PageTestBase { … };
TEST_F(ImpactTest, HoverSubjectOnly) { … }
TEST_F(ImpactTest, HoverNonSubjectOnly) { … }
TEST_F(ImpactTest, HoverBoth) { … }
TEST_F(ImpactTest, HoverDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, DragSubjectOnly) { … }
TEST_F(ImpactTest, DragNonSubjectOnly) { … }
TEST_F(ImpactTest, DragBoth) { … }
TEST_F(ImpactTest, DragDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, FocusWithinSubjectOnly) { … }
TEST_F(ImpactTest, FocusWithinNonSubjectOnly) { … }
TEST_F(ImpactTest, FocusWithinBoth) { … }
TEST_F(ImpactTest, FocusWithinDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, ActiveSubjectOnly) { … }
TEST_F(ImpactTest, ActiveNonSubjectOnly) { … }
TEST_F(ImpactTest, ActiveBoth) { … }
TEST_F(ImpactTest, ActiveDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, FocusVisibleSubjectOnly) { … }
TEST_F(ImpactTest, FocusVisibleNonSubjectOnly) { … }
TEST_F(ImpactTest, FocusVisibleBoth) { … }
TEST_F(ImpactTest, FocusVisibleDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, HasSubjectOnly) { … }
TEST_F(ImpactTest, HasNonSubjectOnly) { … }
TEST_F(ImpactTest, HasBoth) { … }
TEST_F(ImpactTest, HasDescendantCombinatorSubject) { … }
TEST_F(ImpactTest, HasDescendantCombinatorBoth) { … }
TEST_F(ImpactTest, HasSubjectAndDescendantCombinatorBoth) { … }
TEST_F(ImpactTest, HasDescendantCombinatorWithinIsBoth) { … }
TEST_F(ImpactTest, HasDescendantCombinatorWithIsBoth) { … }
MatchFlagsTestData result_flags_shadow_test_data[] = …;
class MatchFlagsShadowTest
: public PageTestBase,
public testing::WithParamInterface<MatchFlagsTestData> { … };
INSTANTIATE_TEST_SUITE_P(…);
TEST_P(MatchFlagsShadowTest, Host) { … }
class MatchFlagsScopeTest : public PageTestBase { … };
TEST_F(MatchFlagsScopeTest, NoHover) { … }
TEST_F(MatchFlagsScopeTest, HoverSubject) { … }
TEST_F(MatchFlagsScopeTest, HoverNonSubject) { … }
TEST_F(MatchFlagsScopeTest, ScopeSubject) { … }
TEST_F(MatchFlagsScopeTest, ScopeNonSubject) { … }
TEST_F(MatchFlagsScopeTest, ScopeLimit) { … }
TEST_F(MatchFlagsScopeTest, ScopeLimitNonSubject) { … }
class EasySelectorCheckerTest : public PageTestBase { … };
bool EasySelectorCheckerTest::Matches(const String& selector_text,
const char* id) { … }
#if DCHECK_IS_ON()
bool EasySelectorCheckerTest::IsEasy(const String& selector_text) { … }
TEST_F(EasySelectorCheckerTest, IsEasy) { … }
#endif
TEST_F(EasySelectorCheckerTest, SmokeTest) { … }
class SelectorCheckerTest : public PageTestBase { … };
TEST_F(SelectorCheckerTest, PseudoScopeWithoutScope) { … }
TEST_F(SelectorCheckerTest, PseudoTrue) { … }
TEST_F(SelectorCheckerTest, PseudoTrueMatchesHost) { … }
}