Small test case for bug in renderer floats
Koos Vriezen
koos.vriezen at xs4all.nl
Thu Aug 1 17:20:59 BST 2002
On Mon, 29 Jul 2002, Koos Vriezen wrote:
> > | > On Sunday 28 July 2002 5:15 pm, Koos Vriezen wrote:
> > | > | This is rendered wrong
> > | > | <html><body>
> > | > | <div style="float:left;" border=1>div text<br>div text</div>
> > | > | some text
> > | > | </body></html>
> > | > |
> > | > | Seems the float gets an extra left offset if the height is greater
> > | > | than height of surrounding text.
> Exactly and I think I found the cause. The test in
> RenderFlow::layoutBlockChildren of RenderHtml
> 'if ( child->hasOverhangingFloats() )', where
> hasOverhangingFloats() is defined as 'floatBottom() > m_height', succeeds
> in this case. The child being the body.
> Next it calls RenderFlow::addOverHangingFloats with
> child, -child->xPos(), -child->yPos() and true for flow, xoff, offset and
> child resp.
> A new special is created with 'special->left' is set to 'r->left - xoff'
> (becomes +10). The test 'if (flow != parent())' succeeds and
> 'special->left += flow->marginLeft()' is executed (becomes +20).
> The next test 'if ( !child )' fails, but has no effect, since the if
> clause 'special->left -= marginLeft()' does nothing for a RenderHtml.
>
> Not sure what goes wrong here, but this makes the float be indented by the
> body margin twice. First guess would be call
> RenderFlow::addOverHangingFloats with child, 0, -child->yPos() and true.
> Also helps for http://www.linuxplanet.com/linuxplanet/reviews/4315/1
> reported by Hetz Ben Hamo on 18 July to this list.
Hmmm, this breaks http://msdn.microsoft.com/. Could also be that
rendering/render_flow.cpp:1000
if (flow != parent())
special->left += flow->marginLeft();
should be
if (flow == parent())
special->left += flow->marginLeft();
Works for the above and msdn.
Koos
More information about the kfm-devel
mailing list