Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / pasteboard / 4641033.html
1 <script>
2 if (window.testRunner)
3      testRunner.dumpEditingCallbacks();
4 </script>
5 <p>This tests for a bug when creating markup for a selection that contained unrendered nodes with children.  You should see a picture of abe followed by a select box.</p>
6 <div id="paste" contenteditable="true"></div>
7
8 <img id="start" src="../resources/abe.png">
9 <select id="end"><optgroup><option>1</option><option>2</option><option>3</option></optgroup></select>
10 </select>
11 <script>
12 function runTest() {
13     var start = document.getElementById("start");
14     var end = document.getElementById("end");
15     
16     var s = window.getSelection();
17     s.setBaseAndExtent(start, 0, end, end.childNodes.length);
18     
19     document.execCommand("Copy");
20     
21     s.collapse(document.getElementById("paste"), 0);
22     document.execCommand("Paste");
23     
24     if (window.testRunner)
25         window.testRunner.notifyDone();    
26     
27 }
28 if (window.testRunner)
29     window.testRunner.waitUntilDone();
30 window.setTimeout(runTest, 100);
31
32 </script>