<!DOCTYPE html>
<html>
<body>
<style>
#test2:first-letter { display: block; }
</style>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

window.onload = function() {
    test1 = document.createElement('div');
    document.body.appendChild(test1);
    test2 = document.createElement('div');
    test2.setAttribute('id', 'test2');
    test2.appendChild(document.createTextNode('aaa'));
    test2.style.display = 'inline-block';
    test1.appendChild(test2); 
    test1.appendChild(document.createTextNode('a'));
    document.execCommand('selectall');
    document.body.offsetTop;
    document.styleSheets[0].insertRule("#test2 { text-transform: uppercase }", 0);
    document.body.offsetTop;
    document.body.innerHTML = "PASS";
}
</script>
</body>
</html>
