summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/inert/inert-and-find-flat-tree.html
blob: 951497e2c0914a4587a2ffea7e92b3a289fa41bd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=help href="https://html.spec.whatwg.org/#inert-subtrees">
<link rel=help href="https://issues.chromium.org/issues/336832613">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>

<div id=host>
  <template shadowrootmode=open>
    <dialog>
      <div>inside shadowroot</div>
      <slot></slot>
    </dialog>
  </template>
  <div>slotted</div>
</div>

<script>
document.getElementById('host').shadowRoot.querySelector('dialog').showModal();

test(() => {
  assert_true(window.find('inside shadowroot'));
}, 'Text inside a dialog inside a shadowroot should be findable.');

test(() => {
  assert_true(window.find('slotted'));
}, 'Text slotted into a dialog which is inside a shadowroot should be findable.');
</script>