I took a page whose DTD was HTML4 Transitional and changed the doctype to and extra space appeared between the h1 and div beneath it. I
Your bug deals with default line height.
The HTML4 transitional is ignoring the contents of your H1 wrt line height, yielding a 25px tall element. The HTML5 is respecting the line-height of the H1 tag, which equates to 29px.