Change layout to handle whitespace between inline elements in HTML file.

This matches the behaviour of other browsers.
Merge pull request #2953 from glennw/inline-whitespace

Change layout to handle whitespace between inline elements in HTML file.