4 <style type="text/css">
11 <div id="test" contenteditable><hr><datagrid></datagrid><object></object></div>
12 <script src="../../resources/dump-as-markup.js"></script>
15 var test = document.getElementById('test');
18 Markup.description('This test ensures WebKit does not ignore the content of hr, datagrid, and object with child nodes.')
20 var text = 'hello world WebKit';
22 for (var i = 0; i < test.childNodes.length; i++) {
23 var textNode = document.createTextNode(text);
24 test.childNodes[i].appendChild(textNode);
25 // OBJECT fallback content rendering is asynchronous.
27 internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
28 window.getSelection().setBaseAndExtent(textNode, 6, textNode, 11);
29 document.execCommand('bold', false, null);
32 Markup.dump(test, '"world" and only "world" should be bolded in each element below');
34 window.getSelection().collapse(test, 0);
36 for (var i = 0; i < (text.length + 1) * test.childNodes.length - 1; i++)
37 window.getSelection().modify('extend', 'forward', 'character');
39 var range = window.getSelection().getRangeAt(0).cloneContents();
41 Markup.dump(range, 'The result below should be identical to the result above');