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

content / test / data / accessibility / html / open-modal.html [blame]

<!--
@EXECUTE-AND-WAIT-FOR:open_modal()
@EXECUTE-AND-WAIT-FOR:remove_span()

This regression test ensures that the dialog is included in the tree.
There was a bug where ClearChildren would disconnect indirect children from
their parent. crbug: 996992
-->
<!DOCTYPE html>
<html>

<span>some text</span>
<div>
  <dialog>
    <div id="dialog-text" tabindex="0">Some Text</div>
  </dialog>
</div>


<script>
  function open_modal() {
    document.querySelector("dialog").showModal();
    return "Some Text";
  }
  function remove_span() {
    // Cause the root to be updated.
    let span = document.querySelector("span");
    span.parentElement.removeChild(span);

    document.getElementById("dialog-text").innerText = "Done";
    return "Done";
  }
</script>

</html>