Safari crashes when calling execCommand on formatted html in special case
[WebKit-https.git] / LayoutTests / editing / execCommand / align-in-span.html
1 <html>\r
2 <head>\r
3 <script type="text/javascript">\r
4 \r
5 function selectAndJustify()\r
6 {\r
7     if (window.layoutTestController)\r
8         layoutTestController.dumpAsText();\r
9 \r
10     var elem = document.getElementById("test");\r
11     var selection = window.getSelection();\r
12     selection.setBaseAndExtent(elem, 2, elem, 6);\r
13     document.execCommand('JustifyCenter', false, null);\r
14 }\r
15 \r
16 </script>\r
17 </head>\r
18 \r
19 <body>\r
20     <span id="test" contenteditable="true" >\r
21         Line 1.\r
22         <br>\r
23         <b>Select all text in this line and use justify command.</b>\r
24         <br>\r
25         Line 3.\r
26     </span>\r
27 </body>\r
28 <script>\r
29 selectAndJustify();\r
30 </script>\r
31 </html>\r