OLD | NEW |
1 <!doctype html> | 1 <!doctype html> |
2 <script src="../../resources/testharness.js"></script> | 2 <script src="../../resources/testharness.js"></script> |
3 <script src="../../resources/testharnessreport.js"></script> | 3 <script src="../../resources/testharnessreport.js"></script> |
4 <script src="../../editing/assert_selection.js"></script> | 4 <script src="../../editing/assert_selection.js"></script> |
5 <script> | 5 <script> |
6 // Deleting the contents of a DOMRange and then inserting a node into it crashes | 6 // Deleting the contents of a DOMRange and then inserting a node into it crashes |
7 // in WebCore::Font::canUseGlyphCache | 7 // in WebCore::Font::canUseGlyphCache |
8 test(() => assert_selection( | 8 test(() => assert_selection( |
9 '<div id="mydiv">^01234|</div>', | 9 '<div id="mydiv">^01234|</div>', |
10 selection => { | 10 selection => { |
11 const range = selection.getRangeAt(0); | 11 const range = selection.getRangeAt(0); |
12 range.deleteContents(); | 12 range.deleteContents(); |
13 range.insertNode(selection.document.createElement('div')); | 13 range.insertNode(selection.document.createElement('div')); |
14 }, | 14 }, |
15 '<div id="mydiv">|<div></div></div>'), | 15 '<div id="mydiv">^<div></div>|</div>'), |
16 'Range#deleteContents() then Range#insertNode() should not crash'); | 16 'Range#deleteContents() then Range#insertNode() should not crash'); |
17 </script> | 17 </script> |
OLD | NEW |