chromium/third_party/blink/renderer/core/layout/forms/fieldset_layout_algorithm_test.cc

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

#include "third_party/blink/renderer/core/layout/forms/fieldset_layout_algorithm.h"

#include "third_party/blink/renderer/core/layout/base_layout_algorithm_test.h"
#include "third_party/blink/renderer/core/layout/block_layout_algorithm.h"
#include "third_party/blink/renderer/core/layout/length_utils.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"

namespace blink {
namespace {

class FieldsetLayoutAlgorithmTest : public BaseLayoutAlgorithmTest {};

TEST_F(FieldsetLayoutAlgorithmTest, Empty) {}

TEST_F(FieldsetLayoutAlgorithmTest, NoLegend) {}

TEST_F(FieldsetLayoutAlgorithmTest, Legend) {}

TEST_F(FieldsetLayoutAlgorithmTest, SmallLegendLargeBorder) {}

TEST_F(FieldsetLayoutAlgorithmTest, LegendOrthogonalWritingMode) {}

TEST_F(FieldsetLayoutAlgorithmTest, VerticalLr) {}

TEST_F(FieldsetLayoutAlgorithmTest, VerticalRl) {}

TEST_F(FieldsetLayoutAlgorithmTest, LegendAutoSize) {}

TEST_F(FieldsetLayoutAlgorithmTest, PercentageHeightChild) {}

TEST_F(FieldsetLayoutAlgorithmTest, AbsposChild) {}

// Used height needs to be adjusted to encompass the legend, if specified height
// requests a lower height than that.
TEST_F(FieldsetLayoutAlgorithmTest, ZeroHeight) {}

// Used height needs to be adjusted to encompass the legend, if specified height
// requests a lower max-height than that.
TEST_F(FieldsetLayoutAlgorithmTest, ZeroMaxHeight) {}

// Things inside legends and fieldsets are treated as if there was no fieldsets
// and legends involved, as far as the percentage height quirk is concerned.
TEST_F(FieldsetLayoutAlgorithmTest, PercentHeightQuirks) {}

// Legends are treated as regular elements, as far as the percentage height
// quirk is concerned.
TEST_F(FieldsetLayoutAlgorithmTest, LegendPercentHeightQuirks) {}

// This test makes sure that the fieldset content handles fieldset padding
// when the fieldset is expanded to encompass the legend.
TEST_F(FieldsetLayoutAlgorithmTest, FieldsetPaddingWithLegend) {}

TEST_F(FieldsetLayoutAlgorithmTest, MinMax) {}

// Tests that a fieldset won't fragment if it doesn't reach the fragmentation
// line.
TEST_F(FieldsetLayoutAlgorithmTest, NoFragmentation) {}

// Tests that a fieldset will fragment if it reaches the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, SimpleFragmentation) {}

// Tests that a fieldset with no content or padding will fragment if it reaches
// the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, FragmentationNoPadding) {}

// Tests that a fieldset with auto height will fragment when its content reaches
// the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, FieldsetContentFragmentationAutoHeight) {}

// Tests that a fieldset with a set height will fragment when its content
// reaches the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, FieldsetContentFragmentation) {}

// Tests that a fieldset with auto height will not fragment when its legend
// reaches the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, LegendFragmentationAutoHeight) {}

// Tests that a fieldset with a set height will not fragment when its legend
// reaches the fragmentation line. The used height should also be extended to
// encompass the legend.
TEST_F(FieldsetLayoutAlgorithmTest, LegendFragmentation) {}

// Tests that a fieldset with auto height will not fragment when its legend
// reaches the fragmentation line. The content of the fieldset should fragment
// when it reaches the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, LegendAndContentFragmentationAutoHeight) {}

// Tests that a fieldset with a set height will fragment when its legend reaches
// the fragmentation line. The content of the fieldset should fragment when it
// reaches the fragmentation line.
TEST_F(FieldsetLayoutAlgorithmTest, LegendAndContentFragmentation) {}

// Tests fragmentation when a legend's child content overflows.
TEST_F(FieldsetLayoutAlgorithmTest, LegendFragmentationWithOverflow) {}

// Tests that fragmentation works as expected when the fieldset content has a
// negative margin block start.
TEST_F(FieldsetLayoutAlgorithmTest,
       LegendAndContentFragmentationNegativeMargin) {}

TEST_F(FieldsetLayoutAlgorithmTest, OverflowedLegend) {}

TEST_F(FieldsetLayoutAlgorithmTest, OverflowedFieldsetContent) {}

TEST_F(FieldsetLayoutAlgorithmTest, BreakInsideAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, BreakInsideAvoidTallBlock) {}

TEST_F(FieldsetLayoutAlgorithmTest, LegendBreakInsideAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, BreakBeforeAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, LegendBreakBeforeAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, BreakAfterAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, LegendBreakAfterAvoid) {}

TEST_F(FieldsetLayoutAlgorithmTest, MarginBottomPastEndOfFragmentainer) {}

// Tests that a fieldset with a large border and a small legend fragment
// correctly. Since we don't allow breaking inside borders, they will overflow
// fragmentainers.
TEST_F(FieldsetLayoutAlgorithmTest, SmallLegendLargeBorderFragmentation) {}

// Tests that a fieldset with a large border and a small legend fragment
// correctly. In this case, the legend block offset is adjusted because the
// legend fits inside the first fragment.
TEST_F(FieldsetLayoutAlgorithmTest, SmallerLegendLargeBorderFragmentation) {}

// Tests that a fieldset with a large border and a small legend fragment
// correctly. In this case, since the legend doesn't stick below the block-start
// border, there's no class C breakpoint before the fieldset contents.
// Therefore, prefer breaking before the fieldset to breaking before the child
// DIV.
TEST_F(FieldsetLayoutAlgorithmTest, SmallerLegendLargeBorderFragmentation2) {}

// Tests that a fieldset with a large border and a small legend fragment
// correctly.
TEST_F(FieldsetLayoutAlgorithmTest, SmallerLegendLargeBorderWithBreak) {}

}  // anonymous namespace
}  // namespace blink