Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / editability / ignored-content.html
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <style type="text/css">
5  div > * {
6      display: block;
7  }
8 </style>
9 </head>
10 <body>
11 <div id="test" contenteditable><hr><datagrid></datagrid><object></object></div>
12 <script src="../../resources/dump-as-markup.js"></script>
13 <script>
14
15 var test = document.getElementById('test');
16 test.focus();
17
18 Markup.description('This test ensures WebKit does not ignore the content of hr, datagrid, and object with child nodes.')
19
20 var text = 'hello world WebKit';
21
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.
26     if (window.internals)
27         internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
28     window.getSelection().setBaseAndExtent(textNode, 6, textNode, 11);
29     document.execCommand('bold', false, null);
30 }
31
32 Markup.dump(test, '"world" and only "world" should be bolded in each element below');
33
34 window.getSelection().collapse(test, 0);
35
36 for (var i = 0; i < (text.length + 1) * test.childNodes.length - 1; i++)
37     window.getSelection().modify('extend', 'forward', 'character');
38
39 var range = window.getSelection().getRangeAt(0).cloneContents();
40
41 Markup.dump(range, 'The result below should be identical to the result above');
42
43 </script>
44 </body>
45 </html>