| table, td { border: solid 2px red; border-collapse: collapse; } |
| <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> |
| 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'); |
| document.getElementById('container').style.display = 'none'; |