Created attachment 201096 [details] Reduction When a child becomes floated or out-of-flow it should check if its previous sibling is an anonymous block - if so, it should move in under the anonymous block.
I definitely need advice on how to go about doing this - anonymous blocks are too complicated for trial and error. If the render tree is like this: RenderBlock (anonymous) at (0,73) size 320x19 RenderInline {SPAN} at (0,0) size 40x19 RenderInline {SPAN} at (0,0) size 40x19 [bgcolor=#FF0000] RenderBlock (anonymous) at (0,92) size 320x40 RenderBlock {DIV} at (0,0) size 160x40 [bgcolor=#008000] RenderText {#text} at (0,10) size 4x19 text run at (0,10) width 4: " " RenderBlock (anonymous) at (0,132) size 320x0 RenderInline {SPAN} at (0,0) size 0x0 RenderBlock (anonymous) at (0,132) size 320x0 RenderBlock {DIV} at (0,0) size 320x0 RenderBlock (anonymous) at (0,132) size 320x0 RenderInline {SPAN} at (0,0) size 0x0 RenderInline {SPAN} at (0,0) size 0x0 RenderText {#text} at (0,0) size 0x0 RenderText {#text} at (0,0) size 0x0 and the first div becomes a float, I need to change it to this: RenderBlock (anonymous) at (0,73) size 320x19 RenderInline {SPAN} at (0,0) size 40x19 RenderInline {SPAN} at (0,0) size 40x19 [bgcolor=#FF0000] RenderBlock {DIV} (floating) at (0,0) size 160x40 [bgcolor=#008000] RenderText {#text} at (0,10) size 4x19 text run at (0,10) width 4: " " RenderBlock (anonymous) at (0,132) size 320x0 RenderBlock {DIV} at (0,0) size 320x0 RenderBlock (anonymous) at (0,132) size 320x0 RenderInline {SPAN} at (0,0) size 0x0 RenderInline {SPAN} at (0,0) size 0x0 RenderText {#text} at (0,0) size 0x0 RenderText {#text} at (0,0) size 0x0 Can I just use moveChildTo() to move the float into the preceding anonymous block and destroy its old anonymous block parent? Or will I then need to rewrite the continuation map to link the RenderInline parent to the anonymous block containing the remaining block-flow DIV?