| <!doctype html> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| <script src="../assert_selection.js"></script> |
| <script> |
| test(() => { |
| assert_not_equals( |
| window.testRunner, undefined, |
| 'This test requires testRunner.'); |
| |
| assert_selection( |
| [ |
| '<div contenteditable>^foo bar baz.|</div>', |
| '<div contenteditable id="paste"><br></div>' |
| ].join(''), |
| selection => { |
| const document = selection.document; |
| document.execCommand('underline'); |
| document.execCommand('copy'); |
| document.getElementById('paste').focus(); |
| document.execCommand('paste'); |
| }, |
| [ |
| '<div contenteditable><u>foo bar baz.</u></div>', |
| '<div contenteditable id="paste"><u>foo bar baz.|</u></div>' |
| ].join('')); |
| }, 'Copy/paste underlined text.'); |
| |
| test(() => { |
| assert_not_equals( |
| window.testRunner, undefined, |
| 'This test requires testRunner.'); |
| |
| assert_selection( |
| [ |
| '<div contenteditable spellcheck="false">^foo bar baz.|</div>', |
| '<div contenteditable id="paste"><br></div>' |
| ].join(''), |
| selection => { |
| const document = selection.document; |
| document.execCommand('underline'); |
| document.execCommand('copy'); |
| document.getElementById('paste').focus(); |
| document.execCommand('paste'); |
| }, |
| [ |
| '<div contenteditable spellcheck="false"><u>foo bar baz.</u></div>', |
| '<div contenteditable id="paste"><u>foo bar baz.|</u></div>' |
| ].join('')); |
| }, 'Copy/paste underlined text with spell checker off.'); |
| </script> |