Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 100 { | 100 { |
| 101 // If there's no column content, there should be no column set. | 101 // If there's no column content, there should be no column set. |
| 102 setMulticolHTML("<div id='mc'></div>"); | 102 setMulticolHTML("<div id='mc'></div>"); |
| 103 EXPECT_EQ(columnSetSignature("mc"), ""); | 103 EXPECT_EQ(columnSetSignature("mc"), ""); |
| 104 } | 104 } |
| 105 | 105 |
| 106 TEST_F(MultiColumnRenderingTest, OneBlock) | 106 TEST_F(MultiColumnRenderingTest, OneBlock) |
| 107 { | 107 { |
| 108 // There is some content, so we should create a column set. | 108 // There is some content, so we should create a column set. |
| 109 setMulticolHTML("<div id='mc'><div id='block'></div></div>"); | 109 setMulticolHTML("<div id='mc'><div id='block'></div></div>"); |
| 110 ASSERT_EQ(columnSetSignature("mc"), "c"); | 110 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 111 ASSERT_EQ(columnSetSignature(flowThread), "c"); | |
| 112 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | |
| 113 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block")->r enderer()), columnSet); | |
|
Julien - ping for review
2015/01/22 10:23:08
Unfortunately by piggy-backing on these tests, you
| |
| 111 } | 114 } |
| 112 | 115 |
| 113 TEST_F(MultiColumnRenderingTest, TwoBlocks) | 116 TEST_F(MultiColumnRenderingTest, TwoBlocks) |
| 114 { | 117 { |
| 115 // No matter how much content, we should only create one column set (unless there are spanners). | 118 // No matter how much content, we should only create one column set (unless there are spanners). |
| 116 setMulticolHTML("<div id='mc'><div id='block1'></div><div id='block2'></div> </div>"); | 119 setMulticolHTML("<div id='mc'><div id='block1'></div><div id='block2'></div> </div>"); |
| 117 ASSERT_EQ(columnSetSignature("mc"), "c"); | 120 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 121 ASSERT_EQ(columnSetSignature(flowThread), "c"); | |
| 122 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | |
| 123 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnSet); | |
| 124 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnSet); | |
| 118 } | 125 } |
| 119 | 126 |
| 120 TEST_F(MultiColumnRenderingTest, Spanner) | 127 TEST_F(MultiColumnRenderingTest, Spanner) |
| 121 { | 128 { |
| 122 // 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. |
| 123 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>"); | 130 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>"); |
| 124 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 131 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 125 ASSERT_EQ(columnSetSignature(flowThread), "s"); | 132 ASSERT_EQ(columnSetSignature(flowThread), "s"); |
| 126 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 133 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 127 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); | 134 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); |
| 128 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); | 135 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); |
| 129 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); | 136 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); |
| 130 } | 137 } |
| 131 | 138 |
| 132 TEST_F(MultiColumnRenderingTest, ContentThenSpanner) | 139 TEST_F(MultiColumnRenderingTest, ContentThenSpanner) |
| 133 { | 140 { |
| 134 // 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. |
| 135 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>"); |
| 136 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 143 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 137 ASSERT_EQ(columnSetSignature(flowThread), "cs"); | 144 ASSERT_EQ(columnSetSignature(flowThread), "cs"); |
| 138 RenderBox* columnBox = flowThread->lastMultiColumnBox(); | 145 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 146 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox); | |
| 147 columnBox = columnBox->nextSiblingMultiColumnBox(); | |
| 139 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); | 148 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); |
| 140 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); | 149 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); |
| 141 } | 150 } |
| 142 | 151 |
| 143 TEST_F(MultiColumnRenderingTest, SpannerThenContent) | 152 TEST_F(MultiColumnRenderingTest, SpannerThenContent) |
| 144 { | 153 { |
| 145 // 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. |
| 146 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>"); |
| 147 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 156 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 148 ASSERT_EQ(columnSetSignature(flowThread), "sc"); | 157 ASSERT_EQ(columnSetSignature(flowThread), "sc"); |
| 149 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 158 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 150 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(); | |
| 161 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnBox); | |
| 151 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); | 162 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); |
| 152 } | 163 } |
| 153 | 164 |
| 154 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) | 165 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) |
| 155 { | 166 { |
| 156 // 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 |
| 157 // set followed by a spanner set followed by a column set. | 168 // set followed by a spanner set followed by a column set. |
| 158 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>"); |
| 159 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 170 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 160 ASSERT_EQ(columnSetSignature(flowThread), "csc"); | 171 ASSERT_EQ(columnSetSignature(flowThread), "csc"); |
| 161 RenderBox* columnBox = flowThread->firstMultiColumnSet()->nextSiblingMultiCo lumnBox(); | 172 RenderBox* columnBox = flowThread->firstMultiColumnSet(); |
| 173 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entBefore")->renderer()), columnBox); | |
| 162 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(); | |
| 163 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(); | |
| 178 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont entAfter")->renderer()), columnBox); | |
| 164 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentAfter")->renderer()), nullptr); | 179 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContentAfter")->renderer()), nullptr); |
| 165 } | 180 } |
| 166 | 181 |
| 167 TEST_F(MultiColumnRenderingTest, TwoSpanners) | 182 TEST_F(MultiColumnRenderingTest, TwoSpanners) |
| 168 { | 183 { |
| 169 // 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. |
| 170 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>"); |
| 171 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 186 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 172 ASSERT_EQ(columnSetSignature(flowThread), "ss"); | 187 ASSERT_EQ(columnSetSignature(flowThread), "ss"); |
| 173 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 188 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| (...skipping 10 matching lines...) Expand all Loading... | |
| 184 // 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. |
| 185 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>"); |
| 186 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 201 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 187 ASSERT_EQ(columnSetSignature(flowThread), "scs"); | 202 ASSERT_EQ(columnSetSignature(flowThread), "scs"); |
| 188 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 203 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); |
| 189 EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr); | 204 EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr); |
| 190 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 205 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 191 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); | 206 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); |
| 192 columnBox = columnBox->nextSiblingMultiColumnBox(); | 207 columnBox = columnBox->nextSiblingMultiColumnBox(); |
| 193 EXPECT_EQ(columnBox, columnSet); | 208 EXPECT_EQ(columnBox, columnSet); |
| 209 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("columnCont ent")->renderer()), columnSet); | |
| 194 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); | 210 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("columnContent")->renderer()), nullptr); |
| 195 columnBox = columnBox->nextSiblingMultiColumnBox(); | 211 columnBox = columnBox->nextSiblingMultiColumnBox(); |
| 196 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); | 212 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); |
| 197 } | 213 } |
| 198 | 214 |
| 199 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) | 215 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) |
| 200 { | 216 { |
| 201 // 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. |
| 202 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>"); |
| 203 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 219 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 204 ASSERT_EQ(columnSetSignature(flowThread), "s"); | 220 ASSERT_EQ(columnSetSignature(flowThread), "s"); |
| 205 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 221 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 206 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); | 222 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); |
| 207 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("invalidSpanner")->renderer()), columnBox); | 223 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("invalidSpanner")->renderer()), columnBox); |
| 208 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); | 224 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); |
| 209 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); | 225 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); |
| 210 EXPECT_EQ(document().getElementById("invalidSpanner")->renderer()->spannerPl aceholder(), nullptr); | 226 EXPECT_EQ(document().getElementById("invalidSpanner")->renderer()->spannerPl aceholder(), nullptr); |
| 211 } | 227 } |
| 212 | 228 |
| 213 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) | 229 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) |
| 214 { | 230 { |
| 215 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>"); |
| 216 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 232 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 217 EXPECT_EQ(columnSetSignature(flowThread), "csc"); | 233 EXPECT_EQ(columnSetSignature(flowThread), "csc"); |
| 218 RenderBox* columnBox = flowThread->firstMultiColumnSet()->nextSiblingMultiCo lumnBox(); | 234 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 235 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); | |
| 236 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block1")-> renderer()), columnBox); | |
| 237 columnBox = columnBox->nextSiblingMultiColumnBox(); | |
| 219 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); | 238 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner")->renderer()), columnBox); |
| 220 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); | 239 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold er(), columnBox); |
| 221 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); | 240 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner")->renderer()); |
| 222 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); | 241 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); |
| 223 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block1")->renderer()), nullptr); | 242 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("block1")->renderer()), nullptr); |
| 224 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(); | |
| 245 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("block2")-> renderer()), columnBox); | |
| 225 } | 246 } |
| 226 | 247 |
| 227 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) | 248 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) |
| 228 { | 249 { |
| 229 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>"); |
| 230 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 251 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 231 EXPECT_EQ(columnSetSignature(flowThread), "scsc"); | 252 EXPECT_EQ(columnSetSignature(flowThread), "scsc"); |
| 232 RenderBox* columnBox = flowThread->firstMultiColumnBox(); | 253 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 233 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); | 254 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); |
| 234 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); | 255 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); |
| 235 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); | 256 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); |
| 236 columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBo x(); | 257 columnBox = columnBox->nextSiblingMultiColumnBox(); |
| 258 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); | |
| 259 columnBox = columnBox->nextSiblingMultiColumnBox(); | |
| 237 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); | 260 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); |
| 238 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); | 261 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); |
| 239 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); | 262 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); |
| 240 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); | 263 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); |
| 241 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(); | |
| 266 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("after")->r enderer()), columnBox); | |
| 242 } | 267 } |
| 243 | 268 |
| 244 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) | 269 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) |
| 245 { | 270 { |
| 246 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>"); |
| 247 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 272 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 248 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); | 273 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); |
| 249 RenderBox* columnBox = flowThread->firstMultiColumnSet()->nextSiblingMultiCo lumnBox(); | 274 RenderBox* columnBox = flowThread->firstMultiColumnSet(); |
| 275 EXPECT_EQ(flowThread->findSetRendering(document().getElementById("outer")->r enderer()), columnBox); | |
| 276 columnBox = columnBox->nextSiblingMultiColumnBox(); | |
| 250 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); | 277 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner1")->renderer()), columnBox); |
| 251 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); | 278 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol der(), columnBox); |
| 252 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); | 279 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner1")->renderer()); |
| 253 columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBo x(); | 280 columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBo x(); |
| 254 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); | 281 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("spanner2")->renderer()), columnBox); |
| 255 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); | 282 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol der(), columnBox); |
| 256 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); | 283 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh read(), document().getElementById("spanner2")->renderer()); |
| 257 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); | 284 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme ntById("outer")->renderer()), nullptr); |
| 258 } | 285 } |
| 259 | 286 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 310 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), secondRow); | 337 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(799)), secondRow); |
| 311 RenderMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet(); | 338 RenderMultiColumnSet* thirdRow = secondRow->nextSiblingMultiColumnSet(); |
| 312 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(800)), thirdRow); | 339 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(800)), thirdRow); |
| 313 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), thirdRow); // bottom of last row | 340 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(899)), thirdRow); // bottom of last row |
| 314 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow | 341 EXPECT_EQ(flowThread->columnSetAtBlockOffset(LayoutUnit(10000)), thirdRow); // overflow |
| 315 } | 342 } |
| 316 | 343 |
| 317 } // anonymous namespace | 344 } // anonymous namespace |
| 318 | 345 |
| 319 } // namespace blink | 346 } // namespace blink |
| OLD | NEW |