| Index: Source/core/dom/PositionTest.cpp
|
| diff --git a/Source/core/dom/PositionTest.cpp b/Source/core/dom/PositionTest.cpp
|
| index f1e4ef9092636f51ca133325d8611645de93cfe6..a78af36aecd35ea5bab98d13f1d22f435dd68053 100644
|
| --- a/Source/core/dom/PositionTest.cpp
|
| +++ b/Source/core/dom/PositionTest.cpp
|
| @@ -75,4 +75,28 @@ TEST_F(PositionTest, NodeAsRangeLastNodeShadow)
|
| EXPECT_EQ(t1, PositionInComposedTree::afterNode(host).nodeAsRangeLastNode());
|
| }
|
|
|
| +TEST_F(PositionTest, ToPositionInComposedTreeWithActiveInsertionPoint)
|
| +{
|
| + const char* bodyContent = "<p id='host'>00<b id='one'>11</b>22</p>";
|
| + const char* shadowContent = "<a id='a'><content select=#one id='content'></content><content></content></a>";
|
| + setBodyContent(bodyContent);
|
| + RefPtrWillBeRawPtr<ShadowRoot> shadowRoot = setShadowContent(shadowContent);
|
| + RefPtrWillBeRawPtr<Element> anchor = shadowRoot->getElementById("a");
|
| + RefPtrWillBeRawPtr<Element> insertionPoint = shadowRoot->getElementById("content");
|
| +
|
| + EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(positionInDOMTree(*anchor, 0)));
|
| + EXPECT_EQ(positionInComposedTree(*anchor, 1), toPositionInComposedTree(positionInDOMTree(*anchor, 1)));
|
| + EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsAfterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 2)));
|
| +}
|
| +
|
| +TEST_F(PositionTest, ToPositionInComposedTreeWithInactiveInsertionPoint)
|
| +{
|
| + const char* bodyContent = "<p id='p'><content></content></p>";
|
| + setBodyContent(bodyContent);
|
| + RefPtrWillBeRawPtr<Element> anchor = document().getElementById("p");
|
| +
|
| + EXPECT_EQ(positionInComposedTree(*anchor, 0), toPositionInComposedTree(positionInDOMTree(*anchor, 0)));
|
| + EXPECT_EQ(PositionInComposedTree(anchor, PositionInComposedTree::PositionIsAfterChildren), toPositionInComposedTree(positionInDOMTree(*anchor, 1)));
|
| +}
|
| +
|
| } // namespace blink
|
|
|