28db7dc953fda836cc762ae7286f05b3308a7db2
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / pasteboard / display-block-on-spans.html
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <div contenteditable id="test">
5 <span style="display:block"><b>This is a paragraph.</b></span>
6 <span style="display:block"><b>This is another paragraph.</b></span>
7 </div>
8 <script src="../editing.js"></script>
9 <script src="../../resources/dump-as-markup.js"></script>
10 <script>
11
12 Markup.description('This is a test case for the fix for http://bugzilla.opendarwin.org/show_bug.cgi?id=7904.\n'+
13 'ReplaceSelectionCommand used to guess whether or not nodes in the fragment to be pasted were blocks. It now knows for sure.\n'+
14 'Before the fix, ReplaceSelectionCommand blew away content of the div below after copy/pasting it over itself.\n'+
15 'The following two results must be visually identical except for the caret.');
16
17 var test = document.getElementById('test');
18 test.focus();
19 window.getSelection().collapse(test, 0);
20
21 Markup.dump(test, 'before');
22
23 extendSelectionForwardByLineCommand();
24 extendSelectionForwardByWordCommand();
25 copyCommand();
26 pasteCommand();
27
28 Markup.dump(test, 'after');
29
30 </script>
31 </body>
32 </html>