caret-color.html 639 B

12345678910111213141516171819
  1. <!DOCTYPE html>
  2. Tests color of caret changes with the 'color' style. Passes if caret is always in the came color as the text.
  3. <input id="target" type="text" value="SAMPLE" style="color: red; font-size: 30px; width: 200px">
  4. <script src="../../resources/run-after-layout-and-paint.js"></script>
  5. <script>
  6. target.focus();
  7. if (window.testRunner) {
  8. testRunner.waitUntilDone();
  9. runAfterLayoutAndPaint(function() {
  10. target.style.color = 'green';
  11. testRunner.notifyDone();
  12. });
  13. } else {
  14. // For manual testing.
  15. setInterval(function() {
  16. target.style.color = target.style.color == 'green' ? 'red' : 'green';
  17. }, 1300);
  18. }
  19. </script>