caret-scrolled.html 506 B

1234567891011121314151617181920
  1. <!DOCTYPE html>
  2. <style>
  3. ::-webkit-scrollbar { display: none; }
  4. </style>
  5. <div id="target" contenteditable
  6. style="position: relative; top: 100px; width: 200px; height: 200px; overflow: scroll;
  7. font-size: 100px; border: 1px solid black; outline-style: none">
  8. <br>
  9. <br>
  10. <br>
  11. <br>
  12. </div>
  13. <script src="../../resources/run-after-layout-and-paint.js"></script>
  14. <script>
  15. target.focus();
  16. target.scrollTop = 50;
  17. runAfterLayoutAndPaint(function() {
  18. target.style.color = 'green';
  19. }, true);
  20. </script>