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

Unified Diff: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp

Issue 1675163002: Rename ComposedTree to FlatTree (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: wip Created 4 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
diff --git a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
index 298fb686f0337d7efbf6380c578256bcc46ccf62..746e39b1a7be4885f0695c04980b083eb731eb6d 100644
--- a/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
+++ b/third_party/WebKit/Source/core/editing/VisibleUnitsTest.cpp
@@ -26,14 +26,14 @@ VisiblePosition createVisiblePositionInDOMTree(Node& anchor, int offset, TextAff
return createVisiblePosition(Position(&anchor, offset), affinity);
}
-PositionInComposedTreeWithAffinity positionWithAffinityInComposedTree(Node& anchor, int offset, TextAffinity affinity = TextAffinity::Downstream)
+PositionInFlatTreeWithAffinity positionWithAffinityInFlatTree(Node& anchor, int offset, TextAffinity affinity = TextAffinity::Downstream)
{
- return PositionInComposedTreeWithAffinity(canonicalPositionOf(PositionInComposedTree(&anchor, offset)), affinity);
+ return PositionInFlatTreeWithAffinity(canonicalPositionOf(PositionInFlatTree(&anchor, offset)), affinity);
}
-VisiblePositionInComposedTree createVisiblePositionInComposedTree(Node& anchor, int offset, TextAffinity affinity = TextAffinity::Downstream)
+VisiblePositionInFlatTree createVisiblePositionInFlatTree(Node& anchor, int offset, TextAffinity affinity = TextAffinity::Downstream)
{
- return createVisiblePosition(PositionInComposedTree(&anchor, offset), affinity);
+ return createVisiblePosition(PositionInFlatTree(&anchor, offset), affinity);
}
} // namespace
@@ -61,10 +61,10 @@ TEST_F(VisibleUnitsTest, absoluteCaretBoundsOf)
RefPtrWillBeRawPtr<Element> one = body->querySelector("#one", ASSERT_NO_EXCEPTION);
IntRect boundsInDOMTree = absoluteCaretBoundsOf(createVisiblePosition(Position(one.get(), 0)));
- IntRect boundsInComposedTree = absoluteCaretBoundsOf(createVisiblePosition(PositionInComposedTree(one.get(), 0)));
+ IntRect boundsInFlatTree = absoluteCaretBoundsOf(createVisiblePosition(PositionInFlatTree(one.get(), 0)));
EXPECT_FALSE(boundsInDOMTree.isEmpty());
- EXPECT_EQ(boundsInDOMTree, boundsInComposedTree);
+ EXPECT_EQ(boundsInDOMTree, boundsInFlatTree);
}
TEST_F(VisibleUnitsTest, associatedLayoutObjectOfFirstLetterPunctuations)
@@ -159,10 +159,10 @@ TEST_F(VisibleUnitsTest, characterAfter)
RefPtrWillBeRawPtr<Element> two = document().getElementById("two");
EXPECT_EQ('2', characterAfter(createVisiblePositionInDOMTree(*one->firstChild(), 1)));
- EXPECT_EQ('5', characterAfter(createVisiblePositionInComposedTree(*one->firstChild(), 1)));
+ EXPECT_EQ('5', characterAfter(createVisiblePositionInFlatTree(*one->firstChild(), 1)));
EXPECT_EQ(0, characterAfter(createVisiblePositionInDOMTree(*two->firstChild(), 2)));
- EXPECT_EQ('1', characterAfter(createVisiblePositionInComposedTree(*two->firstChild(), 2)));
+ EXPECT_EQ('1', characterAfter(createVisiblePositionInFlatTree(*two->firstChild(), 2)));
}
TEST_F(VisibleUnitsTest, canonicalPositionOfWithHTMLHtmlElement)
@@ -211,16 +211,16 @@ TEST_F(VisibleUnitsTest, characterBefore)
Node* five = shadowRoot->getElementById("five")->firstChild();
EXPECT_EQ(0, characterBefore(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_EQ('2', characterBefore(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_EQ('2', characterBefore(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_EQ('1', characterBefore(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_EQ('1', characterBefore(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_EQ('1', characterBefore(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_EQ('1', characterBefore(createVisiblePositionInDOMTree(*two, 0)));
- EXPECT_EQ('4', characterBefore(createVisiblePositionInComposedTree(*two, 0)));
+ EXPECT_EQ('4', characterBefore(createVisiblePositionInFlatTree(*two, 0)));
EXPECT_EQ('4', characterBefore(createVisiblePositionInDOMTree(*five, 0)));
- EXPECT_EQ('1', characterBefore(createVisiblePositionInComposedTree(*five, 0)));
+ EXPECT_EQ('1', characterBefore(createVisiblePositionInFlatTree(*five, 0)));
}
TEST_F(VisibleUnitsTest, computeInlineBoxPosition)
@@ -237,21 +237,21 @@ TEST_F(VisibleUnitsTest, computeInlineBoxPosition)
Node* four = shadowRoot->getElementById("four")->firstChild();
Node* five = shadowRoot->getElementById("five")->firstChild();
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(one, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*one, 0)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(one, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(one, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*one, 0)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(one, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*one, 1)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(two, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*two, 0)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(two, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*two, 1)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(two, 2), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*two, 2)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(two, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*two, 0)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(two, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*two, 1)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(two, 2), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*two, 2)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(three, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*three, 0)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(three, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*three, 1)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(three, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*three, 0)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(three, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*three, 1)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(four, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*four, 0)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(four, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*four, 1)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(four, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*four, 0)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(four, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*four, 1)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(five, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*five, 0)));
- EXPECT_EQ(computeInlineBoxPosition(PositionInComposedTree(five, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInComposedTree(*five, 1)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(five, 0), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*five, 0)));
+ EXPECT_EQ(computeInlineBoxPosition(PositionInFlatTree(five, 1), TextAffinity::Downstream), computeInlineBoxPosition(createVisiblePositionInFlatTree(*five, 1)));
}
TEST_F(VisibleUnitsTest, endOfDocument)
@@ -266,10 +266,10 @@ TEST_F(VisibleUnitsTest, endOfDocument)
Element* two = document().getElementById("two");
EXPECT_EQ(Position(two->firstChild(), 2), endOfDocument(createVisiblePositionInDOMTree(*one->firstChild(), 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one->firstChild(), 1), endOfDocument(createVisiblePositionInComposedTree(*one->firstChild(), 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one->firstChild(), 1), endOfDocument(createVisiblePositionInFlatTree(*one->firstChild(), 0)).deepEquivalent());
EXPECT_EQ(Position(two->firstChild(), 2), endOfDocument(createVisiblePositionInDOMTree(*two->firstChild(), 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one->firstChild(), 1), endOfDocument(createVisiblePositionInComposedTree(*two->firstChild(), 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one->firstChild(), 1), endOfDocument(createVisiblePositionInFlatTree(*two->firstChild(), 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, endOfLine)
@@ -289,33 +289,33 @@ TEST_F(VisibleUnitsTest, endOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_EQ(Position(seven, 7), endOfLine(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), endOfLine(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), endOfLine(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), endOfLine(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), endOfLine(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), endOfLine(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), endOfLine(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfLine(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfLine(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
// TODO(yosin) endOfLine(two, 1) -> (five, 5) is a broken result. We keep
// it as a marker for future change.
EXPECT_EQ(Position(five, 5), endOfLine(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfLine(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfLine(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 5), endOfLine(createVisiblePositionInDOMTree(*three, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfLine(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfLine(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 4), endOfLine(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfLine(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfLine(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 5), endOfLine(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfLine(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfLine(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
EXPECT_EQ(Position(six, 6), endOfLine(createVisiblePositionInDOMTree(*six, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(six, 6), endOfLine(createVisiblePositionInComposedTree(*six, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(six, 6), endOfLine(createVisiblePositionInFlatTree(*six, 1)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), endOfLine(createVisiblePositionInDOMTree(*seven, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), endOfLine(createVisiblePositionInComposedTree(*seven, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), endOfLine(createVisiblePositionInFlatTree(*seven, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, endOfParagraphFirstLetter)
@@ -365,10 +365,10 @@ TEST_F(VisibleUnitsTest, endOfParagraphShadow)
Element* three = document().getElementById("three");
EXPECT_EQ(Position(three->firstChild(), 3), endOfParagraph(createVisiblePositionInDOMTree(*one->firstChild(), 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one->firstChild(), 1), endOfParagraph(createVisiblePositionInComposedTree(*one->firstChild(), 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one->firstChild(), 1), endOfParagraph(createVisiblePositionInFlatTree(*one->firstChild(), 1)).deepEquivalent());
EXPECT_EQ(Position(three->firstChild(), 3), endOfParagraph(createVisiblePositionInDOMTree(*two->firstChild(), 2)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two->firstChild(), 2), endOfParagraph(createVisiblePositionInComposedTree(*two->firstChild(), 2)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two->firstChild(), 2), endOfParagraph(createVisiblePositionInFlatTree(*two->firstChild(), 2)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, endOfParagraphSimple)
@@ -420,22 +420,22 @@ TEST_F(VisibleUnitsTest, endOfSentence)
Node* four = shadowRoot->getElementById("four")->firstChild();
EXPECT_EQ(Position(two, 2), endOfSentence(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(two, 2), endOfSentence(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(two, 2), endOfSentence(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(two, 2), endOfSentence(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 4), endOfSentence(createVisiblePositionInDOMTree(*three, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 4), endOfSentence(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), endOfSentence(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), endOfSentence(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, endOfWord)
@@ -453,25 +453,25 @@ TEST_F(VisibleUnitsTest, endOfWord)
Node* five = shadowRoot->getElementById("five")->firstChild();
EXPECT_EQ(Position(three, 3), endOfWord(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 5), endOfWord(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 5), endOfWord(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(three, 3), endOfWord(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 5), endOfWord(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 5), endOfWord(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(three, 3), endOfWord(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfWord(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfWord(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(three, 3), endOfWord(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfWord(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfWord(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(three, 3), endOfWord(createVisiblePositionInDOMTree(*three, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 3), endOfWord(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 3), endOfWord(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 5), endOfWord(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), endOfWord(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), endOfWord(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 5), endOfWord(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 5), endOfWord(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 5), endOfWord(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContent)
@@ -486,10 +486,10 @@ TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContent)
Element* two = document().getElementById("two");
EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInDOMTree(*one->firstChild(), 1)));
- EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInComposedTree(*one->firstChild(), 1)));
+ EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInFlatTree(*one->firstChild(), 1)));
EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInDOMTree(*two->firstChild(), 2)));
- EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInComposedTree(*two->firstChild(), 2)));
+ EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInFlatTree(*two->firstChild(), 2)));
}
TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContentWithInput)
@@ -501,13 +501,13 @@ TEST_F(VisibleUnitsTest, isEndOfEditableOrNonEditableContentWithInput)
Node* text = toHTMLTextFormControlElement(document().getElementById("sample"))->innerEditorElement()->firstChild();
EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInDOMTree(*text, 0)));
- EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInComposedTree(*text, 0)));
+ EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInFlatTree(*text, 0)));
EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInDOMTree(*text, 1)));
- EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInComposedTree(*text, 1)));
+ EXPECT_FALSE(isEndOfEditableOrNonEditableContent(createVisiblePositionInFlatTree(*text, 1)));
EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInDOMTree(*text, 2)));
- EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInComposedTree(*text, 2)));
+ EXPECT_TRUE(isEndOfEditableOrNonEditableContent(createVisiblePositionInFlatTree(*text, 2)));
}
TEST_F(VisibleUnitsTest, isEndOfLine)
@@ -527,28 +527,28 @@ TEST_F(VisibleUnitsTest, isEndOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_FALSE(isEndOfLine(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_FALSE(isEndOfLine(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_FALSE(isEndOfLine(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_FALSE(isEndOfLine(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_FALSE(isEndOfLine(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_FALSE(isEndOfLine(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_FALSE(isEndOfLine(createVisiblePositionInDOMTree(*two, 2)));
- EXPECT_TRUE(isEndOfLine(createVisiblePositionInComposedTree(*two, 2)));
+ EXPECT_TRUE(isEndOfLine(createVisiblePositionInFlatTree(*two, 2)));
EXPECT_FALSE(isEndOfLine(createVisiblePositionInDOMTree(*three, 3)));
- EXPECT_FALSE(isEndOfLine(createVisiblePositionInComposedTree(*three, 3)));
+ EXPECT_FALSE(isEndOfLine(createVisiblePositionInFlatTree(*three, 3)));
EXPECT_TRUE(isEndOfLine(createVisiblePositionInDOMTree(*four, 4)));
- EXPECT_TRUE(isEndOfLine(createVisiblePositionInComposedTree(*four, 4)));
+ EXPECT_TRUE(isEndOfLine(createVisiblePositionInFlatTree(*four, 4)));
EXPECT_TRUE(isEndOfLine(createVisiblePositionInDOMTree(*five, 5)));
- EXPECT_FALSE(isEndOfLine(createVisiblePositionInComposedTree(*five, 5)));
+ EXPECT_FALSE(isEndOfLine(createVisiblePositionInFlatTree(*five, 5)));
EXPECT_TRUE(isEndOfLine(createVisiblePositionInDOMTree(*six, 6)));
- EXPECT_TRUE(isEndOfLine(createVisiblePositionInComposedTree(*six, 6)));
+ EXPECT_TRUE(isEndOfLine(createVisiblePositionInFlatTree(*six, 6)));
EXPECT_TRUE(isEndOfLine(createVisiblePositionInDOMTree(*seven, 7)));
- EXPECT_TRUE(isEndOfLine(createVisiblePositionInComposedTree(*seven, 7)));
+ EXPECT_TRUE(isEndOfLine(createVisiblePositionInFlatTree(*seven, 7)));
}
TEST_F(VisibleUnitsTest, isLogicalEndOfLine)
@@ -568,28 +568,28 @@ TEST_F(VisibleUnitsTest, isLogicalEndOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*two, 2)));
- EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*two, 2)));
+ EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*two, 2)));
EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*three, 3)));
- EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*three, 3)));
+ EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*three, 3)));
EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*four, 4)));
- EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*four, 4)));
+ EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*four, 4)));
EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*five, 5)));
- EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*five, 5)));
+ EXPECT_FALSE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*five, 5)));
EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*six, 6)));
- EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*six, 6)));
+ EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*six, 6)));
EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInDOMTree(*seven, 7)));
- EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInComposedTree(*seven, 7)));
+ EXPECT_TRUE(isLogicalEndOfLine(createVisiblePositionInFlatTree(*seven, 7)));
}
TEST_F(VisibleUnitsTest, inSameLine)
@@ -616,15 +616,15 @@ TEST_F(VisibleUnitsTest, inSameLine)
EXPECT_FALSE(inSameLine(createVisiblePositionInDOMTree(*one->firstChild(), 0), createVisiblePositionInDOMTree(*five->firstChild(), 0)));
EXPECT_FALSE(inSameLine(createVisiblePositionInDOMTree(*two->firstChild(), 0), createVisiblePositionInDOMTree(*four->firstChild(), 0)));
- EXPECT_FALSE(inSameLine(positionWithAffinityInComposedTree(*one, 0), positionWithAffinityInComposedTree(*two, 0)));
- EXPECT_FALSE(inSameLine(positionWithAffinityInComposedTree(*one->firstChild(), 0), positionWithAffinityInComposedTree(*two->firstChild(), 0)));
- EXPECT_FALSE(inSameLine(positionWithAffinityInComposedTree(*one->firstChild(), 0), positionWithAffinityInComposedTree(*five->firstChild(), 0)));
- EXPECT_TRUE(inSameLine(positionWithAffinityInComposedTree(*two->firstChild(), 0), positionWithAffinityInComposedTree(*four->firstChild(), 0)));
+ EXPECT_FALSE(inSameLine(positionWithAffinityInFlatTree(*one, 0), positionWithAffinityInFlatTree(*two, 0)));
+ EXPECT_FALSE(inSameLine(positionWithAffinityInFlatTree(*one->firstChild(), 0), positionWithAffinityInFlatTree(*two->firstChild(), 0)));
+ EXPECT_FALSE(inSameLine(positionWithAffinityInFlatTree(*one->firstChild(), 0), positionWithAffinityInFlatTree(*five->firstChild(), 0)));
+ EXPECT_TRUE(inSameLine(positionWithAffinityInFlatTree(*two->firstChild(), 0), positionWithAffinityInFlatTree(*four->firstChild(), 0)));
- EXPECT_FALSE(inSameLine(createVisiblePositionInComposedTree(*one, 0), createVisiblePositionInComposedTree(*two, 0)));
- EXPECT_FALSE(inSameLine(createVisiblePositionInComposedTree(*one->firstChild(), 0), createVisiblePositionInComposedTree(*two->firstChild(), 0)));
- EXPECT_FALSE(inSameLine(createVisiblePositionInComposedTree(*one->firstChild(), 0), createVisiblePositionInComposedTree(*five->firstChild(), 0)));
- EXPECT_TRUE(inSameLine(createVisiblePositionInComposedTree(*two->firstChild(), 0), createVisiblePositionInComposedTree(*four->firstChild(), 0)));
+ EXPECT_FALSE(inSameLine(createVisiblePositionInFlatTree(*one, 0), createVisiblePositionInFlatTree(*two, 0)));
+ EXPECT_FALSE(inSameLine(createVisiblePositionInFlatTree(*one->firstChild(), 0), createVisiblePositionInFlatTree(*two->firstChild(), 0)));
+ EXPECT_FALSE(inSameLine(createVisiblePositionInFlatTree(*one->firstChild(), 0), createVisiblePositionInFlatTree(*five->firstChild(), 0)));
+ EXPECT_TRUE(inSameLine(createVisiblePositionInFlatTree(*two->firstChild(), 0), createVisiblePositionInFlatTree(*four->firstChild(), 0)));
}
TEST_F(VisibleUnitsTest, isEndOfParagraph)
@@ -640,19 +640,19 @@ TEST_F(VisibleUnitsTest, isEndOfParagraph)
Node* three = document().getElementById("three")->firstChild();
EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInDOMTree(*two, 2)));
- EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInComposedTree(*two, 2)));
+ EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInFlatTree(*two, 2)));
EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInDOMTree(*three, 0)));
- EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInComposedTree(*three, 0)));
+ EXPECT_FALSE(isEndOfParagraph(createVisiblePositionInFlatTree(*three, 0)));
EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInDOMTree(*three, 3)));
- EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInComposedTree(*three, 3)));
+ EXPECT_TRUE(isEndOfParagraph(createVisiblePositionInFlatTree(*three, 3)));
}
TEST_F(VisibleUnitsTest, isStartOfLine)
@@ -672,28 +672,28 @@ TEST_F(VisibleUnitsTest, isStartOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_TRUE(isStartOfLine(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_TRUE(isStartOfLine(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_TRUE(isStartOfLine(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_FALSE(isStartOfLine(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_FALSE(isStartOfLine(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_FALSE(isStartOfLine(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_FALSE(isStartOfLine(createVisiblePositionInDOMTree(*two, 0)));
- EXPECT_FALSE(isStartOfLine(createVisiblePositionInComposedTree(*two, 0)));
+ EXPECT_FALSE(isStartOfLine(createVisiblePositionInFlatTree(*two, 0)));
EXPECT_FALSE(isStartOfLine(createVisiblePositionInDOMTree(*three, 0)));
- EXPECT_TRUE(isStartOfLine(createVisiblePositionInComposedTree(*three, 0)));
+ EXPECT_TRUE(isStartOfLine(createVisiblePositionInFlatTree(*three, 0)));
EXPECT_FALSE(isStartOfLine(createVisiblePositionInDOMTree(*four, 0)));
- EXPECT_FALSE(isStartOfLine(createVisiblePositionInComposedTree(*four, 0)));
+ EXPECT_FALSE(isStartOfLine(createVisiblePositionInFlatTree(*four, 0)));
EXPECT_TRUE(isStartOfLine(createVisiblePositionInDOMTree(*five, 0)));
- EXPECT_TRUE(isStartOfLine(createVisiblePositionInComposedTree(*five, 0)));
+ EXPECT_TRUE(isStartOfLine(createVisiblePositionInFlatTree(*five, 0)));
EXPECT_TRUE(isStartOfLine(createVisiblePositionInDOMTree(*six, 0)));
- EXPECT_TRUE(isStartOfLine(createVisiblePositionInComposedTree(*six, 0)));
+ EXPECT_TRUE(isStartOfLine(createVisiblePositionInFlatTree(*six, 0)));
EXPECT_FALSE(isStartOfLine(createVisiblePositionInDOMTree(*seven, 0)));
- EXPECT_FALSE(isStartOfLine(createVisiblePositionInComposedTree(*seven, 0)));
+ EXPECT_FALSE(isStartOfLine(createVisiblePositionInFlatTree(*seven, 0)));
}
TEST_F(VisibleUnitsTest, isStartOfParagraph)
@@ -710,19 +710,19 @@ TEST_F(VisibleUnitsTest, isStartOfParagraph)
Node* three = document().getElementById("three")->firstChild();
EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInDOMTree(*zero, 0)));
- EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInComposedTree(*zero, 0)));
+ EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInFlatTree(*zero, 0)));
EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInDOMTree(*one, 0)));
- EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInComposedTree(*one, 0)));
+ EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInFlatTree(*one, 0)));
EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInDOMTree(*one, 1)));
- EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInComposedTree(*one, 1)));
+ EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInFlatTree(*one, 1)));
EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInDOMTree(*two, 0)));
- EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInComposedTree(*two, 0)));
+ EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInFlatTree(*two, 0)));
EXPECT_FALSE(isStartOfParagraph(createVisiblePositionInDOMTree(*three, 0)));
- EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInComposedTree(*three, 0)));
+ EXPECT_TRUE(isStartOfParagraph(createVisiblePositionInFlatTree(*three, 0)));
}
TEST_F(VisibleUnitsTest, isVisuallyEquivalentCandidateWithHTMLHtmlElement)
@@ -780,13 +780,13 @@ TEST_F(VisibleUnitsTest, leftPositionOf)
Element* five = shadowRoot->getElementById("five");
EXPECT_EQ(Position(two->firstChild(), 1), leftPositionOf(createVisiblePosition(Position(one, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two->firstChild(), 1), leftPositionOf(createVisiblePosition(PositionInComposedTree(one, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two->firstChild(), 1), leftPositionOf(createVisiblePosition(PositionInFlatTree(one, 0))).deepEquivalent());
EXPECT_EQ(Position(one->firstChild(), 0), leftPositionOf(createVisiblePosition(Position(two, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four->firstChild(), 3), leftPositionOf(createVisiblePosition(PositionInComposedTree(two, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four->firstChild(), 3), leftPositionOf(createVisiblePosition(PositionInFlatTree(two, 0))).deepEquivalent());
EXPECT_EQ(Position(two->firstChild(), 2), leftPositionOf(createVisiblePosition(Position(three, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five->firstChild(), 5), leftPositionOf(createVisiblePosition(PositionInComposedTree(three, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five->firstChild(), 5), leftPositionOf(createVisiblePosition(PositionInFlatTree(three, 0))).deepEquivalent());
}
TEST_F(VisibleUnitsTest, localCaretRectOfPosition)
@@ -802,13 +802,13 @@ TEST_F(VisibleUnitsTest, localCaretRectOfPosition)
LayoutObject* layoutObjectFromDOMTree;
LayoutRect layoutRectFromDOMTree = localCaretRectOfPosition(Position(one->firstChild(), 0), layoutObjectFromDOMTree);
- LayoutObject* layoutObjectFromComposedTree;
- LayoutRect layoutRectFromComposedTree = localCaretRectOfPosition(PositionInComposedTree(one->firstChild(), 0), layoutObjectFromComposedTree);
+ LayoutObject* layoutObjectFromFlatTree;
+ LayoutRect layoutRectFromFlatTree = localCaretRectOfPosition(PositionInFlatTree(one->firstChild(), 0), layoutObjectFromFlatTree);
EXPECT_TRUE(layoutObjectFromDOMTree);
EXPECT_FALSE(layoutRectFromDOMTree.isEmpty());
- EXPECT_EQ(layoutObjectFromDOMTree, layoutObjectFromComposedTree);
- EXPECT_EQ(layoutRectFromDOMTree, layoutRectFromComposedTree);
+ EXPECT_EQ(layoutObjectFromDOMTree, layoutObjectFromFlatTree);
+ EXPECT_EQ(layoutRectFromDOMTree, layoutRectFromFlatTree);
}
TEST_F(VisibleUnitsTest, logicalEndOfLine)
@@ -828,33 +828,33 @@ TEST_F(VisibleUnitsTest, logicalEndOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_EQ(Position(seven, 7), logicalEndOfLine(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), logicalEndOfLine(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), logicalEndOfLine(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), logicalEndOfLine(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), logicalEndOfLine(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), logicalEndOfLine(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), logicalEndOfLine(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), logicalEndOfLine(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), logicalEndOfLine(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
// TODO(yosin) logicalEndOfLine(two, 1) -> (five, 5) is a broken result. We keep
// it as a marker for future change.
EXPECT_EQ(Position(five, 5), logicalEndOfLine(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), logicalEndOfLine(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), logicalEndOfLine(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 5), logicalEndOfLine(createVisiblePositionInDOMTree(*three, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), logicalEndOfLine(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), logicalEndOfLine(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 4), logicalEndOfLine(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 4), logicalEndOfLine(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 4), logicalEndOfLine(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 5), logicalEndOfLine(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), logicalEndOfLine(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), logicalEndOfLine(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
EXPECT_EQ(Position(six, 6), logicalEndOfLine(createVisiblePositionInDOMTree(*six, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(six, 6), logicalEndOfLine(createVisiblePositionInComposedTree(*six, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(six, 6), logicalEndOfLine(createVisiblePositionInFlatTree(*six, 1)).deepEquivalent());
EXPECT_EQ(Position(seven, 7), logicalEndOfLine(createVisiblePositionInDOMTree(*seven, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(seven, 7), logicalEndOfLine(createVisiblePositionInComposedTree(*seven, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(seven, 7), logicalEndOfLine(createVisiblePositionInFlatTree(*seven, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, logicalStartOfLine)
@@ -874,33 +874,33 @@ TEST_F(VisibleUnitsTest, logicalStartOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_EQ(Position(one, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(five, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*three, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
// TODO(yosin) logicalStartOfLine(four, 1) -> (two, 2) is a broken result.
// We keep it as a marker for future change.
EXPECT_EQ(Position(two, 2), logicalStartOfLine(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
EXPECT_EQ(Position(six, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*six, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(six, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*six, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(six, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*six, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), logicalStartOfLine(createVisiblePositionInDOMTree(*seven, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), logicalStartOfLine(createVisiblePositionInComposedTree(*seven, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), logicalStartOfLine(createVisiblePositionInFlatTree(*seven, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, mostBackwardCaretPositionAfterAnchor)
@@ -914,7 +914,7 @@ TEST_F(VisibleUnitsTest, mostBackwardCaretPositionAfterAnchor)
RefPtrWillBeRawPtr<Element> host = document().getElementById("host");
EXPECT_EQ(Position::lastPositionInNode(host.get()), mostForwardCaretPosition(Position::afterNode(host.get())));
- EXPECT_EQ(PositionInComposedTree::lastPositionInNode(host.get()), mostForwardCaretPosition(PositionInComposedTree::afterNode(host.get())));
+ EXPECT_EQ(PositionInFlatTree::lastPositionInNode(host.get()), mostForwardCaretPosition(PositionInFlatTree::afterNode(host.get())));
}
TEST_F(VisibleUnitsTest, mostBackwardCaretPositionFirstLetter)
@@ -973,7 +973,7 @@ TEST_F(VisibleUnitsTest, mostForwardCaretPositionAfterAnchor)
RefPtrWillBeRawPtr<Element> three = shadowRoot->getElementById("three");
EXPECT_EQ(Position(one->firstChild(), 1), mostBackwardCaretPosition(Position::afterNode(host.get())));
- EXPECT_EQ(PositionInComposedTree(three->firstChild(), 3), mostBackwardCaretPosition(PositionInComposedTree::afterNode(host.get())));
+ EXPECT_EQ(PositionInFlatTree(three->firstChild(), 3), mostBackwardCaretPosition(PositionInFlatTree::afterNode(host.get())));
}
TEST_F(VisibleUnitsTest, mostForwardCaretPositionFirstLetter)
@@ -1014,16 +1014,16 @@ TEST_F(VisibleUnitsTest, nextPositionOf)
Element* five = shadowRoot->getElementById("five");
EXPECT_EQ(Position(one->firstChild(), 0), nextPositionOf(createVisiblePosition(Position(zero, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four->firstChild(), 0), nextPositionOf(createVisiblePosition(PositionInComposedTree(zero, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four->firstChild(), 0), nextPositionOf(createVisiblePosition(PositionInFlatTree(zero, 1))).deepEquivalent());
EXPECT_EQ(Position(one->firstChild(), 1), nextPositionOf(createVisiblePosition(Position(one, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInComposedTree(one, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInFlatTree(one, 0))).deepEquivalent());
EXPECT_EQ(Position(two->firstChild(), 1), nextPositionOf(createVisiblePosition(Position(one, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInComposedTree(one, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInFlatTree(one, 1))).deepEquivalent());
EXPECT_EQ(Position(three->firstChild(), 0), nextPositionOf(createVisiblePosition(Position(two, 2))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInComposedTree(two, 2))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one->firstChild(), 1), nextPositionOf(createVisiblePosition(PositionInFlatTree(two, 2))).deepEquivalent());
}
TEST_F(VisibleUnitsTest, previousPositionOf)
@@ -1042,29 +1042,29 @@ TEST_F(VisibleUnitsTest, previousPositionOf)
Node* five = shadowRoot->getElementById("five")->firstChild();
EXPECT_EQ(Position(zero, 0), previousPositionOf(createVisiblePosition(Position(zero, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(zero, 0), previousPositionOf(createVisiblePosition(PositionInComposedTree(zero, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(zero, 0), previousPositionOf(createVisiblePosition(PositionInFlatTree(zero, 1))).deepEquivalent());
EXPECT_EQ(Position(zero, 1), previousPositionOf(createVisiblePosition(Position(one, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 1), previousPositionOf(createVisiblePosition(PositionInComposedTree(one, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 1), previousPositionOf(createVisiblePosition(PositionInFlatTree(one, 0))).deepEquivalent());
EXPECT_EQ(Position(one, 0), previousPositionOf(createVisiblePosition(Position(one, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 2), previousPositionOf(createVisiblePosition(PositionInComposedTree(one, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 2), previousPositionOf(createVisiblePosition(PositionInFlatTree(one, 1))).deepEquivalent());
EXPECT_EQ(Position(one, 0), previousPositionOf(createVisiblePosition(Position(two, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 3), previousPositionOf(createVisiblePosition(PositionInComposedTree(two, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 3), previousPositionOf(createVisiblePosition(PositionInFlatTree(two, 0))).deepEquivalent());
// DOM tree to shadow tree
EXPECT_EQ(Position(two, 2), previousPositionOf(createVisiblePosition(Position(three, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 5), previousPositionOf(createVisiblePosition(PositionInComposedTree(three, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 5), previousPositionOf(createVisiblePosition(PositionInFlatTree(three, 0))).deepEquivalent());
// Shadow tree to DOM tree
EXPECT_EQ(Position(), previousPositionOf(createVisiblePosition(Position(four, 0))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(zero, 1), previousPositionOf(createVisiblePosition(PositionInComposedTree(four, 0))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(zero, 1), previousPositionOf(createVisiblePosition(PositionInFlatTree(four, 0))).deepEquivalent());
// Note: Canonicalization maps (five, 0) to (four, 4) in DOM tree and
- // (one, 1) in composed tree.
+ // (one, 1) in flat tree.
EXPECT_EQ(Position(four, 4), previousPositionOf(createVisiblePosition(Position(five, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 1), previousPositionOf(createVisiblePosition(PositionInComposedTree(five, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 1), previousPositionOf(createVisiblePosition(PositionInFlatTree(five, 1))).deepEquivalent());
}
TEST_F(VisibleUnitsTest, previousPositionOfOneCharPerLine)
@@ -1121,16 +1121,16 @@ TEST_F(VisibleUnitsTest, rightPositionOf)
Node* five = shadowRoot->getElementById("five")->firstChild();
EXPECT_EQ(Position(), rightPositionOf(createVisiblePosition(Position(one, 1))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), rightPositionOf(createVisiblePosition(PositionInComposedTree(one, 1))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), rightPositionOf(createVisiblePosition(PositionInFlatTree(one, 1))).deepEquivalent());
EXPECT_EQ(Position(one, 1), rightPositionOf(createVisiblePosition(Position(two, 2))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 1), rightPositionOf(createVisiblePosition(PositionInComposedTree(two, 2))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 1), rightPositionOf(createVisiblePosition(PositionInFlatTree(two, 2))).deepEquivalent());
EXPECT_EQ(Position(five, 0), rightPositionOf(createVisiblePosition(Position(four, 4))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 0), rightPositionOf(createVisiblePosition(PositionInComposedTree(four, 4))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 0), rightPositionOf(createVisiblePosition(PositionInFlatTree(four, 4))).deepEquivalent());
EXPECT_EQ(Position(), rightPositionOf(createVisiblePosition(Position(five, 5))).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), rightPositionOf(createVisiblePosition(PositionInComposedTree(five, 5))).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), rightPositionOf(createVisiblePosition(PositionInFlatTree(five, 5))).deepEquivalent());
}
TEST_F(VisibleUnitsTest, startOfDocument)
@@ -1145,10 +1145,10 @@ TEST_F(VisibleUnitsTest, startOfDocument)
Node* two = document().getElementById("two")->firstChild();
EXPECT_EQ(Position(one, 0), startOfDocument(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 0), startOfDocument(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 0), startOfDocument(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfDocument(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 0), startOfDocument(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 0), startOfDocument(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, startOfLine)
@@ -1168,33 +1168,33 @@ TEST_F(VisibleUnitsTest, startOfLine)
Node* seven = shadowRoot->getElementById("seven")->firstChild();
EXPECT_EQ(Position(one, 0), startOfLine(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), startOfLine(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), startOfLine(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfLine(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), startOfLine(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), startOfLine(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfLine(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), startOfLine(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), startOfLine(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(five, 0), startOfLine(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), startOfLine(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), startOfLine(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 0), startOfLine(createVisiblePositionInDOMTree(*three, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfLine(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfLine(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
// TODO(yosin) startOfLine(four, 1) -> (two, 2) is a broken result. We keep
// it as a marker for future change.
EXPECT_EQ(Position(two, 2), startOfLine(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfLine(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfLine(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(five, 0), startOfLine(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(five, 0), startOfLine(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(five, 0), startOfLine(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
EXPECT_EQ(Position(six, 0), startOfLine(createVisiblePositionInDOMTree(*six, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(six, 0), startOfLine(createVisiblePositionInComposedTree(*six, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(six, 0), startOfLine(createVisiblePositionInFlatTree(*six, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfLine(createVisiblePositionInDOMTree(*seven, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), startOfLine(createVisiblePositionInComposedTree(*seven, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), startOfLine(createVisiblePositionInFlatTree(*seven, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, startOfParagraph)
@@ -1211,15 +1211,15 @@ TEST_F(VisibleUnitsTest, startOfParagraph)
Node* three = document().getElementById("three")->firstChild();
EXPECT_EQ(Position(zero, 0), startOfParagraph(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(one, 0), startOfParagraph(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(one, 0), startOfParagraph(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(zero, 0), startOfParagraph(createVisiblePositionInDOMTree(*two, 2)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(two, 0), startOfParagraph(createVisiblePositionInComposedTree(*two, 2)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(two, 0), startOfParagraph(createVisiblePositionInFlatTree(*two, 2)).deepEquivalent());
// DOM version of |startOfParagraph()| doesn't take account contents in
// shadow tree.
EXPECT_EQ(Position(zero, 0), startOfParagraph(createVisiblePositionInDOMTree(*three, 2)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfParagraph(createVisiblePositionInComposedTree(*three, 2)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfParagraph(createVisiblePositionInFlatTree(*three, 2)).deepEquivalent());
// crbug.com/563777. startOfParagraph() unexpectedly returned a null
// position with nested editable <BODY>s.
@@ -1251,22 +1251,22 @@ TEST_F(VisibleUnitsTest, startOfSentence)
Node* four = shadowRoot->getElementById("four")->firstChild();
EXPECT_EQ(Position(one, 0), startOfSentence(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfSentence(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfSentence(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfSentence(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(three, 0), startOfSentence(createVisiblePositionInDOMTree(*three, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(three, 0), startOfSentence(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(three, 0), startOfSentence(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(three, 0), startOfSentence(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
}
TEST_F(VisibleUnitsTest, startOfWord)
@@ -1285,25 +1285,25 @@ TEST_F(VisibleUnitsTest, startOfWord)
Node* space = shadowRoot->getElementById("space")->firstChild();
EXPECT_EQ(Position(one, 0), startOfWord(createVisiblePositionInDOMTree(*one, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositionInComposedTree(*one, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(space, 1), startOfWord(createVisiblePositionInFlatTree(*one, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfWord(createVisiblePositionInDOMTree(*one, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositionInComposedTree(*one, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(space, 1), startOfWord(createVisiblePositionInFlatTree(*one, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfWord(createVisiblePositionInDOMTree(*two, 0)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 0), startOfWord(createVisiblePositionInComposedTree(*two, 0)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 0), startOfWord(createVisiblePositionInFlatTree(*two, 0)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfWord(createVisiblePositionInDOMTree(*two, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 0), startOfWord(createVisiblePositionInComposedTree(*two, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 0), startOfWord(createVisiblePositionInFlatTree(*two, 1)).deepEquivalent());
EXPECT_EQ(Position(one, 0), startOfWord(createVisiblePositionInDOMTree(*three, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositionInComposedTree(*three, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(space, 1), startOfWord(createVisiblePositionInFlatTree(*three, 1)).deepEquivalent());
EXPECT_EQ(Position(four, 0), startOfWord(createVisiblePositionInDOMTree(*four, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(four, 0), startOfWord(createVisiblePositionInComposedTree(*four, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(four, 0), startOfWord(createVisiblePositionInFlatTree(*four, 1)).deepEquivalent());
EXPECT_EQ(Position(space, 1), startOfWord(createVisiblePositionInDOMTree(*five, 1)).deepEquivalent());
- EXPECT_EQ(PositionInComposedTree(space, 1), startOfWord(createVisiblePositionInComposedTree(*five, 1)).deepEquivalent());
+ EXPECT_EQ(PositionInFlatTree(space, 1), startOfWord(createVisiblePositionInFlatTree(*five, 1)).deepEquivalent());
}
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698