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

Side by Side Diff: Source/core/rendering/RenderMultiColumnFlowThreadTest.cpp

Issue 712553003: [New Multicolumn] Actual support for layout of column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Break containingBlock() into pieces for locateFlowThreadContainingBlock(). Created 6 years, 1 month 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 unified diff | Download patch
OLDNEW
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 "config.h" 5 #include "config.h"
6 6
7 #include "core/rendering/RenderMultiColumnFlowThread.h" 7 #include "core/rendering/RenderMultiColumnFlowThread.h"
8 8
9 #include "core/rendering/RenderMultiColumnSet.h" 9 #include "core/rendering/RenderMultiColumnSet.h"
10 #include "core/rendering/RenderMultiColumnSpannerSet.h" 10 #include "core/rendering/RenderMultiColumnSpannerSet.h"
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); 230 EXPECT_EQ(columnSetSignature(flowThread), "cscs");
231 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet()->nextSib lingMultiColumnSet(); 231 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet()->nextSib lingMultiColumnSet();
232 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" spanner1")->renderer()), columnSet); 232 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" spanner1")->renderer()), columnSet);
233 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(), document().getElementById("spanner1")->renderer()); 233 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(), document().getElementById("spanner1")->renderer());
234 columnSet = columnSet->nextSiblingMultiColumnSet()->nextSiblingMultiColumnSe t(); 234 columnSet = columnSet->nextSiblingMultiColumnSet()->nextSiblingMultiColumnSe t();
235 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" spanner2")->renderer()), columnSet); 235 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" spanner2")->renderer()), columnSet);
236 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(), document().getElementById("spanner2")->renderer()); 236 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(), document().getElementById("spanner2")->renderer());
237 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" outer")->renderer()), nullptr); 237 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById(" outer")->renderer()), nullptr);
238 } 238 }
239 239
240 TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffset)
241 {
242 setMulticolHTML("<div id='mc' style='line-height:100px;'>text<br>text<br>tex t<br>text<br>text<div id='spanner1'>spanner</div>text<br>text<div id='spanner2'> text<br>text</div>text</div>");
243 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc");
244 EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
245 RenderMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
246 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
247 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
248 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
249 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(599)), firstRow); // empty content in last column in first row
250 RenderMultiColumnSet* firstSpanner = firstRow->nextSiblingMultiColumnSet();
251 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(600)), firstSpanner) ;
252 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(699)), firstSpanner) ;
253 RenderMultiColumnSet* secondRow = firstSpanner->nextSiblingMultiColumnSet();
254 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(700)), secondRow);
255 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), secondRow);
256 RenderMultiColumnSet* secondSpanner = secondRow->nextSiblingMultiColumnSet() ;
257 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(900)), secondSpanner );
258 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1099)), secondSpanne r);
259 RenderMultiColumnSet* thirdRow = secondSpanner->nextSiblingMultiColumnSet();
260 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1100)), thirdRow);
261 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(1199)), thirdRow); / / bottom of last row
262 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
263 }
Julien - ping for review 2014/11/26 21:09:01 It seems like we should have a vertical writing mo
mstensho (USE GERRIT) 2014/11/27 21:20:29 Done.
264
240 } // anonymous namespace 265 } // anonymous namespace
241 266
242 } // namespace blink 267 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698