selection-nested-video.html (831B)
1 <!doctype html> 2 <meta charset=utf-8> 3 <title>Selection with nested videos doesn't crash</title> 4 <link rel="help" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1887963"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 <script> 8 async_test(t => { 9 document.addEventListener("DOMContentLoaded", () => { 10 let c = a.attachShadow({mode: "open"}); 11 const sel = window.getSelection(); 12 13 sel.setBaseAndExtent(b, 0, c, 0); 14 15 assert_equals(sel.anchorNode, b); 16 assert_equals(sel.anchorOffset, 0); 17 assert_equals(sel.focusNode, b); 18 assert_equals(sel.focusOffset, 0); 19 t.done(); 20 }) 21 }, 'selection have the same anchor and focus nodes because b and c are in different tree scopes.'); 22 23 </script> 24 <div id="a">A</div> 25 <video> 26 <video id="b"></video> 27 </video>