<!doctype html>
<script>
  if (window.testRunner)
    testRunner.dumpAsText();

  function makeChild()
  {
    var child = document.createElement('div');
    child.textContent = 'my text content';
    return child;
  }

  function runTest()
  {
    document.querySelector('table').appendChild(makeChild());
    document.querySelector('tbody').appendChild(makeChild());
    document.querySelector('tr').appendChild(makeChild());
    document.querySelector('td').appendChild(makeChild());
  }
  onload = runTest;
</script>
<style>
  #target {
    background-color: green;
  }
  #target:first-letter, #target div:first-letter { color: red; }
</style>

<div>This test is successfully if it does not crash.</div>
<div>This test is verifying that adding content that uses first letter into
a table will work correctly.</div>

<table id="target">
 a
 <tr><td>Test</td></tr>
</table>
