| Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
|
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
|
| index ff6037876771a56e5072a54a29d8c6acb6950821..3654fcdd20250a7fdc6ec75343429bbba0183626 100644
|
| --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
|
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm_test.cc
|
| @@ -43,9 +43,6 @@ typedef bool TestParamLayoutNG;
|
| class NGBlockLayoutAlgorithmTest
|
| : public ::testing::WithParamInterface<TestParamLayoutNG>,
|
| public RenderingTest {
|
| - public:
|
| - NGBlockLayoutAlgorithmTest() {}
|
| -
|
| protected:
|
| void SetUp() override {
|
| style_ = ComputedStyle::create();
|
| @@ -186,12 +183,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, LayoutBlockChildrenWithWritingMode) {
|
| EXPECT_EQ(kMarginLeft, child->LeftOffset());
|
| }
|
|
|
| -// Verifies the collapsing margins case for the next pair:
|
| -// - top margin of a box and top margin of its first in-flow child.
|
| // Verifies that floats are positioned at the top of the first child that can
|
| // determine its position after margins collapsed.
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase1WithFloats) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase1WithFloats) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| " #container {"
|
| @@ -295,13 +289,12 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase1WithFloats) {
|
| Pointee(expected_exclusion2))));
|
| }
|
|
|
| -// Verifies the collapsing margins case for the next pair:
|
| +// Verifies the collapsing margins case for the next pairs:
|
| // - bottom margin of box and top margin of its next in-flow following sibling.
|
| // - top and bottom margins of a box that does not establish a new block
|
| // formatting context and that has zero computed 'min-height', zero or 'auto'
|
| // computed 'height', and no in-flow children
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase2WithFloats) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase2WithFloats) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| "#first-child {"
|
| @@ -430,8 +423,7 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase2WithFloats) {
|
| // Verifies the collapsing margins case for the next pair:
|
| // - bottom margin of a last in-flow child and bottom margin of its parent if
|
| // the parent has 'auto' computed height
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase3) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase3) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| " #container {"
|
| @@ -467,22 +459,20 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase3) {
|
| // Margins are collapsed with the result 200 = std::max(20, 200)
|
| // The fragment size 258 == body's margin 8 + child's height 50 + 200
|
| EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(258)), fragment->Size());
|
| - // EXPECT_EQ(NGMarginStrut({LayoutUnit(200)}),
|
| - // container_fragment->EndMarginStrut());
|
| + EXPECT_EQ(NGMarginStrut({LayoutUnit(200)}),
|
| + container_fragment->EndMarginStrut());
|
|
|
| // height == fixed
|
| run_test(Length(50, Fixed));
|
| // Margins are not collapsed, so fragment still has margins == 20.
|
| // The fragment size 78 == body's margin 8 + child's height 50 + 20
|
| - // EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(78)),
|
| - // fragment->Size());
|
| - // EXPECT_EQ(NGMarginStrut(), container_fragment->EndMarginStrut());
|
| + EXPECT_EQ(NGPhysicalSize(LayoutUnit(800), LayoutUnit(78)), fragment->Size());
|
| + EXPECT_EQ(NGMarginStrut(), container_fragment->EndMarginStrut());
|
| }
|
|
|
| // Verifies that 2 adjoining margins are not collapsed if there is padding or
|
| // border that separates them.
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase4) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase4) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| " #container {"
|
| @@ -546,7 +536,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase4) {
|
| // horizontal
|
| // </div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, CollapsingMarginsCase5) {
|
| +// TODO(glebl): fix writing modes support after new margin collapsing/floats
|
| +// algorithm is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_CollapsingMarginsCase5) {
|
| const int kVerticalDivMarginRight = 60;
|
| const int kVerticalDivWidth = 50;
|
| const int kHorizontalDivMarginLeft = 100;
|
| @@ -870,8 +862,7 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFloatInsideEmptyBlocks) {
|
|
|
| // Verifies that left/right floating and regular blocks can be positioned
|
| // correctly by the algorithm.
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFloatFragments) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, PositionFloatFragments) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| " #container {"
|
| @@ -1044,8 +1035,7 @@ TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFloatFragments) {
|
| }
|
|
|
| // Verifies that NG block layout algorithm respects "clear" CSS property.
|
| -// TODO(glebl): Enable with new the float/margins collapsing algorithm.
|
| -TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_PositionFragmentsWithClear) {
|
| +TEST_F(NGBlockLayoutAlgorithmTest, PositionFragmentsWithClear) {
|
| setBodyInnerHTML(
|
| "<style>"
|
| " #container {"
|
| @@ -1252,7 +1242,9 @@ class FragmentChildIterator
|
| // <div id="parent" style="columns:2; column-fill:auto; column-gap:10px;
|
| // width:210px; height:100px;">
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, EmptyMulticol) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_EmptyMulticol) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(2);
|
| @@ -1282,7 +1274,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, EmptyMulticol) {
|
| // width:210px; height:100px;">
|
| // <div id="child"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, EmptyBlock) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_EmptyBlock) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(2);
|
| @@ -1326,7 +1320,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, EmptyBlock) {
|
| // width:310px; height:100px;">
|
| // <div id="child" style="width:60%; height:100px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, BlockInOneColumn) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInOneColumn) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(2);
|
| @@ -1373,7 +1369,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, BlockInOneColumn) {
|
| // width:210px; height:100px;">
|
| // <div id="child" style="width:75%; height:150px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, BlockInTwoColumns) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInTwoColumns) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(2);
|
| @@ -1429,7 +1427,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, BlockInTwoColumns) {
|
| // width:320px; height:100px;">
|
| // <div id="child" style="width:75%; height:250px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, BlockInThreeColumns) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_BlockInThreeColumns) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
| @@ -1494,7 +1494,10 @@ TEST_F(NGBlockLayoutAlgorithmTest, BlockInThreeColumns) {
|
| // width:210px; height:100px;">
|
| // <div id="child" style="width:1px; height:250px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, ActualColumnCountGreaterThanSpecified) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest,
|
| + DISABLED_ActualColumnCountGreaterThanSpecified) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(2);
|
| @@ -1560,7 +1563,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, ActualColumnCountGreaterThanSpecified) {
|
| // <div id="child1" style="width:75%; height:60px;"></div>
|
| // <div id="child2" style="width:85%; height:60px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, TwoBlocksInTwoColumns) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoBlocksInTwoColumns) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
| @@ -1635,7 +1640,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, TwoBlocksInTwoColumns) {
|
| // </div>
|
| // <div id="child2" style="width:85%; height:10px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, OverflowedBlock) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_OverflowedBlock) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
| @@ -1743,7 +1750,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, OverflowedBlock) {
|
| // width:320px; height:100px;">
|
| // <div id="child" style="float:left; width:75%; height:100px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, FloatInOneColumn) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_FloatInOneColumn) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
| @@ -1792,7 +1801,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, FloatInOneColumn) {
|
| // <div id="child1" style="float:left; width:15%; height:100px;"></div>
|
| // <div id="child2" style="float:right; width:16%; height:100px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, TwoFloatsInOneColumn) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoFloatsInOneColumn) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
| @@ -1857,7 +1868,9 @@ TEST_F(NGBlockLayoutAlgorithmTest, TwoFloatsInOneColumn) {
|
| // <div id="child1" style="float:left; width:15%; height:150px;"></div>
|
| // <div id="child2" style="float:right; width:16%; height:150px;"></div>
|
| // </div>
|
| -TEST_F(NGBlockLayoutAlgorithmTest, TwoFloatsInTwoColumns) {
|
| +// TODO(glebl): reenable multicol after new margin collapsing/floats algorithm
|
| +// is checked in.
|
| +TEST_F(NGBlockLayoutAlgorithmTest, DISABLED_TwoFloatsInTwoColumns) {
|
| // parent
|
| RefPtr<ComputedStyle> parent_style = ComputedStyle::create();
|
| parent_style->setColumnCount(3);
|
|
|