| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/editing/VisibleUnits.h" | 5 #include "core/editing/VisibleUnits.h" |
| 6 | 6 |
| 7 #include "core/dom/Text.h" | 7 #include "core/dom/Text.h" |
| 8 #include "core/editing/EditingTestBase.h" | 8 #include "core/editing/EditingTestBase.h" |
| 9 #include "core/editing/VisiblePosition.h" | 9 #include "core/editing/VisiblePosition.h" |
| 10 #include "core/html/HTMLTextFormControlElement.h" | 10 #include "core/html/HTMLTextFormControlElement.h" |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 197 "<html><div id=one contenteditable>1</div><span id=two " | 197 "<html><div id=one contenteditable>1</div><span id=two " |
| 198 "contenteditable=false>22</span><span id=three " | 198 "contenteditable=false>22</span><span id=three " |
| 199 "contenteditable=false>333</span><span id=four " | 199 "contenteditable=false>333</span><span id=four " |
| 200 "contenteditable=false>333</span></html>"; | 200 "contenteditable=false>333</span></html>"; |
| 201 setBodyContent(bodyContent); | 201 setBodyContent(bodyContent); |
| 202 | 202 |
| 203 Node* one = document().querySelector("#one"); | 203 Node* one = document().querySelector("#one"); |
| 204 Node* two = document().querySelector("#two"); | 204 Node* two = document().querySelector("#two"); |
| 205 Node* three = document().querySelector("#three"); | 205 Node* three = document().querySelector("#three"); |
| 206 Node* four = document().querySelector("#four"); | 206 Node* four = document().querySelector("#four"); |
| 207 Element* html = document().createElement("html", ASSERT_NO_EXCEPTION); | 207 Element* html = document().createElement("html"); |
| 208 // Move two, three and four into second html element. | 208 // Move two, three and four into second html element. |
| 209 html->appendChild(two); | 209 html->appendChild(two); |
| 210 html->appendChild(three); | 210 html->appendChild(three); |
| 211 html->appendChild(four); | 211 html->appendChild(four); |
| 212 one->appendChild(html); | 212 one->appendChild(html); |
| 213 updateAllLifecyclePhases(); | 213 updateAllLifecyclePhases(); |
| 214 | 214 |
| 215 EXPECT_EQ(Position(), | 215 EXPECT_EQ(Position(), |
| 216 canonicalPositionOf(Position(document().documentElement(), 0))); | 216 canonicalPositionOf(Position(document().documentElement(), 0))); |
| 217 | 217 |
| (...skipping 811 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 "<html><div id=one contenteditable>1</div><span id=two " | 1029 "<html><div id=one contenteditable>1</div><span id=two " |
| 1030 "contenteditable=false>22</span><span id=three " | 1030 "contenteditable=false>22</span><span id=three " |
| 1031 "contenteditable=false>333</span><span id=four " | 1031 "contenteditable=false>333</span><span id=four " |
| 1032 "contenteditable=false>333</span></html>"; | 1032 "contenteditable=false>333</span></html>"; |
| 1033 setBodyContent(bodyContent); | 1033 setBodyContent(bodyContent); |
| 1034 | 1034 |
| 1035 Node* one = document().querySelector("#one"); | 1035 Node* one = document().querySelector("#one"); |
| 1036 Node* two = document().querySelector("#two"); | 1036 Node* two = document().querySelector("#two"); |
| 1037 Node* three = document().querySelector("#three"); | 1037 Node* three = document().querySelector("#three"); |
| 1038 Node* four = document().querySelector("#four"); | 1038 Node* four = document().querySelector("#four"); |
| 1039 Element* html = document().createElement("html", ASSERT_NO_EXCEPTION); | 1039 Element* html = document().createElement("html"); |
| 1040 // Move two, three and four into second html element. | 1040 // Move two, three and four into second html element. |
| 1041 html->appendChild(two); | 1041 html->appendChild(two); |
| 1042 html->appendChild(three); | 1042 html->appendChild(three); |
| 1043 html->appendChild(four); | 1043 html->appendChild(four); |
| 1044 one->appendChild(html); | 1044 one->appendChild(html); |
| 1045 updateAllLifecyclePhases(); | 1045 updateAllLifecyclePhases(); |
| 1046 | 1046 |
| 1047 EXPECT_FALSE( | 1047 EXPECT_FALSE( |
| 1048 isVisuallyEquivalentCandidate(Position(document().documentElement(), 0))); | 1048 isVisuallyEquivalentCandidate(Position(document().documentElement(), 0))); |
| 1049 | 1049 |
| (...skipping 943 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1993 // Repro case of crbug.com/584030 | 1993 // Repro case of crbug.com/584030 |
| 1994 const char* bodyContent = | 1994 const char* bodyContent = |
| 1995 "<button><rt><script>document.designMode = 'on'</script></rt></button>"; | 1995 "<button><rt><script>document.designMode = 'on'</script></rt></button>"; |
| 1996 setBodyContent(bodyContent); | 1996 setBodyContent(bodyContent); |
| 1997 | 1997 |
| 1998 Node* button = document().querySelector("button"); | 1998 Node* button = document().querySelector("button"); |
| 1999 EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); | 1999 EXPECT_TRUE(endsOfNodeAreVisuallyDistinctPositions(button)); |
| 2000 } | 2000 } |
| 2001 | 2001 |
| 2002 } // namespace blink | 2002 } // namespace blink |
| OLD | NEW |