| <body onpaste="finish()"> |
| <p>This tests copying an element with a background color specified in a style rule that conflicts with the background color of a wrapping style. |
| The pasted text should have lightgreen background color.</p> |
| .add { background-color: lightgreen; } |
| <div style="background-color: red;"> |
| <div id="target" class='add'> |
| <div>some other text</div> |
| <div id="destination" contenteditable></div> |
| document.body.removeChild(document.querySelector('style')); |
| document.body.removeChild(target.parentNode); |
| var target = document.getElementById('target'); |
| getSelection().setPosition(target, 0); |
| getSelection().modify('move', 'forward', 'line'); |
| getSelection().modify('move', 'backward', 'lineboundary'); |
| getSelection().modify('extend', 'backward', 'line'); |
| document.execCommand('Copy', false, null); |
| document.getElementById('destination').focus(); |
| document.execCommand('Paste', false, null); |