| <html> |
| <body> |
| <script src="../../resources/dump-as-markup.js"></script> |
| <script> |
| Markup.description("This tests focusing the body element in a contentEditable iframe. The whole body contents should be selected. Focus should only place the cursor at the beginning of the body if there isn't an existing selection."); |
| |
| function handleLoad() { |
| var win = document.querySelector('iframe').contentWindow; |
| var body = win.document.body; |
| body.innerHTML = "asdf"; |
| body.contentEditable = true; |
| win.getSelection().selectAllChildren(body); |
| body.focus(); |
| Markup.dump(win.document); |
| }; |
| </script> |
| <iframe onload="handleLoad()"></iframe> |
| |
| </body> |
| </html> |