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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/node-removal-2.html

Issue 2972603002: Convert editing/selection/node-removal-2.html using assert_selection(). (Closed)
Patch Set: Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <html> 1 <!doctype html>
2 <head> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <script src="../assert_selection.js"></script>
3 <script> 5 <script>
4 if (window.testRunner) 6 test(() => {
5 testRunner.dumpEditingCallbacks(); 7 assert_selection(
8 '^foo<span>b|ar</span>baz',
9 selection => {
10 const span = selection.document.querySelector('span');
11 span.parentNode.removeChild(span);
12 selection.document.execCommand('selectAll');
13 },
14 '^foobaz|');
15 }, 'selectAll after node remove');
6 </script> 16 </script>
7
8
9 <script src=../editing.js language="JavaScript" type="text/JavaScript" ></script >
10
11 <script>
12
13 function runTest() {
14 var selection = window.getSelection();
15 var e = document.getElementById("test");
16 var r = document.getElementById("removeme");
17
18 selection.setBaseAndExtent(e, 0, r.childNodes[0], 2);
19
20 r.parentNode.removeChild(r);
21 selectAllCommand();
22 }
23
24 </script>
25
26 <title>Removing the endpoints of a selection</title>
27 </head>
28 <body>
29 <p>This tests behavior when a node that serves as the start or end of a selectio n is removed from the document. Ideally, we would just adjust the selection whe n an endpoint is removed, for now, we just blow away the selection.</p>
30 <p>This test creates a selection that ends inside of a node that will be removed . Then the node is removed. Then a Select All is executed. The entire documen t should be selected.</p>
31 <div id="test">
32 hello <span style="color:red;" id="removeme">removeme</span> world!
33 </div>
34
35 <script>runTest()</script>
36
37 </body>
38 </html>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/platform/linux/editing/selection/node-removal-2-expected.png » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698