chromium/third_party/blink/web_tests/wpt_internal/css/css-pseudo/spelling-error-color-dynamic-003.html

<!DOCTYPE html>
<html lang="en" class="reftest-wait">
<meta charset="utf-8" />
<title>CSS Pseudo-Elements Test: Dynamic change color of spelling error</title>
<link rel="author" title="Manuel Rego Casasnovas" href="mailto:[email protected]">
<link rel="help" href="https://drafts.csswg.org/css-pseudo/#selectordef-spelling-error">
<meta name="assert" content="This test checks that it's possible to modify dinamically the color of a spelling error through ::spelling-error pseudo-element.">
<link rel="match" href="spelling-error-color-dynamic-001-ref.html">
<script src="/common/reftest-wait.js"></script>
<script src="../support/markers.js"></script>
<style>
  #target::spelling-error {
    text-decoration-color: cyan;
  }
  #target {
    text-decoration-color: magenta;
  }
</style>

<p>The test passes if "quikc" has a magenta spelling error marker.</p>
<div id="target" contenteditable spellcheck>The quikc brown fox.</div>

<script>
  addSpellingMarker(target, 4, 9);
  requestAnimationFrame(() => requestAnimationFrame(() => {
    document.styleSheets[0].cssRules[0].style.textDecorationColor = "magenta";
    takeScreenshot();
  }));
</script>
</html>