Index: third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp |
diff --git a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp |
index be6c40e4d7353ea7aea954fabbe8866746f44e83..e687e827c075e397134caf3d22b0ecc77ce076b8 100644 |
--- a/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp |
+++ b/third_party/WebKit/Source/core/layout/LayoutMultiColumnFlowThreadTest.cpp |
@@ -28,13 +28,9 @@ public: |
LayoutMultiColumnFlowThread* MultiColumnRenderingTest::findFlowThread(const char* id) const |
{ |
- Node* multicol = document().getElementById(id); |
- if (!multicol) |
- return nullptr; |
- LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(multicol->layoutObject()); |
- if (!multicolContainer) |
- return nullptr; |
- return multicolContainer->multiColumnFlowThread(); |
+ if (LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElementId(id))) |
+ return multicolContainer->multiColumnFlowThread(); |
+ return nullptr; |
} |
String MultiColumnRenderingTest::columnSetSignature(LayoutMultiColumnFlowThread* flowThread) |
@@ -72,9 +68,7 @@ TEST_F(MultiColumnRenderingTest, OneBlockWithInDepthTreeStructureCheck) |
{ |
// Examine the layout tree established by a simple multicol container with a block with some text inside. |
setMulticolHTML("<div id='mc'><div>xxx</div></div>"); |
- Node* multicol = document().getElementById("mc"); |
- ASSERT_TRUE(multicol); |
- LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(multicol->layoutObject()); |
+ LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElementId("mc")); |
ASSERT_TRUE(multicolContainer); |
LayoutMultiColumnFlowThread* flowThread = multicolContainer->multiColumnFlowThread(); |
ASSERT_TRUE(flowThread); |
@@ -107,7 +101,7 @@ TEST_F(MultiColumnRenderingTest, OneBlock) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "c"); |
LayoutMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("block")->layoutObject()), columnSet); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("block")), columnSet); |
} |
TEST_F(MultiColumnRenderingTest, TwoBlocks) |
@@ -117,8 +111,8 @@ TEST_F(MultiColumnRenderingTest, TwoBlocks) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "c"); |
LayoutMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("block1")->layoutObject()), columnSet); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("block2")->layoutObject()), columnSet); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("block1")), columnSet); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("block2")), columnSet); |
} |
TEST_F(MultiColumnRenderingTest, Spanner) |
@@ -129,8 +123,8 @@ TEST_F(MultiColumnRenderingTest, Spanner) |
ASSERT_EQ(columnSetSignature(flowThread), "s"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner")->layoutObject()->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner")->spannerPlaceholder(), columnBox); |
} |
TEST_F(MultiColumnRenderingTest, ContentThenSpanner) |
@@ -140,10 +134,10 @@ TEST_F(MultiColumnRenderingTest, ContentThenSpanner) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "cs"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("columnContent")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("columnContent")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("columnContent")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("columnContent")), nullptr); |
} |
TEST_F(MultiColumnRenderingTest, SpannerThenContent) |
@@ -153,10 +147,10 @@ TEST_F(MultiColumnRenderingTest, SpannerThenContent) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "sc"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("columnContent")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("columnContent")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("columnContent")), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("columnContent")), nullptr); |
} |
TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) |
@@ -167,13 +161,13 @@ TEST_F(MultiColumnRenderingTest, ContentThenSpannerThenContent) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "csc"); |
LayoutBox* columnBox = flowThread->firstMultiColumnSet(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("columnContentBefore")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("columnContentBefore")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("columnContentBefore")), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("columnContentBefore")), nullptr); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("columnContentAfter")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("columnContentAfter")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("columnContentAfter")), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("columnContentAfter")), nullptr); |
} |
TEST_F(MultiColumnRenderingTest, TwoSpanners) |
@@ -184,11 +178,11 @@ TEST_F(MultiColumnRenderingTest, TwoSpanners) |
ASSERT_EQ(columnSetSignature(flowThread), "ss"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
EXPECT_EQ(flowThread->firstMultiColumnSet(), nullptr); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner1")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner1")->layoutObject()->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner1")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner1")->spannerPlaceholder(), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner2")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner2")->layoutObject()->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner2")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner2")->spannerPlaceholder(), columnBox); |
} |
TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner) |
@@ -200,13 +194,13 @@ TEST_F(MultiColumnRenderingTest, SpannerThenContentThenSpanner) |
LayoutMultiColumnSet* columnSet = flowThread->firstMultiColumnSet(); |
EXPECT_EQ(columnSet->nextSiblingMultiColumnSet(), nullptr); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner1")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner1")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
EXPECT_EQ(columnBox, columnSet); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("columnContent")->layoutObject()), columnSet); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("columnContent")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("columnContent")), columnSet); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("columnContent")), nullptr); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner2")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner2")), columnBox); |
} |
TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) |
@@ -216,11 +210,11 @@ TEST_F(MultiColumnRenderingTest, SpannerWithSpanner) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
ASSERT_EQ(columnSetSignature(flowThread), "s"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("invalidSpanner")->layoutObject()), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner")->layoutObject()); |
- EXPECT_EQ(document().getElementById("spanner")->layoutObject()->spannerPlaceholder(), columnBox); |
- EXPECT_EQ(document().getElementById("invalidSpanner")->layoutObject()->spannerPlaceholder(), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("invalidSpanner")), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner")); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner")->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("invalidSpanner")->spannerPlaceholder(), nullptr); |
} |
TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) |
@@ -229,17 +223,17 @@ TEST_F(MultiColumnRenderingTest, SubtreeWithSpanner) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
EXPECT_EQ(columnSetSignature(flowThread), "csc"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("outer")->layoutObject()), columnBox); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("block1")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("outer")), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("block1")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner")->layoutObject()->spannerPlaceholder(), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner")->layoutObject()); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("outer")->layoutObject()), nullptr); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("block1")->layoutObject()), nullptr); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("block2")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner")->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner")); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("outer")), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("block1")), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("block2")), nullptr); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("block2")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("block2")), columnBox); |
} |
TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) |
@@ -248,19 +242,19 @@ TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerAfterSpanner) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
EXPECT_EQ(columnSetSignature(flowThread), "scsc"); |
LayoutBox* columnBox = flowThread->firstMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner1")->layoutObject()), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner1")->layoutObject()); |
- EXPECT_EQ(document().getElementById("spanner1")->layoutObject()->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner1")), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner1")); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner1")->spannerPlaceholder(), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("outer")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("outer")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner2")->layoutObject()), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner2")->layoutObject()); |
- EXPECT_EQ(document().getElementById("spanner2")->layoutObject()->spannerPlaceholder(), columnBox); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("outer")->layoutObject()), nullptr); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("after")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner2")), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner2")); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner2")->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("outer")), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("after")), nullptr); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("after")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("after")), columnBox); |
} |
TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) |
@@ -269,16 +263,16 @@ TEST_F(MultiColumnRenderingTest, SubtreeWithSpannerBeforeSpanner) |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
EXPECT_EQ(columnSetSignature(flowThread), "cscs"); |
LayoutBox* columnBox = flowThread->firstMultiColumnSet(); |
- EXPECT_EQ(flowThread->mapDescendantToColumnSet(document().getElementById("outer")->layoutObject()), columnBox); |
+ EXPECT_EQ(flowThread->mapDescendantToColumnSet(getLayoutObjectByElementId("outer")), columnBox); |
columnBox = columnBox->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner1")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner1")->layoutObject()->spannerPlaceholder(), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner1")->layoutObject()); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner1")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner1")->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner1")); |
columnBox = columnBox->nextSiblingMultiColumnBox()->nextSiblingMultiColumnBox(); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("spanner2")->layoutObject()), columnBox); |
- EXPECT_EQ(document().getElementById("spanner2")->layoutObject()->spannerPlaceholder(), columnBox); |
- EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), document().getElementById("spanner2")->layoutObject()); |
- EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(document().getElementById("outer")->layoutObject()), nullptr); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("spanner2")), columnBox); |
+ EXPECT_EQ(getLayoutObjectByElementId("spanner2")->spannerPlaceholder(), columnBox); |
+ EXPECT_EQ(toLayoutMultiColumnSpannerPlaceholder(columnBox)->layoutObjectInFlowThread(), getLayoutObjectByElementId("spanner2")); |
+ EXPECT_EQ(flowThread->containingColumnSpannerPlaceholder(getLayoutObjectByElementId("outer")), nullptr); |
} |
TEST_F(MultiColumnRenderingTest, columnSetAtBlockOffset) |
@@ -352,9 +346,9 @@ void MultiColumnTreeModifyingTest::setMulticolHTML(const char* html) |
void MultiColumnTreeModifyingTest::reparentLayoutObject(const char* newParentId, const char* childId, const char* insertBeforeId) |
{ |
- LayoutObject* newParent = document().getElementById(newParentId)->layoutObject(); |
- LayoutObject* child = document().getElementById(childId)->layoutObject(); |
- LayoutObject* insertBefore = insertBeforeId ? document().getElementById(insertBeforeId)->layoutObject() : nullptr; |
+ LayoutObject* newParent = getLayoutObjectByElementId(newParentId); |
+ LayoutObject* child = getLayoutObjectByElementId(childId); |
+ LayoutObject* insertBefore = insertBeforeId ? getLayoutObjectByElementId(insertBeforeId) : nullptr; |
child->remove(); |
newParent->addChild(child, insertBefore); |
} |
@@ -368,15 +362,15 @@ void MultiColumnTreeModifyingTest::destroyLayoutObject(LayoutObject* child) |
void MultiColumnTreeModifyingTest::destroyLayoutObject(const char* childId) |
{ |
- destroyLayoutObject(document().getElementById(childId)->layoutObject()); |
+ destroyLayoutObject(getLayoutObjectByElementId(childId)); |
} |
TEST_F(MultiColumnTreeModifyingTest, InsertFirstContentAndRemove) |
{ |
setMulticolHTML("<div id='block'></div><div id='mc'></div>"); |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
- LayoutBlockFlow* block = toLayoutBlockFlow(document().getElementById("block")->layoutObject()); |
- LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(document().getElementById("mc")->layoutObject()); |
+ LayoutBlockFlow* block = toLayoutBlockFlow(getLayoutObjectByElementId("block")); |
+ LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElementId("mc")); |
block->remove(); |
multicolContainer->addChild(block); |
EXPECT_EQ(block->parent(), flowThread); |
@@ -416,8 +410,8 @@ TEST_F(MultiColumnTreeModifyingTest, InsertSpannerAndRemove) |
{ |
setMulticolHTML("<div id='spanner'></div><div id='mc'></div>"); |
LayoutMultiColumnFlowThread* flowThread = findFlowThread("mc"); |
- LayoutBlockFlow* spanner = toLayoutBlockFlow(document().getElementById("spanner")->layoutObject()); |
- LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(document().getElementById("mc")->layoutObject()); |
+ LayoutBlockFlow* spanner = toLayoutBlockFlow(getLayoutObjectByElementId("spanner")); |
+ LayoutBlockFlow* multicolContainer = toLayoutBlockFlow(getLayoutObjectByElementId("mc")); |
spanner->remove(); |
multicolContainer->addChild(spanner); |
EXPECT_EQ(spanner->parent(), flowThread); |