inert-and-find-flat-tree.html (849B)
1 <!DOCTYPE html> 2 <link rel=author href="mailto:jarhar@chromium.org"> 3 <link rel=help href="https://html.spec.whatwg.org/#inert-subtrees"> 4 <link rel=help href="https://issues.chromium.org/issues/336832613"> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 8 <div id=host> 9 <template shadowrootmode=open> 10 <dialog> 11 <div>inside shadowroot</div> 12 <slot></slot> 13 </dialog> 14 </template> 15 <div>slotted</div> 16 </div> 17 18 <script> 19 document.getElementById('host').shadowRoot.querySelector('dialog').showModal(); 20 21 test(() => { 22 assert_true(window.find('inside shadowroot')); 23 }, 'Text inside a dialog inside a shadowroot should be findable.'); 24 25 test(() => { 26 assert_true(window.find('slotted')); 27 }, 'Text slotted into a dialog which is inside a shadowroot should be findable.'); 28 </script>