blob: 1b5cc2830edd92a8bc0c5bbeff61fb5b43ef69d7 [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);
// OBJECT fallback content rendering is asynchronous.
if (window.internals)
internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
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>