Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / inserting / insert-paragraph-separator-tab-span.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div contenteditable title="1: last visible position" style="word-wrap: break-word; width: 10ex; border: solid thin black;"><span class="Apple-tab-span" style="white-space:pre">       </span></div>
5 <div contenteditable title="0: first visible position" style="word-wrap: break-word; width: 10ex; border: solid thin black;"><span class="Apple-tab-span" style="white-space:pre">      </span></div>
6 <div contenteditable title="1: before tab span" style="word-wrap: break-word; width: 10ex; border: solid thin black;">hi, <span class="Apple-tab-span" style="white-space:pre"> </span> rocks</div>
7 <div contenteditable title="2: after tab span" style="word-wrap: break-word; width: 10ex; border: solid thin black;">hi, <span class="Apple-tab-span" style="white-space:pre">  </span> rocks</div>
8 <script src="../../resources/dump-as-markup.js"></script>
9 <script>
10
11 Markup.description('This test ensures WebKit avoids cloning Apple tab span when inserting a paragraph separator.\n'+
12     'Only tab should be inside a Apple tab span in the following tests.');
13
14 function runTest(div) {
15     var offset = div.title.substr(0, div.title.indexOf(':'));
16     window.getSelection().collapse(div, offset);
17     document.execCommand("InsertParagraph");
18     document.execCommand("InsertText", false, "hello world WebKit ");
19     Markup.dump(div, div.title.substr(div.title.indexOf(': ') + 2));
20 }
21
22 var divs = document.getElementsByTagName('div');
23 var tests = new Array();
24 for (var i = 0; i < divs.length; i++)
25     tests.push(divs[i]);
26
27 for (i in tests)
28     runTest(tests[i]);
29
30 </script>
31 </body>
32 </html>