blob: 406ddb7dfec3ae9b2c6fbd7904813bab5ebf948a [file] [log] [blame]
<!DOCTYPE html>
<html>
<body>
<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>
<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>
<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>
<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>
<script src="../../resources/dump-as-markup.js"></script>
<script>
Markup.description('This test ensures WebKit avoids cloning Apple tab span when inserting a paragraph separator.\n'+
'Only tab should be inside a Apple tab span in the following tests.');
function runTest(div) {
var offset = div.title.substr(0, div.title.indexOf(':'));
window.getSelection().setPosition(div, offset);
document.execCommand("InsertParagraph");
document.execCommand("InsertText", false, "hello world WebKit ");
Markup.dump(div, div.title.substr(div.title.indexOf(': ') + 2));
}
var divs = document.getElementsByTagName('div');
var tests = new Array();
for (var i = 0; i < divs.length; i++)
tests.push(divs[i]);
for (i in tests)
runTest(tests[i]);
</script>
</body>
</html>