toString-ff-bug-001.html (830B)
1 <!doctype html> 2 <title>Can serialize a range which starts at the end of an element</title> 3 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1571517"> 4 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 5 <link rel="author" title="Mozilla" href="https://mozilla.org"> 6 <script src=/resources/testharness.js></script> 7 <script src=/resources/testharnessreport.js></script> 8 <table> 9 <tr> 10 <td id="left">Foo</td> 11 <td id="right">Hello</td> 12 </tr> 13 </table> 14 <script> 15 test(function() { 16 let s = getSelection(); 17 let r = new Range(); 18 r.setStart(document.getElementById("left"), 1); 19 r.setEnd(document.getElementById("right").firstChild, 4); 20 s.addRange(r); 21 assert_equals(s.toString().trim(), "Hell"); 22 }, "Can serialize a range which starts at the end of an element"); 23 </script>