Index: Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp |
diff --git a/Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp b/Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp |
index 719607c5ca475f7d9268619f57a29b3fdf2d1841..95581d22faa31dd009bd98a6f2f7517eaa397943 100644 |
--- a/Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp |
+++ b/Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp |
@@ -237,6 +237,32 @@ TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) |
EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("outer")->renderer()), nullptr); |
} |
+TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffset) |
+{ |
+ setMulticolHTML("<div id='mc' style='line-height:100px;'>text<br>text<br>text<br>text<br>text<div id='spanner1'>spanner</div>text<br>text<div id='spanner2'>text<br>text</div>text</div>"); |
+ RenderMultiColumnFlowThread* multicolFlowThread = findFlowThread("mc"); |
+ RenderFlowThread* flowThread = multicolFlowThread; // FIXME: columnSetAtBlockOffset() override is private in RenderMultiColumnFlowThread. :( |
+ EXPECT_EQ(columnSetSignature(multicolFlowThread), "cscsc"); |
+ RenderMultiColumnSet* columnSet = multicolFlowThread->firstMultiColumnSet(); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), columnSet); // negative overflow |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), columnSet); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), columnSet); // bottom of last line in first row. |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(599)), columnSet); // empty content in last column in first row |
+ columnSet = columnSet->nextSiblingMultiColumnSet(); // first spanner |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(600)), columnSet); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699)), columnSet); |
+ columnSet = columnSet->nextSiblingMultiColumnSet(); // second row |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700)), columnSet); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), columnSet); |
+ columnSet = columnSet->nextSiblingMultiColumnSet(); // second spanner |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(900)), columnSet); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1099)), columnSet); |
+ columnSet = columnSet->nextSiblingMultiColumnSet(); // third row |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1100)), columnSet); |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1199)), columnSet); // bottom of last row |
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), columnSet); // overflow |
+} |
+ |
} // anonymous namespace |
} // namespace blink |