extend-1g.html 486 B

123456789101112131415161718192021
  1. <!DOCTYPE html>
  2. <html class="reftest-wait">
  3. <head>
  4. <body style="white-space:pre">0123456789
  5. <script>
  6. document.body.offsetTop;
  7. // Test newfocus = focus < anchor
  8. var t = document.body.firstChild;
  9. var sel = window.getSelection();
  10. sel.collapse(t, 8); // anchor
  11. sel.extend(t, 2); // focus
  12. function doTest() {
  13. sel.extend(t, 2); // newfocus
  14. document.documentElement.removeAttribute('class');
  15. }
  16. document.addEventListener("MozReftestInvalidate", doTest, false);
  17. </script>
  18. </body>
  19. </html>