OLD | NEW |
(Empty) | |
| 1 <!doctype html> |
| 2 <script src="../../resources/testharness.js"></script> |
| 3 <script src="../../resources/testharnessreport.js"></script> |
| 4 <script src="../assert_selection.js"></script> |
| 5 <script> |
| 6 test(() => { |
| 7 assert_exists(window, 'eventSender', 'This test requires eventSender'); |
| 8 |
| 9 assert_selection( |
| 10 [ |
| 11 '<div contenteditable>^text|</div>', |
| 12 '<a href="http://www.example.com/">link</a>' |
| 13 ].join(''), |
| 14 selection => { |
| 15 const link = selection.document.querySelector('a'); |
| 16 link.focus(); |
| 17 eventSender.keyDown('b', ['ctrlKey']); |
| 18 assert_equals(selection.document.activeElement, link); |
| 19 }, |
| 20 [ |
| 21 '<div contenteditable>^text|</div>', |
| 22 '<a href="http://www.example.com/">link</a>' |
| 23 ].join('')); |
| 24 }, 'Styling with unfocused selection in contenteditable div'); |
| 25 </script> |
OLD | NEW |