blob: 1e07460f5301105fa3f04e2b6ff9cf925f3fad06 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
table, td { border: solid 2px red; border-collapse: collapse; }
</style>
</head>
<body>
<p id="description">This tests moving to line boundaries in the first or the last table cell, and types "h" and "d" respectively.
You should see "hello" and "world" in the first and the second table cell respectively.</p>
<div id="container" contentEditable="true">a<table><tr><td id="target">ello</td><td>worl</td></tr></table>b</div>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var target = document.getElementById('target');
getSelection().collapse(target.firstChild, 2);
getSelection().modify('Move', 'Backward', 'LineBoundary');
document.execCommand('InsertText', false, 'h');
getSelection().collapse(target.nextSibling.firstChild, 2);
getSelection().modify('Move', 'Forward', 'LineBoundary');
document.execCommand('InsertText', false, 'd');
document.writeln(target.parentNode.textContent == 'helloworld' ? 'PASS' : 'FAIL');
if (window.testRunner)
document.getElementById('container').style.display = 'none';
</script>
</body>
</html>