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 "core/dom/Range.h" | 5 #include "core/dom/Range.h" |
6 | 6 |
7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 7 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
9 #include "core/dom/NodeList.h" | 9 #include "core/dom/NodeList.h" |
10 #include "core/dom/Text.h" | 10 #include "core/dom/Text.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 EXPECT_EQ(0, range04->startOffset()); | 58 EXPECT_EQ(0, range04->startOffset()); |
59 EXPECT_EQ(newText, range04->endContainer()); | 59 EXPECT_EQ(newText, range04->endContainer()); |
60 EXPECT_EQ(2, range04->endOffset()); | 60 EXPECT_EQ(2, range04->endOffset()); |
61 | 61 |
62 EXPECT_TRUE(range02->boundaryPointsValid()); | 62 EXPECT_TRUE(range02->boundaryPointsValid()); |
63 EXPECT_EQ(oldText, range02->startContainer()); | 63 EXPECT_EQ(oldText, range02->startContainer()); |
64 EXPECT_EQ(0, range02->startOffset()); | 64 EXPECT_EQ(0, range02->startOffset()); |
65 EXPECT_EQ(oldText, range02->endContainer()); | 65 EXPECT_EQ(oldText, range02->endContainer()); |
66 EXPECT_EQ(2, range02->endOffset()); | 66 EXPECT_EQ(2, range02->endOffset()); |
67 | 67 |
68 // Our implementation always moves the boundary point at the separation point
to the end of the original text node. | 68 // Our implementation always moves the boundary point at the separation point |
| 69 // to the end of the original text node. |
69 EXPECT_TRUE(range22->boundaryPointsValid()); | 70 EXPECT_TRUE(range22->boundaryPointsValid()); |
70 EXPECT_EQ(oldText, range22->startContainer()); | 71 EXPECT_EQ(oldText, range22->startContainer()); |
71 EXPECT_EQ(2, range22->startOffset()); | 72 EXPECT_EQ(2, range22->startOffset()); |
72 EXPECT_EQ(oldText, range22->endContainer()); | 73 EXPECT_EQ(oldText, range22->endContainer()); |
73 EXPECT_EQ(2, range22->endOffset()); | 74 EXPECT_EQ(2, range22->endOffset()); |
74 | 75 |
75 EXPECT_TRUE(range24->boundaryPointsValid()); | 76 EXPECT_TRUE(range24->boundaryPointsValid()); |
76 EXPECT_EQ(oldText, range24->startContainer()); | 77 EXPECT_EQ(oldText, range24->startContainer()); |
77 EXPECT_EQ(2, range24->startOffset()); | 78 EXPECT_EQ(2, range24->startOffset()); |
78 EXPECT_EQ(newText, range24->endContainer()); | 79 EXPECT_EQ(newText, range24->endContainer()); |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 text->deleteData(0, 3, ASSERT_NO_EXCEPTION); | 201 text->deleteData(0, 3, ASSERT_NO_EXCEPTION); |
201 | 202 |
202 EXPECT_TRUE(range->boundaryPointsValid()); | 203 EXPECT_TRUE(range->boundaryPointsValid()); |
203 EXPECT_EQ(span2, range->startContainer()); | 204 EXPECT_EQ(span2, range->startContainer()); |
204 EXPECT_EQ(0, range->startOffset()); | 205 EXPECT_EQ(0, range->startOffset()); |
205 EXPECT_EQ(div, range->endContainer()); | 206 EXPECT_EQ(div, range->endContainer()); |
206 EXPECT_EQ(2, range->endOffset()); | 207 EXPECT_EQ(2, range->endOffset()); |
207 } | 208 } |
208 | 209 |
209 } // namespace blink | 210 } // namespace blink |
OLD | NEW |