| <!doctype html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="../assert_selection.js"></script> |
| <script> |
| // This tests copy/paste of styled elements, like images. The image in the |
| // region below should be centered after its copied and pasted. |
| selection_test( |
| [ |
| '<div>^<center><img></center>|</div>', |
| '<div contenteditable id="target"></div>', |
| ], |
| selection => { |
| selection.document.execCommand('Copy'); |
| selection.collapse(selection.document.getElementById('target'), 0); |
| selection.document.execCommand('Paste'); |
| }, |
| [ |
| '<div><center><img></center></div>', |
| '<div contenteditable id="target">', |
| '<img style="text-align: -webkit-center;">|', |
| '</div>', |
| ]); |
| </script> |