Fix whitespace_pre with incremental reflow turned on.

This implements fragment merging, in order to incrementally reflow linebroken
text. This makes the `whitespace_pre.html` reftest pass with incremental reflow
turned on with `-i`.
Can you add a comment here explaining what this function does? It's a pretty tricky function after all.

(BTW, I have an idea for how to do inline layout that won't require this function, but it's a fair amount of work so let's not do it now.)