6b42051c1188181d94472e4338a79365dac27992
[WebKit-https.git] / LayoutTests / editing / execCommand / 19653-2.html
1 <div id="description1">This tests splitting two paragraphs with InsertParagraph while the typing style is bold. New text entered after the split should be bold.</div>
2 <div id="edit1" contentEditable="true">xx</div>
3
4 <div id="description2">This tests splitting two paragraphs with InsertLineBreak while the typing style is bold. New text entered after the split should be bold. The inserted &lt;br&gt; doesn't need to be surrounded by a bold tag here.</div>
5 <div id="edit2" contentEditable="true">xx</div>
6
7 <script>
8 if (window.layoutTestController)
9     window.layoutTestController.dumpAsText();
10 edit1 = document.getElementById("edit1");
11 edit1.focus();
12 text = edit1.firstChild;
13 window.getSelection().setPosition(text, 1);
14 document.execCommand("Bold");
15 document.execCommand("InsertParagraph");
16 document.execCommand("InsertText", false, "Bold");
17
18 edit2 = document.getElementById("edit2");
19 edit2.focus();
20 text = edit2.firstChild;
21 window.getSelection().setPosition(text, 1);
22 document.execCommand("Bold");
23 document.execCommand("InsertLineBreak");
24 document.execCommand("InsertText", false, "Bold");
25
26 if (window.layoutTestController)
27     document.body.innerText = document.getElementById("description1").innerText + "\n" + edit1.innerHTML + "\n\n" +
28                               document.getElementById("description2").innerText + "\n" + edit2.innerHTML;
29 </script>