blob: b8f93ad420cee2949dc34a2257eb89c972baaa89 [file] [log] [blame]
<body>
<p>Test that backward delete behavior matches AppKit.</p>
<p id=status></p>
<table>
<tr><td>Test:</td><td><div contenteditable></div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>а́</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>วั</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>ế</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>q̣̇</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable></div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>شْ</div></td><td>Expected</td><td>ش</td></tr>
<tr><td>Test:</td><td><div contenteditable>אֱ</div></td><td>Expected</td><td>א</td></tr>
<tr><td>Test:</td><td><div contenteditable>각</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>ダ</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>ダ</div></td><td>Expected</td><td></td></tr>
<tr><td>Test:</td><td><div contenteditable>𐐀</div></td><td>Expected</td><td></td></tr>
</table>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
function test()
{
var node = document.evaluate("//*[@contenteditable]", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;
if (!node) {
if (window.testRunner)
testRunner.notifyDone();
else
document.getElementById("status").innerHTML = "DONE"
return;
}
node.focus();
window.getSelection().modify("move", "forward", "word");
node.onkeydown = function() {
setTimeout(function() { node.removeAttribute('contenteditable'); test(); }, 0);
}
if (window.eventSender)
eventSender.keyDown(String.fromCharCode(0x0008), null);
}
test();
if (!window.eventSender)
document.getElementById("status").innerHTML = "Please press Backspace once for each editable field."
</script>
</body>