chromium/third_party/blink/web_tests/fast/css/first-line-change-color.html

<!DOCTYPE html>
<style>
  #t::first-line { color: red; }
  #t.green::first-line { color: green; }
</style>
<div id="t">
  <div>
    <p>This text should be green.</p>
    <p>This text should be black.</p>
  </div>
</div>
<script src="../../resources/run-after-layout-and-paint.js"></script>
<script>
runAfterLayoutAndPaint(function() {
  document.getElementById('t').className = 'green';
}, true);
</script>