Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / execCommand / insertHorizontalRule.html
1 <script>
2 if (window.testRunner)
3      testRunner.dumpEditingCallbacks();
4 </script>
5 <p>These are tests for execCommand(InsertHorizontalRule).</p>
6
7 <p>This test inserts an hr between 'foo' and 'bar'.</p>
8 <div id="test1" contenteditable="true">foobar</div>
9
10 <p>This test inserts an hr with id="hr" between 'foo' and 'bar', fetches the hr using its id, then removes it.</p>
11 <div id="test2" contenteditable="true">foobar</div>
12
13 <script type="text/javascript" src="../editing.js"></script>
14 <script>
15 var s = window.getSelection();
16 var e;
17
18 e = document.getElementById("test1");
19 s.collapse(e, 0);
20 moveSelectionForwardByCharacterCommand();
21 moveSelectionForwardByCharacterCommand();
22 moveSelectionForwardByCharacterCommand();
23 document.execCommand("InsertHorizontalRule", false, "");
24
25 e = document.getElementById("test2");
26 s.collapse(e, 0);
27 moveSelectionForwardByCharacterCommand();
28 moveSelectionForwardByCharacterCommand();
29 moveSelectionForwardByCharacterCommand();
30 var id = "hr";
31 document.execCommand("InsertHorizontalRule", false, id);
32 var hr = document.getElementById(id);
33 hr.parentNode.removeChild(hr);
34 </script>