extend-1i.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 focus < anchor < newfocus
  8. var t = document.body.firstChild;
  9. var sel = window.getSelection();
  10. sel.collapse(t, 2); // anchor
  11. sel.extend(t, 1); // focus
  12. function doTest() {
  13. sel.extend(t, 8); // newfocus
  14. document.documentElement.removeAttribute('class');
  15. }
  16. document.addEventListener("MozReftestInvalidate", doTest, false);
  17. </script>
  18. </body>
  19. </html>