| 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/RenderMultiColumnSpannerSet.h" | 10 #include "core/rendering/RenderMultiColumnSpannerPlaceholder.h" |
| 11 #include "core/rendering/RenderingTestHelper.h" | 11 #include "core/rendering/RenderingTestHelper.h" |
| 12 | 12 |
| 13 #include <gtest/gtest.h> | 13 #include <gtest/gtest.h> |
| 14 | 14 |
| 15 namespace blink { | 15 namespace blink { |
| 16 | 16 |
| 17 namespace { | 17 namespace { |
| 18 | 18 |
| 19 class MultiColumnRenderingTest : public RenderingTest { | 19 class MultiColumnRenderingTest : public RenderingTest { |
| 20 public: | 20 public: |
| 21 RenderMultiColumnFlowThread* findFlowThread(const char* id) const; | 21 RenderMultiColumnFlowThread* findFlowThread(const char* id) const; |
| 22 | 22 |
| 23 // Generate a signature string based on what kind of column sets the flow th
read has | 23 // Generate a signature string based on what kind of column boxes the flow t
hread has |
| 24 // established. There will be one character for each column set. 'c' is used
for regular column | 24 // established. 'c' is used for regular column content sets, while 's' is us
ed for spanners. |
| 25 // content sets, while 's' is used for spanner sets. | 25 // '?' is used when there's an unknown box type (which should be considered
a failure). |
| 26 String columnSetSignature(RenderMultiColumnFlowThread*); | 26 String columnSetSignature(RenderMultiColumnFlowThread*); |
| 27 String columnSetSignature(const char* multicolId); | 27 String columnSetSignature(const char* multicolId); |
| 28 | 28 |
| 29 void setMulticolHTML(const String&); | 29 void setMulticolHTML(const String&); |
| 30 }; | 30 }; |
| 31 | 31 |
| 32 RenderMultiColumnFlowThread* MultiColumnRenderingTest::findFlowThread(const char
* id) const | 32 RenderMultiColumnFlowThread* MultiColumnRenderingTest::findFlowThread(const char
* id) const |
| 33 { | 33 { |
| 34 Node* multicol = document().getElementById(id); | 34 Node* multicol = document().getElementById(id); |
| 35 if (!multicol) | 35 if (!multicol) |
| 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(RenderMultiColumnFlowThread*
flowThread) | 43 String MultiColumnRenderingTest::columnSetSignature(RenderMultiColumnFlowThread*
flowThread) |
| 44 { | 44 { |
| 45 String signature = ""; | 45 String signature = ""; |
| 46 for (RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); co
lumnSet; columnSet = columnSet->nextSiblingMultiColumnSet()) { | 46 for (RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 47 if (columnSet->isRenderMultiColumnSpannerSet()) | 47 columnBox; |
| 48 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(col
umnBox)) { |
| 49 if (columnBox->isRenderMultiColumnSpannerPlaceholder()) |
| 48 signature.append('s'); | 50 signature.append('s'); |
| 51 else if (columnBox->isRenderMultiColumnSet()) |
| 52 signature.append('c'); |
| 49 else | 53 else |
| 50 signature.append('c'); | 54 signature.append('?'); |
| 51 } | 55 } |
| 52 return signature; | 56 return signature; |
| 53 } | 57 } |
| 54 | 58 |
| 55 String MultiColumnRenderingTest::columnSetSignature(const char* multicolId) | 59 String MultiColumnRenderingTest::columnSetSignature(const char* multicolId) |
| 56 { | 60 { |
| 57 return columnSetSignature(findFlowThread(multicolId)); | 61 return columnSetSignature(findFlowThread(multicolId)); |
| 58 } | 62 } |
| 59 | 63 |
| 60 void MultiColumnRenderingTest::setMulticolHTML(const String& html) | 64 void MultiColumnRenderingTest::setMulticolHTML(const String& html) |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 setMulticolHTML("<div id='mc'><div id='block1'></div><div id='block2'></div>
</div>"); | 116 setMulticolHTML("<div id='mc'><div id='block1'></div><div id='block2'></div>
</div>"); |
| 113 ASSERT_EQ(columnSetSignature("mc"), "c"); | 117 ASSERT_EQ(columnSetSignature("mc"), "c"); |
| 114 } | 118 } |
| 115 | 119 |
| 116 TEST_F(MultiColumnRenderingTest, Spanner) | 120 TEST_F(MultiColumnRenderingTest, Spanner) |
| 117 { | 121 { |
| 118 // With one spanner and no column content, we should create a spanner set. | 122 // With one spanner and no column content, we should create a spanner set. |
| 119 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>"); | 123 setMulticolHTML("<div id='mc'><div id='spanner'></div></div>"); |
| 120 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 124 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 121 ASSERT_EQ(columnSetSignature(flowThread), "s"); | 125 ASSERT_EQ(columnSetSignature(flowThread), "s"); |
| 122 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 126 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 123 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 127 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); |
| 128 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 129 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold
er(), columnBox); |
| 124 } | 130 } |
| 125 | 131 |
| 126 TEST_F(MultiColumnRenderingTest, ContentThenSpanner) | 132 TEST_F(MultiColumnRenderingTest, ContentThenSpanner) |
| 127 { | 133 { |
| 128 // With some column content followed by a spanner, we need a column set foll
owed by a spanner set. | 134 // With some column content followed by a spanner, we need a column set foll
owed by a spanner set. |
| 129 setMulticolHTML("<div id='mc'><div id='columnContent'></div><div id='spanner
'></div></div>"); | 135 setMulticolHTML("<div id='mc'><div id='columnContent'></div><div id='spanner
'></div></div>"); |
| 130 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 136 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 131 ASSERT_EQ(columnSetSignature(flowThread), "cs"); | 137 ASSERT_EQ(columnSetSignature(flowThread), "cs"); |
| 132 RenderMultiColumnSet* columnSet = flowThread->lastMultiColumnSet(); | 138 RenderBox* columnBox = flowThread->lastMultiColumnBox(); |
| 133 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 139 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 134 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
columnContent")->renderer()), nullptr); | 140 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("columnContent")->renderer()), nullptr); |
| 135 } | 141 } |
| 136 | 142 |
| 137 TEST_F(MultiColumnRenderingTest, SpannerThenContent) | 143 TEST_F(MultiColumnRenderingTest, SpannerThenContent) |
| 138 { | 144 { |
| 139 // With a spanner followed by some column content, we need a spanner set fol
lowed by a column set. | 145 // With a spanner followed by some column content, we need a spanner set fol
lowed by a column set. |
| 140 setMulticolHTML("<div id='mc'><div id='spanner'></div><div id='columnContent
'></div></div>"); | 146 setMulticolHTML("<div id='mc'><div id='spanner'></div><div id='columnContent
'></div></div>"); |
| 141 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 147 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 142 ASSERT_EQ(columnSetSignature(flowThread), "sc"); | 148 ASSERT_EQ(columnSetSignature(flowThread), "sc"); |
| 143 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 149 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 144 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 150 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 145 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
columnContent")->renderer()), nullptr); | 151 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("columnContent")->renderer()), nullptr); |
| 146 } | 152 } |
| 147 | 153 |
| 148 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) | 154 TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) |
| 149 { | 155 { |
| 150 // With column content followed by a spanner followed by some column content
, we need a column | 156 // With column content followed by a spanner followed by some column content
, we need a column |
| 151 // set followed by a spanner set followed by a column set. | 157 // set followed by a spanner set followed by a column set. |
| 152 setMulticolHTML("<div id='mc'><div id='columnContentBefore'></div><div id='s
panner'></div><div id='columnContentAfter'></div></div>"); | 158 setMulticolHTML("<div id='mc'><div id='columnContentBefore'></div><div id='s
panner'></div><div id='columnContentAfter'></div></div>"); |
| 153 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 159 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 154 ASSERT_EQ(columnSetSignature(flowThread), "csc"); | 160 ASSERT_EQ(columnSetSignature(flowThread), "csc"); |
| 155 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet()->nextSib
lingMultiColumnSet(); | 161 RenderBox* columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBo
xOf(flowThread->firstMultiColumnSet()); |
| 156 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
columnContentBefore")->renderer()), nullptr); | 162 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("columnContentBefore")->renderer()), nullptr); |
| 157 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 163 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 158 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
columnContentAfter")->renderer()), nullptr); | 164 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("columnContentAfter")->renderer()), nullptr); |
| 159 } | 165 } |
| 160 | 166 |
| 161 TEST_F(MultiColumnRenderingTest, TwoSpanners) | 167 TEST_F(MultiColumnRenderingTest, TwoSpanners) |
| 162 { | 168 { |
| 163 // With two spanners and no column content, we need two spanner sets. | 169 // With two spanners and no column content, we need two spanner sets. |
| 164 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='spanner2'></
div></div>"); | 170 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='spanner2'></
div></div>"); |
| 165 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 171 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 166 ASSERT_EQ(columnSetSignature(flowThread), "ss"); | 172 ASSERT_EQ(columnSetSignature(flowThread), "ss"); |
| 167 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 173 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 168 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner1")->renderer()), columnSet); | 174 EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); |
| 169 columnSet = columnSet->nextSiblingMultiColumnSet(); | 175 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner1")->renderer()), columnBox); |
| 170 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner2")->renderer()), columnSet); | 176 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol
der(), columnBox); |
| 177 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 178 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner2")->renderer()), columnBox); |
| 179 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol
der(), columnBox); |
| 171 } | 180 } |
| 172 | 181 |
| 173 TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner) | 182 TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner) |
| 174 { | 183 { |
| 175 // With two spanners and some column content in-between, we need a spanner s
et, a column set and another spanner set. | 184 // With two spanners and some column content in-between, we need a spanner s
et, a column set and another spanner set. |
| 176 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='columnConten
t'></div><div id='spanner2'></div></div>"); | 185 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='columnConten
t'></div><div id='spanner2'></div></div>"); |
| 177 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 186 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 178 ASSERT_EQ(columnSetSignature(flowThread), "scs"); | 187 ASSERT_EQ(columnSetSignature(flowThread), "scs"); |
| 179 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 188 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); |
| 180 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner1")->renderer()), columnSet); | 189 EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr); |
| 181 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
columnContent")->renderer()), nullptr); | 190 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 182 columnSet = columnSet->nextSiblingMultiColumnSet()->nextSiblingMultiColumnSe
t(); | 191 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner1")->renderer()), columnBox); |
| 183 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner2")->renderer()), columnSet); | 192 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 193 EXPECT_EQ(columnBox, columnSet); |
| 194 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("columnContent")->renderer()), nullptr); |
| 195 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 196 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner2")->renderer()), columnBox); |
| 184 } | 197 } |
| 185 | 198 |
| 186 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) | 199 TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) |
| 187 { | 200 { |
| 188 // column-span:all on something inside column-span:all has no effect. | 201 // column-span:all on something inside column-span:all has no effect. |
| 189 setMulticolHTML("<div id='mc'><div id='spanner'><div id='invalidSpanner' cla
ss='s'></div></div></div>"); | 202 setMulticolHTML("<div id='mc'><div id='spanner'><div id='invalidSpanner' cla
ss='s'></div></div></div>"); |
| 190 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 203 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 191 ASSERT_EQ(columnSetSignature(flowThread), "s"); | 204 ASSERT_EQ(columnSetSignature(flowThread), "s"); |
| 192 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 205 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 193 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 206 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 194 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
invalidSpanner")->renderer()), columnSet); | 207 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("invalidSpanner")->renderer()), columnBox); |
| 195 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner")->renderer()); | 208 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner")->renderer()); |
| 209 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold
er(), columnBox); |
| 210 EXPECT_EQ(document().getElementById("invalidSpanner")->renderer()->spannerPl
aceholder(), nullptr); |
| 196 } | 211 } |
| 197 | 212 |
| 198 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) | 213 TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) |
| 199 { | 214 { |
| 200 setMulticolHTML("<div id='mc'><div id='outer'><div id='block1'></div><div id
='spanner'></div><div id='block2'></div></div></div>"); | 215 setMulticolHTML("<div id='mc'><div id='outer'><div id='block1'></div><div id
='spanner'></div><div id='block2'></div></div></div>"); |
| 201 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 216 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 202 EXPECT_EQ(columnSetSignature(flowThread), "csc"); | 217 EXPECT_EQ(columnSetSignature(flowThread), "csc"); |
| 203 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet()->nextSib
lingMultiColumnSet(); | 218 RenderBox* columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBo
xOf(flowThread->firstMultiColumnSet()); |
| 204 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner")->renderer()), columnSet); | 219 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner")->renderer()), columnBox); |
| 205 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner")->renderer()); | 220 EXPECT_EQ(document().getElementById("spanner")->renderer()->spannerPlacehold
er(), columnBox); |
| 206 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
outer")->renderer()), nullptr); | 221 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner")->renderer()); |
| 207 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
block1")->renderer()), nullptr); | 222 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("outer")->renderer()), nullptr); |
| 208 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
block2")->renderer()), nullptr); | 223 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("block1")->renderer()), nullptr); |
| 224 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("block2")->renderer()), nullptr); |
| 209 } | 225 } |
| 210 | 226 |
| 211 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) | 227 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) |
| 212 { | 228 { |
| 213 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='outer'>text<
div id='spanner2'></div><div id='after'></div></div></div>"); | 229 setMulticolHTML("<div id='mc'><div id='spanner1'></div><div id='outer'>text<
div id='spanner2'></div><div id='after'></div></div></div>"); |
| 214 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 230 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 215 EXPECT_EQ(columnSetSignature(flowThread), "scsc"); | 231 EXPECT_EQ(columnSetSignature(flowThread), "scsc"); |
| 216 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); | 232 RenderBox* columnBox = flowThread->firstMultiColumnBox(); |
| 217 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner1")->renderer()), columnSet); | 233 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner1")->renderer()), columnBox); |
| 218 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner1")->renderer()); | 234 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner1")->renderer()); |
| 219 columnSet = columnSet->nextSiblingMultiColumnSet()->nextSiblingMultiColumnSe
t(); | 235 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol
der(), columnBox); |
| 220 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner2")->renderer()), columnSet); | 236 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 221 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner2")->renderer()); | 237 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 222 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
outer")->renderer()), nullptr); | 238 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner2")->renderer()), columnBox); |
| 223 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
after")->renderer()), nullptr); | 239 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner2")->renderer()); |
| 240 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol
der(), columnBox); |
| 241 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("outer")->renderer()), nullptr); |
| 242 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("after")->renderer()), nullptr); |
| 224 } | 243 } |
| 225 | 244 |
| 226 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) | 245 TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) |
| 227 { | 246 { |
| 228 setMulticolHTML("<div id='mc'><div id='outer'>text<div id='spanner1'></div>t
ext</div><div id='spanner2'></div></div>"); | 247 setMulticolHTML("<div id='mc'><div id='outer'>text<div id='spanner1'></div>t
ext</div><div id='spanner2'></div></div>"); |
| 229 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); | 248 RenderMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
| 230 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); | 249 EXPECT_EQ(columnSetSignature(flowThread), "cscs"); |
| 231 RenderMultiColumnSet* columnSet = flowThread->firstMultiColumnSet()->nextSib
lingMultiColumnSet(); | 250 RenderBox* columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBo
xOf(flowThread->firstMultiColumnSet()); |
| 232 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner1")->renderer()), columnSet); | 251 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner1")->renderer()), columnBox); |
| 233 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner1")->renderer()); | 252 EXPECT_EQ(document().getElementById("spanner1")->renderer()->spannerPlacehol
der(), columnBox); |
| 234 columnSet = columnSet->nextSiblingMultiColumnSet()->nextSiblingMultiColumnSe
t(); | 253 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner1")->renderer()); |
| 235 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
spanner2")->renderer()), columnSet); | 254 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 236 EXPECT_EQ(toRenderMultiColumnSpannerSet(columnSet)->rendererInFlowThread(),
document().getElementById("spanner2")->renderer()); | 255 columnBox = RenderMultiColumnFlowThread::nextSiblingMultiColumnBoxOf(columnB
ox); |
| 237 EXPECT_EQ(flowThread->containingColumnSpannerSet(document().getElementById("
outer")->renderer()), nullptr); | 256 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("spanner2")->renderer()), columnBox); |
| 257 EXPECT_EQ(document().getElementById("spanner2")->renderer()->spannerPlacehol
der(), columnBox); |
| 258 EXPECT_EQ(toRenderMultiColumnSpannerPlaceholder(columnBox)->rendererInFlowTh
read(), document().getElementById("spanner2")->renderer()); |
| 259 EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getEleme
ntById("outer")->renderer()), nullptr); |
| 238 } | 260 } |
| 239 | 261 |
| 240 } // anonymous namespace | 262 } // anonymous namespace |
| 241 | 263 |
| 242 } // namespace blink | 264 } // namespace blink |
| OLD | NEW |