| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/LayoutMultiColumnFlowThread.h" | 5 #include "core/layout/LayoutMultiColumnFlowThread.h" |
| 6 | 6 |
| 7 #include "core/layout/LayoutMultiColumnSet.h" | 7 #include "core/layout/LayoutMultiColumnSet.h" |
| 8 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" | 8 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" |
| 9 #include "core/layout/LayoutTestHelper.h" | 9 #include "core/layout/LayoutTestHelper.h" |
| 10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/include/gtest/gtest.h" |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 String MultiColumnRenderingTest::columnSetSignature(const char* multicolId) | 52 String MultiColumnRenderingTest::columnSetSignature(const char* multicolId) |
| 53 { | 53 { |
| 54 return columnSetSignature(findFlowThread(multicolId)); | 54 return columnSetSignature(findFlowThread(multicolId)); |
| 55 } | 55 } |
| 56 | 56 |
| 57 void MultiColumnRenderingTest::setMulticolHTML(const String& html) | 57 void MultiColumnRenderingTest::setMulticolHTML(const String& html) |
| 58 { | 58 { |
| 59 const char* style = | 59 const char* style = |
| 60 "<style>" | 60 "<style>" |
| 61 " #mc { -webkit-columns:2; }" | 61 " #mc { columns:2; }" |
| 62 " .s, #spanner, #spanner1, #spanner2 { -webkit-column-span:all; }" | 62 " .s, #spanner, #spanner1, #spanner2 { column-span:all; }" |
| 63 "</style>"; | 63 "</style>"; |
| 64 setBodyInnerHTML(style + html); | 64 setBodyInnerHTML(style + html); |
| 65 } | 65 } |
| 66 | 66 |
| 67 TEST_F(MultiColumnRenderingTest, OneBlockWithInDepthTreeStructureCheck) | 67 TEST_F(MultiColumnRenderingTest, OneBlockWithInDepthTreeStructureCheck) |
| 68 { | 68 { |
| 69 // Examine the layout tree established by a simple multicol container with a
block with some text inside. | 69 // Examine the layout tree established by a simple multicol container with a
block with some text inside. |
| 70 setMulticolHTML("<div id='mc'><div>xxx</div></div>"); | 70 setMulticolHTML("<div id='mc'><div>xxx</div></div>"); |
| 71 LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElem
entId("mc")); | 71 LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElem
entId("mc")); |
| 72 ASSERT_TRUE(multicolContainer); | 72 ASSERT_TRUE(multicolContainer); |
| (...skipping 712 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 785 { | 785 { |
| 786 setMulticolHTML("<div id='mc'>text<div id='spanner'><div class='s'></div></d
iv>text</div>"); | 786 setMulticolHTML("<div id='mc'>text<div id='spanner'><div class='s'></div></d
iv>text</div>"); |
| 787 EXPECT_EQ(columnSetSignature("mc"), "csc"); | 787 EXPECT_EQ(columnSetSignature("mc"), "csc"); |
| 788 destroyLayoutObject("spanner"); | 788 destroyLayoutObject("spanner"); |
| 789 EXPECT_EQ(columnSetSignature("mc"), "c"); | 789 EXPECT_EQ(columnSetSignature("mc"), "c"); |
| 790 } | 790 } |
| 791 | 791 |
| 792 } // anonymous namespace | 792 } // anonymous namespace |
| 793 | 793 |
| 794 } // namespace blink | 794 } // namespace blink |
| OLD | NEW |