chromium/third_party/blink/renderer/core/css/affected_by_pseudo_test.cc

// Copyright 2017 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifdef UNSAFE_BUFFERS_BUILD
// TODO(crbug.com/351564777): Remove this and convert code to safer constructs.
#pragma allow_unsafe_buffers
#endif

#include <memory>

#include "testing/gtest/include/gtest/gtest.h"
#include "third_party/blink/renderer/core/css/properties/longhands.h"
#include "third_party/blink/renderer/core/css/style_engine.h"
#include "third_party/blink/renderer/core/dom/document.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/element_traversal.h"
#include "third_party/blink/renderer/core/dom/node_computed_style.h"
#include "third_party/blink/renderer/core/frame/local_frame_view.h"
#include "third_party/blink/renderer/core/html/html_div_element.h"
#include "third_party/blink/renderer/core/html/html_element.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/testing/page_test_base.h"

namespace blink {

class AffectedByPseudoTest : public PageTestBase {};

void AffectedByPseudoTest::SetHtmlInnerHTML(const char* html_content) {}

void AffectedByPseudoTest::CheckElementsForFocus(
    ElementResult expected[],
    unsigned expected_count) const {}

void AffectedByPseudoTest::CheckAffectedByFlagsForHas(
    const char* element_id,
    std::map<AffectedByFlagName, bool> expected) const {}

// ":focus div" will mark ascendants of all divs with
// childrenOrSiblingsAffectedByFocus.
TEST_F(AffectedByPseudoTest, FocusedAscendant) {}

// "body:focus div" will mark the body element with
// childrenOrSiblingsAffectedByFocus.
TEST_F(AffectedByPseudoTest, FocusedAscendantWithType) {}

// ":not(body):focus div" should not mark the body element with
// childrenOrSiblingsAffectedByFocus.
// Note that currently ":focus:not(body)" does not do the same. Then the :focus
// is checked and the childrenOrSiblingsAffectedByFocus flag set before the
// negated type selector is found.
TEST_F(AffectedByPseudoTest, FocusedAscendantWithNegatedType) {}

// Checking current behavior for ":focus + div", but this is a BUG or at best
// sub-optimal. The focused element will also in this case get
// childrenOrSiblingsAffectedByFocus even if it's really a sibling. Effectively,
// the whole sub-tree of the focused element will have styles recalculated even
// though none of the children are affected. There are other mechanisms that
// makes sure the sibling also gets its styles recalculated.
TEST_F(AffectedByPseudoTest, FocusedSibling) {}

TEST_F(AffectedByPseudoTest, AffectedByFocusUpdate) {}

TEST_F(AffectedByPseudoTest, ChildrenOrSiblingsAffectedByFocusUpdate) {}

TEST_F(AffectedByPseudoTest, InvalidationSetFocusUpdate) {}

TEST_F(AffectedByPseudoTest, NoInvalidationSetFocusUpdate) {}

TEST_F(AffectedByPseudoTest, FocusWithinCommonAncestor) {}

TEST_F(AffectedByPseudoTest, HoverScrollbar) {}

TEST_F(AffectedByPseudoTest,
       AffectedBySubjectHasAndAncestorsOrAncestorSiblingsAffectedByHas) {}

TEST_F(AffectedByPseudoTest,
       AffectedByPseudoInHasAndAncestorsOrSiblingsAffectedByHoverInHas1) {}

TEST_F(AffectedByPseudoTest,
       AffectedByPseudoInHasAndAncestorsOrSiblingsAffectedByHoverInHas2) {}

TEST_F(AffectedByPseudoTest,
       AffectedByNonSubjectHasHasAndAncestorsOrAncestorSiblingsAffectedByHas) {}

TEST_F(AffectedByPseudoTest,
       AffectedByNonSubjectHasHasAndSiblingsAffectedByHas) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase1) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase2) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase3) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase4) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase5) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase6) {}

TEST_F(AffectedByPseudoTest, AffectedBySubjectHasComplexCase7) {}

TEST_F(AffectedByPseudoTest, AffectedByNonSubjectHasComplexCase1) {}

TEST_F(AffectedByPseudoTest, AffectedByNonSubjectHasComplexCase2) {}

TEST_F(AffectedByPseudoTest, AffectedByNonSubjectHasComplexCase3) {}

TEST_F(AffectedByPseudoTest, AffectedBySelectorQuery) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion1) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion2) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion3) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion4) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion5) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterInsertion6) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterWiping) {}

TEST_F(AffectedByPseudoTest, AffectedByLogicalCombinationsInHas) {}

TEST_F(AffectedByPseudoTest,
       AncestorsOrSiblingsAffectedByHoverInHasWithFastRejection) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval1) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval2) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval3) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval4) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval5) {}

TEST_F(AffectedByPseudoTest, AffectedByHasAfterRemoval6) {}

TEST_F(AffectedByPseudoTest, AffectedByHasWithoutNth) {}

TEST_F(AffectedByPseudoTest, AffectedByPseudoInHasWithNestingParent) {}

TEST_F(AffectedByPseudoTest, AffectedByPseudoInHasWithNestingComplexParent) {}

}  // namespace blink