[css-grid] Scroll reset position when updating inner html on content
[WebKit-https.git] / LayoutTests / editing / deleting / paragraph-in-preserveNewline.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <p id="description">This tests for a bug where deleting a paragraph in preserveNewline text would introduce an extra line.  You should see '\nbar' below.</p>
5 <div id="test" contenteditable="true"><pre>foo
6 bar</pre></div>
7
8 <script src="../../resources/dump-as-markup.js"></script>
9 <script>
10 function runTestsOn(platform) {
11     var sel = window.getSelection();
12     var e = document.getElementById("test");
13     
14     if (window.internals)
15         internals.settings.setEditingBehavior(platform);
16
17     sel.setPosition(e, 0);
18     sel.modify("extend", "forward", "character");
19     sel.modify("extend", "forward", "character");
20     sel.modify("extend", "forward", "character");
21     document.execCommand("Delete");
22     Markup.dump("test", "on " + platform);
23     document.execCommand("undo");
24     Markup.dump("test", "after undo on " + platform);
25 }
26
27 if (window.testRunner)
28      testRunner.dumpEditingCallbacks();
29 Markup.description(description.textContent);
30 Markup.dump("test", "initial state");
31 runTestsOn("mac");
32 runTestsOn("win");
33 runTestsOn("unix");
34 </script>
35 </body>
36 </html>