<!DOCTYPE html>
<html>
<body>
<p>This tests inserting a td element "beforeBegin" of another td element using insertAdjacentHTML.
If the context element was not properly adjusted, then td will be stripped by the parser.</p>
<table><tr><td></td></tr></table>
<script>
if (window.testRunner)
testRunner.dumpAsText();
var td = document.querySelector('td');
td.insertAdjacentHTML('beforeBegin', '<td></td>');
document.write(document.getElementsByTagName('td').length == 2 ? 'PASS' : 'FAIL');
</script>
</body>
</html>