Version: (using KDE KDE 3.5.4) Installed from: Debian testing/unstable Packages On the test page (that will be submitted latter), the 2 boxes should share the same top and right edges (cf. CSS 2.1, 9.5.1: The left outer edge of a left-floating box may not be to the left of the left edge of its containing block. An analogous rule holds for right-floating elements.), in konqueror they don't. Mozilla renders this correctly. [imported from http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=357017]
Created attachment 18022 [details] HTML test case page
Confirmed. Might be something to do with adding or subtracting the border width incorrectly..
Created attachment 18194 [details] Patch This patch removes the constraints forcing floats not to make left overflow.
SVN commit 599349 by carewolf: Let floats overflow the left border when they should. BUG:135160 M +7 -4 render_block.cpp --- branches/KDE/3.5/kdelibs/khtml/rendering/render_block.cpp #599348:599349 @@ -1896,7 +1896,6 @@ _height = o->height() + o->marginTop() + o->marginBottom(); f->width = o->width() + o->marginLeft() + o->marginRight(); } - if (fx<0) fx=0; f->left = fx; //kdDebug( 6040 ) << "positioning left aligned float at (" << fx + o->marginLeft() << "/" << y + o->marginTop() << ") fx=" << fx << endl; o->setPos(fx + o->marginLeft(), y + o->marginTop()); @@ -1921,14 +1920,18 @@ _height = o->height() + o->marginTop() + o->marginBottom(); f->width = o->width() + o->marginLeft() + o->marginRight(); } - if (fx<f->width) fx=f->width; f->left = fx - f->width; //kdDebug( 6040 ) << "positioning right aligned float at (" << fx - o->marginRight() - o->width() << "/" << y + o->marginTop() << ")" << endl; o->setPos(fx - o->marginRight() - o->width(), y + o->marginTop()); } - if ( m_layer && style()->hidesOverflow() && (o->xPos()+o->width() > m_overflowWidth) ) - m_overflowWidth = o->xPos()+o->width(); + if ( m_layer && style()->hidesOverflow()) { + if (o->xPos()+o->width() > m_overflowWidth) + m_overflowWidth = o->xPos()+o->width(); + else + if (o->xPos() < m_overflowLeft) + m_overflowLeft = o->xPos(); + } f->startY = y; f->endY = f->startY + _height;