Summary: | [test case] clear:both not handled correctly (regression) | ||
---|---|---|---|
Product: | [Applications] konqueror | Reporter: | Shift <shift> |
Component: | khtml renderer | Assignee: | Konqueror Developers <konq-bugs> |
Status: | RESOLVED FIXED | ||
Severity: | grave | CC: | bulk, marcus, stephane |
Priority: | NOR | ||
Version: | 4.0 | ||
Target Milestone: | --- | ||
Platform: | unspecified | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
First testcase
Second testcase |
Description
Shift
2003-11-12 21:46:58 UTC
Another example : http://perso.wanadoo.fr/shift/kde-bug/clear-both2.html Here you can see that the box 3 "believe" that the floating box 2 is on the left of it. This bug completely broke the layout of my website : http://shift.free.fr/ Please help !!!! :) Thanks, Franck This breaks quite a few layouts that use floated images - but only those that try the clear _outside_ the containing element: <p> <img style="float:left" src="/some/image"> some small paragraph such that the image hangs out of the paragraph bounding box by a few ems... </p> <div style="clear:both"></div> <p> <img style="float:left" src="/some/image"> some small paragraph such that the image hangs out of the paragraph bounding box by a few ems... </p> <div style="clear:both"></div> The second paragraph should be below the image, not to the right of it. I hope I have correctly identified this as "the same bug"... This bug also breaks the node entry form in Drupal (http://www.drupal.org) as the textarea for the body is shifted to the right off the screen. No scrollbar is displayed... I have reduced the page into a (IMO) minimal testcase: <div style="float:left; border:blue thin solid;">float: left</div> <div style="clear:both; border:red thin solid;">clear: both</div> The "clear: both" text should be exactly below the "float:left", not indented to the right... Shift: please attach your test cases here - test cases get lost just too easy otherwise Created attachment 4099 [details]
First testcase
Here is the first testcase in attachement
Created attachment 4100 [details]
Second testcase
Here is the second testcase in attachement
The second test case seems to be OK now. *** Bug 73462 has been marked as a duplicate of this bug. *** *** Bug 70930 has been marked as a duplicate of this bug. *** Subject: kdelibs/khtml CVS commit by mueller: * rendering/render_block.cpp (positionNewFloats): when somebody says clear: both;, he usually means it (#68068). CCMAIL: 68068-done@bugs.kde.org M +3 -0 ChangeLog 1.185 M +7 -5 rendering/render_block.cpp 1.23 --- kdelibs/khtml/ChangeLog #1.184:1.185 @@ -1,4 +1,7 @@ 2004-01-25 Dirk Mueller <mueller@kde.org> + * rendering/render_block.cpp (positionNewFloats): when somebody says + clear: both;, he usually means it (#68068). + * html/html_objectimpl.cpp (renderAlternative): give the alternative rendering some time to avoid ugly deletion races. --- kdelibs/khtml/rendering/render_block.cpp #1.22:1.23 @@ -1361,8 +1361,12 @@ void RenderBlock::positionNewFloats() if (ro - lo < fwidth) fwidth = ro - lo; // Never look for more than what will be available. - if (o->style()->floating() == FLEFT) - { + if ( o->style()->clear() & CLEFT ) y = kMax( leftBottom(), y ); + if ( o->style()->clear() & CRIGHT ) + y = kMax( rightBottom(), y ); + + if (o->style()->floating() == FLEFT) + { int heightRemainingLeft = 1; int heightRemainingRight = 1; @@ -1380,6 +1384,4 @@ void RenderBlock::positionNewFloats() else { - if ( o->style()->clear() & CRIGHT ) - y = kMax( rightBottom(), y ); int heightRemainingLeft = 1; int heightRemainingRight = 1; @@ -1786,5 +1788,5 @@ void RenderBlock::markAllDescendantsWith bool RenderBlock::checkClear(RenderObject *child) { - //kdDebug( 6040 ) << "checkClear oldheight=" << m_height << endl; + //kdDebug( 6040 ) << "checkClear on child " << child << " oldheight=" << m_height << endl; int bottom = 0; switch(child->style()->clear()) |