blob: 9d58159e7534dc61446b3e0e6f10521f6e2a449b [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
div > * {
display: block;
}
</style>
</head>
<body>
<div id="test" contenteditable><hr><datagrid></datagrid><object></object></div>
<script src="../../resources/dump-as-markup.js"></script>
<script>
var test = document.getElementById('test');
test.focus();
Markup.description('This test ensures WebKit does not ignore the content of hr, datagrid, and object with child nodes.')
var text = 'hello world WebKit';
for (var i = 0; i < test.childNodes.length; i++) {
var textNode = document.createTextNode(text);
test.childNodes[i].appendChild(textNode);
window.getSelection().setBaseAndExtent(textNode, 6, textNode, 11);
document.execCommand('bold', false, null);
}
Markup.dump(test, '"world" and only "world" should be bolded in each element below');
window.getSelection().setPosition(test, 0);
for (var i = 0; i < (text.length + 1) * test.childNodes.length - 1; i++)
window.getSelection().modify('extend', 'forward', 'character');
var range = window.getSelection().getRangeAt(0).cloneContents();
Markup.dump(range, 'The result below should be identical to the result above');
</script>
</body>
</html>