editor/libeditor/crashtests/1626002.html
author Randell Jesup <rjesup@wgate.com>
Wed, 28 Sep 2022 02:10:18 +0000
changeset 636504 388419886525a4b8d6be986bc890f09e6c16052d
parent 636050 9b15baab6f77d09eca2956276f66fee97555e4a1
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>
addEventListener("load", () => {
  const anchor = document.createElement("a");
  const b = document.createElement("b");
  const c = document.createElement("c");
  document.documentElement.appendChild(anchor);
  anchor.appendChild(b);
  b.setAttribute("contenteditable", "true");
  // For emulating the traditional behavior, collapse Selection to end of the
  // <body> which must be empty because this test appends the new elements after
  // the <body>.
  const selection = self.getSelection();
  selection.collapse(document.body, document.body.childNodes.length);
  b.appendChild(c);
  c.outerHTML = '<s contenteditable="false"><b contenteditable="true">';
  selection.setBaseAndExtent(document, 0, document.documentElement, 0);
  const range = selection.getRangeAt((260523900 % selection.rangeCount));
  selection.selectAllChildren(b);
  range.collapse(false);
  range.setEndAfter(document.documentElement);
  range.extractContents();
});
</script>
</head>
</html>