| <!doctype html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="../assert_selection.js"></script> |
| <script> |
| selection_test( |
| [ |
| '<span>^abc</span>', |
| '<span style="user-select: none;">def</span>', |
| '<span>ghi</span>', |
| '<text style="user-select: none;" contenteditable>jkl</text>', |
| '<span style="user-select: none;">mno|</span>', |
| '<input type="text">' |
| ], |
| selection=> { |
| selection.document.execCommand('copy'); |
| const input = selection.document.querySelector('input'); |
| input.focus(); |
| selection.document.execCommand('paste'); |
| // copy should respect the user-select attribute |
| assert_equals(input.value, "abcghijkl"); |
| }, |
| [ |
| '<span>abc</span>', |
| '<span style="user-select: none;">def</span>', |
| '<span>ghi</span>', |
| '<text contenteditable style="user-select: none;">jkl</text>', |
| '<span style="user-select: none;">mno</span>', |
| '|<input type="text">' |
| ], |
| 'clipboard should respect the user-select attribute.'); |
| </script> |