Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(142)

Unified Diff: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp

Issue 2340213003: Add PageBoundaryRule parameter to columnSetAtBlockOffset(). (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp
index 1f3d90a94b77b3c599762d6016c59f78bc207ae4..1755ba9936104c891d5c4e29d601f0feeb133646 100644
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp
@@ -281,16 +281,23 @@ TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffset)
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
LayoutMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithFormerPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithLatterPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithLatterPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithFormerPage), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithLatterPage), firstRow); // bottom of last line in first row.
LayoutMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500)), secondRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699)), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithLatterPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithLatterPage), secondRow);
LayoutMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700)), thirdRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), thirdRow); // bottom of last row
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithLatterPage), thirdRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799), LayoutBox::AssociateWithLatterPage), thirdRow); // bottom of last row
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithFormerPage), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithLatterPage), thirdRow); // overflow
}
TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalRl)
@@ -299,16 +306,23 @@ TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalRl)
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
LayoutMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithFormerPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithLatterPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithLatterPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithFormerPage), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithLatterPage), firstRow); // bottom of last line in first row.
LayoutMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500)), secondRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699)), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithLatterPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithLatterPage), secondRow);
LayoutMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700)), thirdRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), thirdRow); // bottom of last row
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithLatterPage), thirdRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799), LayoutBox::AssociateWithLatterPage), thirdRow); // bottom of last row
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithFormerPage), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithLatterPage), thirdRow); // overflow
}
TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalLr)
@@ -317,16 +331,23 @@ TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalLr)
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
LayoutMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithFormerPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000), LayoutBox::AssociateWithLatterPage), firstRow); // negative overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(), LayoutBox::AssociateWithLatterPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithFormerPage), firstRow); // bottom of last line in first row.
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499), LayoutBox::AssociateWithLatterPage), firstRow); // bottom of last line in first row.
LayoutMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500)), secondRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699)), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithFormerPage), firstRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(500), LayoutBox::AssociateWithLatterPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699), LayoutBox::AssociateWithLatterPage), secondRow);
LayoutMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700)), thirdRow);
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), thirdRow); // bottom of last row
- EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithFormerPage), secondRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700), LayoutBox::AssociateWithLatterPage), thirdRow);
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799), LayoutBox::AssociateWithLatterPage), thirdRow); // bottom of last row
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithFormerPage), thirdRow); // overflow
+ EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000), LayoutBox::AssociateWithLatterPage), thirdRow); // overflow
}
class MultiColumnTreeModifyingTest : public MultiColumnRenderingTest {
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThread.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698