Fix for bad block regression

David Hyatt hyatt at apple.com
Thu Feb 12 04:13:02 CET 2004


Good idea.  Here's how it looks now.  Boy was I feeling wordy when I 
implemented the margin collapsing code. That's a huge comment. :)

....
while( child != 0 )
     {
         // Sometimes an element will be shoved down away from a 
previous sibling, e.g., when
         // clearing to pass beyond a float.  In this case, you don't 
need to collapse.  This
         // boolean is updated with each iteration through our child 
list to reflect whether
         // that particular child should be collapsed with its previous 
sibling (or with the top
         // of the block).
         bool shouldCollapseChild = true;
...

You may not run into this regression unless you merged my avoidsFloats 
stuff (which is really a nice cleanup I did between Safari 1.1 and 1.2, 
but had the side effect of exposing this long-standing bug in the 
margin collapsing code), but here's the test case anyway.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/khtml-devel/attachments/20040211/910b832b/100.html
-------------- next part --------------


dave

On Feb 11, 2004, at 6:55 PM, Dirk Mueller wrote:

> On Thursday 12 February 2004 01:47, David Hyatt wrote:
>
>> I forgot to reset the shouldCollapseChild variable at each iteration
>> through the loop.  There's some other cleanup in this patch, but that
>> 1-liner is the real fix.  This bug is occurring right now on the front
>> page of zeldman.com (sigh).
>
> wouldn't it be better to move the declaration of shouldCollapseChild 
> together
> with the multiline comment to the beginning of the iteration block?
>
> PS: regression testcase?
>
> _______________________________________________
> Khtml-devel at kde.org
> https://mail.kde.org/mailman/listinfo/khtml-devel


More information about the Khtml-devel mailing list