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