editor/libeditor/crashtests/1474978.html
author Steve Fink <sfink@mozilla.com>
Sun, 25 Sep 2022 18:14:15 +0000
changeset 636414 43c2ed80ba049f83b4da8549c6a5779275876a6d
parent 636050 9b15baab6f77d09eca2956276f66fee97555e4a1
permissions -rw-r--r--
Bug 1790149 - Fix spelling of perfherder-data.json output file for awsy r=perftest-reviewers,sparky Differential Revision: https://phabricator.services.mozilla.com/D157002

<script>
function onLoad() {
  const dd = document.querySelector("dd[contenteditable]");
  // For emulating the traditional behavior, collapse Selection to end of the
  // <dd contenteditable> which is the deepest last child of the <body> (at the
  // text node after the <template>).
  getSelection().collapse(dd, dd.childNodes.length);
  getSelection().setPosition(
    document.querySelector("template")
  );
  dd.addEventListener("DOMNodeInserted", () => {
    document.execCommand("selectAll");
    document.execCommand("insertText", false, "");
  });
  document.execCommand("insertImage", false, "#");
}
</script>
<body onload="onLoad()">
<dd contenteditable>
<template></template>