Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / editing / pasteboard / copy-element-with-conflicting-background-color-from-rule.html
1 <!DOCTYPE html>
2 <html>
3 <body onpaste="finish()">
4 <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.
5 The pasted text should have lightgreen background color.</p>
6 <style>
7 .add { background-color: lightgreen; }
8 </style>
9 <div style="background-color: red;">
10 <div id="target" class='add'>
11 Copy this line
12 </div>
13 <div>some other text</div>
14 </div>
15
16 Paste here:
17 <div id="destination" contenteditable></div>
18
19 <script>
20
21 function finish() {
22     document.body.removeChild(document.querySelector('style'));
23     document.body.removeChild(target.parentNode);
24 }
25
26 document.body.focus();
27 var target = document.getElementById('target');
28 getSelection().collapse(target, 0);
29 getSelection().modify('move', 'forward', 'line');
30 getSelection().modify('move', 'backward', 'lineboundary');
31 getSelection().modify('extend', 'backward', 'line');
32
33 if (window.testRunner) {
34     document.execCommand('Copy', false, null);
35     document.getElementById('destination').focus();
36     document.execCommand('Paste', false, null);
37 }
38
39 </script>
40 </body>
41 </html>