Consider the following case:
<div><span></span> <div></div></div>
The span and the following white-space are wrapped in an anonymous block to only have block level siblings (due to the following div. However, if we remove the span from the DOM, the white-space text node is not detached keeping the anonymous block alive.
If we construct a layout tree with the span initially removed, we don't create a LayoutText for the whitespace and we don't get an anonymous block.
Comment 1 by r...@opera.com
, Sep 7 2017