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
   29
   30
   31
   32
   33
   34
   35
   36
   37
   38
   39
   40
   41
   42
   43
   44
   45
   46
   47
   48
   49
   50
   51
   52
   53
   54
   55
   56
   57
   58
   59
   60
   61
   62
   63
   64
   65
   66
   67
   68

content / test / data / accessibility / html / inert-attribute.html [blame]

<!--
@BLINK-ALLOW:focusable
@BLINK-ALLOW:htmlTag
@BLINK-ALLOW:notUserSelectableStyle
-->
<!DOCTYPE html>
<div inert>
  Lorem
  <span>ipsum</span>
</div>
<div id="shadow-host">
  dolor
  <span slot="normal">sit</span>
  <span>amet</span>
</div>
<div style="content-visibility: auto; position: absolute; top: 999vh">
  consectetur
  <span inert>adipiscing</span>
  <div style="display: none">
    <span inert>tempor</span>
  </div>
</div>
<canvas>
  sed
  <span>do</span>
  <span inert>eiusmod</span>
  <div>
    <span inert>tempor</span>
  </div>
  <div style="display: none">
    <span inert>incididunt</span>
  </div>
</canvas>
<iframe srcdoc="
  <div tabindex=0>Normal frame</div>
  <iframe tabindex=0 inert srcdoc='
    <div tabindex=0>Inert frame nested in normal frame</div>
  '></iframe>
"></iframe>
<iframe inert srcdoc="
  <div tabindex=0>Inert frame</div>
  <iframe tabindex=0 srcdoc='
    <div tabindex=0>Normal frame nested in inert frame</div>
  '></iframe>
"></iframe>
<iframe inert sandbox srcdoc="
  <div tabindex=0>Sandboxed inert frame</div>
  <iframe tabindex=0 sandbox srcdoc='
    <div tabindex=0>Sandboxed frame nested in sandboxed inert frame</div>
  '></iframe>
"></iframe>
<script>
// Check inertness with shadow DOM.
const shadowHost = document.getElementById("shadow-host");
const shadowRoot = shadowHost.attachShadow({mode: "open"});
const normalSlot = document.createElement("slot");
normalSlot.name = "normal";
const inertSlot = document.createElement("slot");
inertSlot.inert = true;
shadowRoot.append(normalSlot, inertSlot);

// Check interaction with focusability.
for (let root of [document, shadowRoot]) {
  for (let element of root.querySelectorAll("*")) {
    element.tabIndex = 0;
  }
}
</script>