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

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

Issue 792803002: [New Multicolumn] Layout support for column-span:all. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@347325-placeholder
Patch Set: Created 6 years 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/RenderMultiColumnSpannerPlaceholder.h" 10 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h"
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); 252 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox);
253 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); 253 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer());
254 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB ox); 254 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB ox);
255 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB ox); 255 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB ox);
256 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); 256 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox);
257 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); 257 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox);
258 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); 258 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer());
259 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); 259 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr);
260 } 260 }
261 261
262 TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffset)
263 {
264 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>");
265 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc");
266 EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
267 RenderMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
268 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
269 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
270 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
271 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(599)), firstRow); // empty content in last column in first row
272 RenderMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
273 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(600)), secondRow);
274 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), secondRow);
275 RenderMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
276 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(800)), thirdRow);
277 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), thirdRow); // bottom of last row
278 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
279 }
280
281 TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalRl)
282 {
283 setMulticolHTML("<div id='mc' style='line-height:100px; -webkit-writing-mode :vertical-rl;'>text<br>text<br>text<br>text<br>text<div id='spanner1'>spanner</d iv>text<br>text<div id='spanner2'>text<br>text</div>text</div>");
284 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc");
285 EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
286 RenderMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
287 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
288 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
289 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
290 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(599)), firstRow); // empty content in last column in first row
291 RenderMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
292 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(600)), secondRow);
293 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), secondRow);
294 RenderMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
295 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(800)), thirdRow);
296 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), thirdRow); // bottom of last row
297 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
298 }
299
300 TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffsetVerticalLr)
301 {
302 setMulticolHTML("<div id='mc' style='line-height:100px; -webkit-writing-mode :vertical-lr;'>text<br>text<br>text<br>text<br>text<div id='spanner1'>spanner</d iv>text<br>text<div id='spanner2'>text<br>text</div>text</div>");
303 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc");
304 EXPECT_EQ(columnSetSignature(flowThread), "cscsc");
305 RenderMultiColumnSet* firstRow = flowThread->firstMultiColumnSet();
306 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(-10000)), firstRow); // negative overflow
307 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit()), firstRow);
308 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(499)), firstRow); // bottom of last line in first row.
309 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(599)), firstRow); // empty content in last column in first row
310 RenderMultiColumnSet* secondRow = firstRow->nextSiblingMultiColumnSet();
311 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(600)), secondRow);
312 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), secondRow);
313 RenderMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet();
314 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(800)), thirdRow);
315 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), thirdRow); // bottom of last row
316 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow
317 }
318
262 } // anonymous namespace 319 } // anonymous namespace
263 320
264 } // namespace blink 321 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698