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

Side by Side Diff: Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp

Issue 926193003: Move rendering/RenderBox to layout/LayoutBox. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 unified diff | Download patch | Annotate | Revision Log
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/layout/LayoutMultiColumnFlowThread.h" 7 #include "core/layout/LayoutMultiColumnFlowThread.h"
8 8
9 #include "core/layout/LayoutMultiColumnSet.h" 9 #include "core/layout/LayoutMultiColumnSet.h"
10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h" 10 #include "core/layout/LayoutMultiColumnSpannerPlaceholder.h"
(...skipping 25 matching lines...) Expand all
36 return 0; 36 return 0;
37 RenderBlockFlow* multicolContainer = toRenderBlockFlow(multicol->renderer()) ; 37 RenderBlockFlow* multicolContainer = toRenderBlockFlow(multicol->renderer()) ;
38 if (!multicolContainer) 38 if (!multicolContainer)
39 return 0; 39 return 0;
40 return multicolContainer->multiColumnFlowThread(); 40 return multicolContainer->multiColumnFlowThread();
41 } 41 }
42 42
43 String MultiColumnRenderingTest::columnSetSignature(LayoutMultiColumnFlowThread* flowThread) 43 String MultiColumnRenderingTest::columnSetSignature(LayoutMultiColumnFlowThread* flowThread)
44 { 44 {
45 String signature = ""; 45 String signature = "";
46 for (RenderBox* columnBox = flowThread->firstMultiColumnBox(); 46 for (LayoutBox* columnBox = flowThread->firstMultiColumnBox();
47 columnBox; 47 columnBox;
48 columnBox = columnBox->nextSiblingMultiColumnBox()) { 48 columnBox = columnBox->nextSiblingMultiColumnBox()) {
49 if (columnBox->isLayoutMultiColumnSpannerPlaceholder()) 49 if (columnBox->isLayoutMultiColumnSpannerPlaceholder())
50 signature.append('s'); 50 signature.append('s');
51 else if (columnBox->isLayoutMultiColumnSet()) 51 else if (columnBox->isLayoutMultiColumnSet())
52 signature.append('c'); 52 signature.append('c');
53 else 53 else
54 signature.append('?'); 54 signature.append('?');
55 } 55 }
56 return signature; 56 return signature;
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnSet); 123 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnSet);
124 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnSet); 124 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnSet);
125 } 125 }
126 126
127 TEST_F(MultiColumnRenderingTest, Spanner) 127 TEST_F(MultiColumnRenderingTest, Spanner)
128 { 128 {
129 // With one spanner and no column content, we should create a spanner set. 129 // With one spanner and no column content, we should create a spanner set.
130 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>"); 130 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>");
131 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 131 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
132 ASSERT_EQ(columnSetSignature(flowThread), "s"); 132 ASSERT_EQ(columnSetSignature(flowThread), "s");
133 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 133 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
134 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); 134 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr);
135 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 135 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
136 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); 136 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox);
137 } 137 }
138 138
139 TEST_F(MultiColumnRenderingTest, ContentThenSpanner) 139 TEST_F(MultiColumnRenderingTest, ContentThenSpanner)
140 { 140 {
141 // With some column content followed by a spanner, we need a column set foll owed by a spanner set. 141 // With some column content followed by a spanner, we need a column set foll owed by a spanner set.
142 setMulticolHTML("<div id='mc'><div id='columnContent'></div><div id='spanner '></div></div>"); 142 setMulticolHTML("<div id='mc'><div id='columnContent'></div><div id='spanner '></div></div>");
143 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 143 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
144 ASSERT_EQ(columnSetSignature(flowThread), "cs"); 144 ASSERT_EQ(columnSetSignature(flowThread), "cs");
145 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 145 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
146 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox); 146 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox);
147 columnBox = columnBox->nextSiblingMultiColumnBox(); 147 columnBox = columnBox->nextSiblingMultiColumnBox();
148 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 148 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
149 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); 149 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr);
150 } 150 }
151 151
152 TEST_F(MultiColumnRenderingTest, SpannerThenContent) 152 TEST_F(MultiColumnRenderingTest, SpannerThenContent)
153 { 153 {
154 // With a spanner followed by some column content, we need a spanner set fol lowed by a column set. 154 // With a spanner followed by some column content, we need a spanner set fol lowed by a column set.
155 setMulticolHTML("<div id='mc'><div id='spanner'></div><div id='columnContent '></div></div>"); 155 setMulticolHTML("<div id='mc'><div id='spanner'></div><div id='columnContent '></div></div>");
156 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 156 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
157 ASSERT_EQ(columnSetSignature(flowThread), "sc"); 157 ASSERT_EQ(columnSetSignature(flowThread), "sc");
158 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 158 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
159 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 159 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
160 columnBox = columnBox->nextSiblingMultiColumnBox(); 160 columnBox = columnBox->nextSiblingMultiColumnBox();
161 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox); 161 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox);
162 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); 162 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr);
163 } 163 }
164 164
165 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) 165 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent)
166 { 166 {
167 // With column content followed by a spanner followed by some column content , we need a column 167 // With column content followed by a spanner followed by some column content , we need a column
168 // set followed by a spanner set followed by a column set. 168 // set followed by a spanner set followed by a column set.
169 setMulticolHTML("<div id='mc'><div id='columnContentBefore'></div><div id='s panner'></div><div id='columnContentAfter'></div></div>"); 169 setMulticolHTML("<div id='mc'><div id='columnContentBefore'></div><div id='s panner'></div><div id='columnContentAfter'></div></div>");
170 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 170 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
171 ASSERT_EQ(columnSetSignature(flowThread), "csc"); 171 ASSERT_EQ(columnSetSignature(flowThread), "csc");
172 RenderBox* columnBox = flowThread->firstMultiColumnSet(); 172 LayoutBox* columnBox = flowThread->firstMultiColumnSet();
173 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entBefore")->renderer()), columnBox); 173 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entBefore")->renderer()), columnBox);
174 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentBefore")->renderer()), nullptr); 174 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentBefore")->renderer()), nullptr);
175 columnBox = columnBox->nextSiblingMultiColumnBox(); 175 columnBox = columnBox->nextSiblingMultiColumnBox();
176 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 176 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
177 columnBox = columnBox->nextSiblingMultiColumnBox(); 177 columnBox = columnBox->nextSiblingMultiColumnBox();
178 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entAfter")->renderer()), columnBox); 178 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entAfter")->renderer()), columnBox);
179 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentAfter")->renderer()), nullptr); 179 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentAfter")->renderer()), nullptr);
180 } 180 }
181 181
182 TEST_F(MultiColumnRenderingTest, TwoSpanners) 182 TEST_F(MultiColumnRenderingTest, TwoSpanners)
183 { 183 {
184 // With two spanners and no column content, we need two spanner sets. 184 // With two spanners and no column content, we need two spanner sets.
185 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='spanner2'></ div></div>"); 185 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='spanner2'></ div></div>");
186 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 186 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
187 ASSERT_EQ(columnSetSignature(flowThread), "ss"); 187 ASSERT_EQ(columnSetSignature(flowThread), "ss");
188 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 188 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
189 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); 189 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr);
190 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); 190 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox);
191 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); 191 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox);
192 columnBox = columnBox->nextSiblingMultiColumnBox(); 192 columnBox = columnBox->nextSiblingMultiColumnBox();
193 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); 193 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox);
194 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); 194 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox);
195 } 195 }
196 196
197 TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner) 197 TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner)
198 { 198 {
199 // With two spanners and some column content in-between, we need a spanner s et, a column set and another spanner set. 199 // With two spanners and some column content in-between, we need a spanner s et, a column set and another spanner set.
200 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='columnConten t'></div><div id='spanner2'></div></div>"); 200 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='columnConten t'></div><div id='spanner2'></div></div>");
201 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 201 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
202 ASSERT_EQ(columnSetSignature(flowThread), "scs"); 202 ASSERT_EQ(columnSetSignature(flowThread), "scs");
203 LayoutMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); 203 LayoutMultiColumnSet* columnSet = flowThread->firstMultiColumnSet();
204 EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr); 204 EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr);
205 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 205 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
206 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); 206 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox);
207 columnBox = columnBox->nextSiblingMultiColumnBox(); 207 columnBox = columnBox->nextSiblingMultiColumnBox();
208 EXPECT_EQ(columnBox, columnSet); 208 EXPECT_EQ(columnBox, columnSet);
209 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnSet); 209 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnSet);
210 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); 210 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr);
211 columnBox = columnBox->nextSiblingMultiColumnBox(); 211 columnBox = columnBox->nextSiblingMultiColumnBox();
212 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); 212 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox);
213 } 213 }
214 214
215 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) 215 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner)
216 { 216 {
217 // column-span:all on something inside column-span:all has no effect. 217 // column-span:all on something inside column-span:all has no effect.
218 setMulticolHTML("<div id='mc'><div id='spanner'><div id='invalidSpanner' cla ss='s'></div></div></div>"); 218 setMulticolHTML("<div id='mc'><div id='spanner'><div id='invalidSpanner' cla ss='s'></div></div></div>");
219 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 219 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
220 ASSERT_EQ(columnSetSignature(flowThread), "s"); 220 ASSERT_EQ(columnSetSignature(flowThread), "s");
221 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 221 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
222 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 222 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
223 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("invalidSpanner")->renderer()), columnBox); 223 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("invalidSpanner")->renderer()), columnBox);
224 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); 224 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer());
225 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); 225 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox);
226 EXPECT_EQ(document().getElementById("invalidSpanner")->renderer()->spannerPl aceholder(), nullptr); 226 EXPECT_EQ(document().getElementById("invalidSpanner")->renderer()->spannerPl aceholder(), nullptr);
227 } 227 }
228 228
229 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) 229 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner)
230 { 230 {
231 setMulticolHTML("<div id='mc'><div id='outer'><div id='block1'></div><div id ='spanner'></div><div id='block2'></div></div></div>"); 231 setMulticolHTML("<div id='mc'><div id='outer'><div id='block1'></div><div id ='spanner'></div><div id='block2'></div></div></div>");
232 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 232 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
233 EXPECT_EQ(columnSetSignature(flowThread), "csc"); 233 EXPECT_EQ(columnSetSignature(flowThread), "csc");
234 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 234 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
235 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); 235 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox);
236 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnBox); 236 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnBox);
237 columnBox = columnBox->nextSiblingMultiColumnBox(); 237 columnBox = columnBox->nextSiblingMultiColumnBox();
238 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); 238 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox);
239 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); 239 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox);
240 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); 240 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer());
241 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); 241 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr);
242 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block1")->renderer()), nullptr); 242 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block1")->renderer()), nullptr);
243 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block2")->renderer()), nullptr); 243 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block2")->renderer()), nullptr);
244 columnBox = columnBox->nextSiblingMultiColumnBox(); 244 columnBox = columnBox->nextSiblingMultiColumnBox();
245 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnBox); 245 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnBox);
246 } 246 }
247 247
248 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) 248 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner)
249 { 249 {
250 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='outer'>text< div id='spanner2'></div><div id='after'></div></div></div>"); 250 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='outer'>text< div id='spanner2'></div><div id='after'></div></div></div>");
251 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 251 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
252 EXPECT_EQ(columnSetSignature(flowThread), "scsc"); 252 EXPECT_EQ(columnSetSignature(flowThread), "scsc");
253 RenderBox* columnBox = flowThread->firstMultiColumnBox(); 253 LayoutBox* columnBox = flowThread->firstMultiColumnBox();
254 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); 254 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox);
255 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); 255 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer());
256 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); 256 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox);
257 columnBox = columnBox->nextSiblingMultiColumnBox(); 257 columnBox = columnBox->nextSiblingMultiColumnBox();
258 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); 258 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox);
259 columnBox = columnBox->nextSiblingMultiColumnBox(); 259 columnBox = columnBox->nextSiblingMultiColumnBox();
260 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); 260 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox);
261 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); 261 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer());
262 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); 262 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox);
263 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); 263 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr);
264 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("after")->renderer()), nullptr); 264 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("after")->renderer()), nullptr);
265 columnBox = columnBox->nextSiblingMultiColumnBox(); 265 columnBox = columnBox->nextSiblingMultiColumnBox();
266 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("after")->r enderer()), columnBox); 266 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("after")->r enderer()), columnBox);
267 } 267 }
268 268
269 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) 269 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner)
270 { 270 {
271 setMulticolHTML("<div id='mc'><div id='outer'>text<div id='spanner1'></div>t ext</div><div id='spanner2'></div></div>"); 271 setMulticolHTML("<div id='mc'><div id='outer'>text<div id='spanner1'></div>t ext</div><div id='spanner2'></div></div>");
272 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); 272 LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc");
273 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); 273 EXPECT_EQ(columnSetSignature(flowThread), "cscs");
274 RenderBox* columnBox = flowThread->firstMultiColumnSet(); 274 LayoutBox* columnBox = flowThread->firstMultiColumnSet();
275 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); 275 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox);
276 columnBox = columnBox->nextSiblingMultiColumnBox(); 276 columnBox = columnBox->nextSiblingMultiColumnBox();
277 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); 277 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox);
278 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); 278 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox);
279 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); 279 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer());
280 columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBo x(); 280 columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBo x();
281 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); 281 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox);
282 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); 282 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox);
283 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); 283 EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer());
284 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); 284 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr);
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 { 797 {
798 setMulticolHTML("<div id='mc'>text<div id='spanner'><div class='s'></div></d iv>text</div>"); 798 setMulticolHTML("<div id='mc'>text<div id='spanner'><div class='s'></div></d iv>text</div>");
799 EXPECT_EQ(columnSetSignature("mc"), "csc"); 799 EXPECT_EQ(columnSetSignature("mc"), "csc");
800 destroyRenderer("spanner"); 800 destroyRenderer("spanner");
801 EXPECT_EQ(columnSetSignature("mc"), "c"); 801 EXPECT_EQ(columnSetSignature("mc"), "c");
802 } 802 }
803 803
804 } // anonymous namespace 804 } // anonymous namespace
805 805
806 } // namespace blink 806 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutMultiColumnFlowThread.cpp ('k') | Source/core/layout/LayoutMultiColumnSet.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698