yosin | 931bf3c | 2016-09-06 04:24:35 | [diff] [blame] | 1 | <!doctype html> |
| 2 | <script src="../../resources/testharness.js"></script> |
| 3 | <script src="../../resources/testharnessreport.js"></script> |
| 4 | <script src="../../editing/assert_selection.js"></script> |
harrison | 92da4a0b | 2006-07-09 23:18:39 | [diff] [blame] | 5 | <script> |
yosin | 931bf3c | 2016-09-06 04:24:35 | [diff] [blame] | 6 | // Deleting the contents of a DOMRange and then inserting a node into it crashes |
| 7 | // in WebCore::Font::canUseGlyphCache |
| 8 | test(() => assert_selection( |
| 9 | '<div id="mydiv">^01234|</div>', |
| 10 | selection => { |
| 11 | const range = selection.getRangeAt(0); |
| 12 | range.deleteContents(); |
| 13 | range.insertNode(selection.document.createElement('div')); |
| 14 | }, |
yosin | d892f95 | 2017-02-14 15:56:00 | [diff] [blame] | 15 | '<div id="mydiv">^<div></div>|</div>'), |
yosin | 931bf3c | 2016-09-06 04:24:35 | [diff] [blame] | 16 | 'Range#deleteContents() then Range#insertNode() should not crash'); |
harrison | 92da4a0b | 2006-07-09 23:18:39 | [diff] [blame] | 17 | </script> |