dom/inputmethod/mochitest/file_test_contenteditable.html
author Jan Jongboom <janjongboom@gmail.com>
Thu, 09 Oct 2014 06:06:00 -0400
changeset 234548 bbcaa290276118d0bd3e75613058510ae3eb19f4
parent 234031 46c1cce018dee925d211ba14aa494d55ecebb497
permissions -rw-r--r--
Bug 1059163 - Add a mutation observer to contenteditable elements to detect selection changes that nsISelectionPrivate misses. r=yxl

<!DOCTYPE HTML>
<html>
<body>
<div id="text" contenteditable>Jan Jongboom</div>
<script type="application/javascript;version=1.7">
  var t = document.querySelector('#text');

  t.focus();
  var range = document.createRange();
  range.selectNodeContents(t);
  range.collapse(false);
  var selection = window.getSelection();
  selection.removeAllRanges();
  selection.addRange(range);
</script>
</body>
</html>