chromium/third_party/blink/renderer/core/layout/out_of_flow_layout_part_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.

#include "third_party/blink/renderer/core/layout/out_of_flow_layout_part.h"

#include "third_party/blink/renderer/core/layout/base_layout_algorithm_test.h"
#include "third_party/blink/renderer/core/layout/block_break_token.h"
#include "third_party/blink/renderer/core/layout/constraint_space.h"
#include "third_party/blink/renderer/core/layout/layout_block_flow.h"
#include "third_party/blink/renderer/core/layout/layout_result.h"
#include "third_party/blink/renderer/core/layout/physical_box_fragment.h"
#include "third_party/blink/renderer/core/testing/core_unit_test_helper.h"

namespace blink {
namespace {

class OutOfFlowLayoutPartTest : public BaseLayoutAlgorithmTest {};

// Fixed blocks inside absolute blocks trigger otherwise unused while loop
// inside OutOfFlowLayoutPart::Run.
// This test exercises this loop by placing two fixed elements inside abs.
TEST_F(OutOfFlowLayoutPartTest, FixedInsideAbs) {}

// Tests non-fragmented positioned nodes inside a multi-column.
TEST_F(OutOfFlowLayoutPartTest, PositionedInMulticol) {}

// Tests that positioned nodes fragment correctly.
TEST_F(OutOfFlowLayoutPartTest, SimplePositionedFragmentation) {}

// Tests fragmentation when a positioned node's child overflows.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithOverflow) {}

// Tests that new column fragments are added correctly if a positioned node
// fragments beyond the last fragmentainer in a context.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithNewColumns) {}

// Tests that empty column fragments are added if an OOF element begins layout
// in a fragmentainer that is more than one index beyond the last existing
// column fragmentainer.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithNewEmptyColumns) {}

// Break-inside does not apply to absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, BreakInsideAvoid) {}

// Break-before does not apply to absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, BreakBeforeColumn) {}

// Break-after does not apply to absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, BreakAfterColumn) {}

// Break-inside should still apply to children of absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, ChildBreakInsideAvoid) {}

// Break-before should still apply to children of absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, ChildBreakBeforeAvoid) {}

// Break-after should still apply to children of absolute positioned elements.
TEST_F(OutOfFlowLayoutPartTest, ChildBreakAfterAvoid) {}

// Tests that a positioned element with a negative top property moves the OOF
// node to the previous fragmentainer and spans 3 columns.
TEST_F(OutOfFlowLayoutPartTest,
       PositionedFragmentationWithNegativeTopPropertyAndNewEmptyColumn) {}

TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithBottomProperty) {}

// Tests that a positioned element without a top or bottom property stays in
// flow - even though it's treated as an OOF element.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationInFlowWithAddedColumns) {}

// Tests that the fragments of a positioned element are added to the right
// fragmentainer despite the presence of column spanners.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationAndColumnSpanners) {}

// Tests that column spanners are skipped over when laying out fragmented abspos
// elements.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithNestedSpanner) {}

// Tests that column spanners are skipped over when laying out fragmented abspos
// elements.
TEST_F(OutOfFlowLayoutPartTest, PositionedFragmentationWithNestedSpanners) {}

// Tests that abspos elements bubble up to their containing block when nested
// inside of a spanner.
TEST_F(OutOfFlowLayoutPartTest, AbsposInSpanner) {}

// Tests that abspos elements bubble up to their containing block when nested
// inside of a spanner and get the correct static position.
TEST_F(OutOfFlowLayoutPartTest, AbsposInSpannerStaticPos) {}

// Tests fragmented abspos elements with a spanner nested inside.
TEST_F(OutOfFlowLayoutPartTest, SpannerInAbspos) {}

// Tests that new column fragments are added correctly if a positioned node
// fragments beyond the last fragmentainer in a context in the presence of a
// spanner.
TEST_F(OutOfFlowLayoutPartTest,
       PositionedFragmentationWithNewColumnsAndSpanners) {}

// Tests that new column fragments are added correctly if a positioned node
// fragments beyond the last fragmentainer in a context directly after a
// spanner.
TEST_F(OutOfFlowLayoutPartTest,
       PositionedFragmentationWithNewColumnsAfterSpanner) {}

// Tests that new column fragments are added correctly if a positioned node
// fragments beyond the last fragmentainer in a context in the presence of a
// spanner.
TEST_F(OutOfFlowLayoutPartTest, AbsposFragWithSpannerAndNewColumnsAutoHeight) {}

// Tests that empty column fragments are added if an OOF element begins layout
// in a fragmentainer that is more than one index beyond the last existing
// column fragmentainer in the presence of a spanner.
TEST_F(OutOfFlowLayoutPartTest, AbsposFragWithSpannerAndNewEmptyColumns) {}

// Fragmented OOF element with block-size percentage resolution.
TEST_F(OutOfFlowLayoutPartTest, AbsposFragmentationPctResolution) {}

// Fragmented OOF element with block-size percentage resolution and overflow.
TEST_F(OutOfFlowLayoutPartTest, AbsposFragmentationPctResolutionWithOverflow) {}

// Fragmented OOF element inside a nested multi-column.
TEST_F(OutOfFlowLayoutPartTest, SimpleAbsposNestedFragmentation) {}

// Fragmented OOF element inside a nested multi-column with new columns.
TEST_F(OutOfFlowLayoutPartTest, AbsposNestedFragmentationNewColumns) {}

// Fragmented OOF element inside a nested multi-column starting at a
// fragmentainer index beyond the last existing fragmentainer.
TEST_F(OutOfFlowLayoutPartTest, AbsposNestedFragmentationNewEmptyColumns) {}

// Fragmented OOF with `height: auto` and positioned with the bottom property.
TEST_F(OutOfFlowLayoutPartTest,
       PositionedFragmentationWithBottomPropertyAndHeightAuto) {}

// Tests an OOF element with an inline containing block inside a multicol
// with a column spanner.
TEST_F(OutOfFlowLayoutPartTest, AbsposFragWithInlineCBAndSpanner) {}

static void CheckMulticolumnPositionedObjects(const LayoutBox* multicol,
                                              const LayoutBox* abspos) {}

TEST_F(OutOfFlowLayoutPartTest, PositionedObjectsInMulticol) {}

TEST_F(OutOfFlowLayoutPartTest, PositionedObjectsInMulticolWithInline) {}

// Make sure the fragmentainer break tokens are correct when OOFs are added to
// existing fragmentainers.
TEST_F(OutOfFlowLayoutPartTest, FragmentainerBreakTokens) {}

// Make sure the fragmentainer break tokens are correct when a new column is
// created before a spanner for an OOF.
TEST_F(OutOfFlowLayoutPartTest, FragmentainerBreakTokenBeforeSpanner) {}

// crbug.com/1296900
TEST_F(OutOfFlowLayoutPartTest, RelayoutNestedMulticolWithOOF) {}

TEST_F(OutOfFlowLayoutPartTest, UseCountOutOfFlowNoInsets) {}

TEST_F(OutOfFlowLayoutPartTest, UseCountOutOfFlowSingleInset) {}

TEST_F(OutOfFlowLayoutPartTest, UseCountOutOfFlowBothInsets) {}

TEST_F(OutOfFlowLayoutPartTest, EmptyFragmentainersBeforeOOF) {}

TEST_F(OutOfFlowLayoutPartTest, MultipleUnfragmentedOOFs) {}

}  // namespace
}  // namespace blink