editor/libeditor/crashtests/1364133.html
author Randell Jesup <rjesup@wgate.com>
Wed, 28 Sep 2022 02:10:18 +0000
changeset 636504 388419886525a4b8d6be986bc890f09e6c16052d
parent 385733 095f6f26bbce3dc33a0423ddf9f65fdba3710b83
permissions -rw-r--r--
Bug 1791332: Add an OPFS-specific synchronous ordered cleanup queue r=asuth,dom-storage-reviewers The default test.add_cleanup() code from testharness.js in wpt executes the cleanups in parallel, and even if it wasn't in parallel it would be in FIFO order (the wrong order). This adds an OPFS-specific cleanup queue called once from the test cleanup list, and we process the list synchronously in LIFO order. Depends on D146203 Differential Revision: https://phabricator.services.mozilla.com/D157606

<html>
  <head>
    <script>
      var tr = document.createElement('tr');
      document.documentElement.appendChild(tr);

      var a1 = document.createElement('a');
      document.documentElement.appendChild(a1);
      var a2 = document.createElement('a');
      tr.appendChild(a2);

      var a3 = document.createElement('a');
      document.documentElement.appendChild(a3);

      var a4 = document.createElement('a');
      document.documentElement.appendChild(a4);

      var a5 = document.createElement('a');
      a1.appendChild(a5);

      var input = document.createElement('input');
      document.documentElement.appendChild(input);

      a3.contentEditable = true;
      a5.innerText = "xx";
      a4.outerHTML = "";
      input.select();

      document.replaceChild(document.documentElement, document.documentElement);
      window.find("x", false, false, false, false, false, false);

      var range = document.createRange();
      range.setStart(a1, 1);
      window.getSelection().addRange(range);

      document.designMode = "on";

      range.selectNode(a2);
      document.execCommand("forecolor", false, "-moz-default-background-color");
    </script>
  </head>
</html>