<!doctype html>
<style>
p:first-letter {
  text-decoration: underline;
  color: green;
  font-size: 2em;
}
</style>
<script>
if (window.testRunner)
  testRunner.dumpAsText();

window.onload = function() {
    document.body.offsetTop;
    var firstChild = document.getElementById('test').firstChild;
    firstChild.nodeValue = "PASS. " + firstChild.nodeValue;

    document.body.offsetTop;
    var textNode = document.createTextNode('I am adding a new text. ');
    var para = document.getElementById('test');
    para.insertBefore(textNode, para.firstChild);

    document.body.offsetTop;
    var test = document.getElementById('test');
    var firstChild = test.firstChild;
    test.removeChild(firstChild);
};
</script>

This test passes if the following paragraph starts with PASS.

<p id="test">This is a test paragraph. You can insert extra text at its start;
the :first-letter styles should be updated to accommodate this new text.</p>
