blob: e119033dc6cf77ab14bfe408f3a8d491a2eac8be [file] [log] [blame]
<!DOCTYPE html>
<style type="text/css">
div > * {
display: block;
<div id="test" contenteditable><hr><datagrid></datagrid><object></object></div>
<script src="../../resources/dump-as-markup.js"></script>
var test = document.getElementById('test');
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);
// OBJECT fallback content rendering is asynchronous.
if (window.internals)
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().collapse(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');