OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <html> | |
3 <head> | |
4 <script> | |
5 function runTest() { | |
6 if (!window.layoutTestController) | |
7 return; | |
8 layoutTestController.dumpAsText(); | |
9 var element = document.getElementById("test"); | |
10 window.getSelection().setPosition(element.firstChild, 0); | |
11 window.getSelection().modify('extend', 'forward', 'word'); | |
12 window.getSelection().modify('extend', 'forward', 'word'); | |
13 window.getSelection().modify('extend', 'forward', 'word'); | |
14 | |
15 document.execCommand("Cut"); | |
16 document.body.style.backgroundColor = "white"; | |
17 document.execCommand("Paste"); | |
18 document.body.innerText = document.body.innerHTML; | |
19 | |
20 } | |
21 </script> | |
22 </head> | |
23 <body onLoad="runTest();" contentEditable="true" style="background-color: #bbb;"
> | |
24 <div> | |
25 This test verifies that, when the body element has a background color, we don't
copy the color if the selection is not the entire content nor any of the interme
diate elements. To manually this test, select the text inside the div with the b
order, cut and paste it back. You should not see an additional red border. | |
26 <div style="border: 2px solid red"> | |
27 <div id="test">Select this text</div> | |
28 </div> | |
29 </div> | |
30 </body> | |
31 </html> | |
32 | |
OLD | NEW |