discussing #67527, with possible solution - [test case] body padding-top set to 0 causes margin-top of next element to be ignored

Germain Garand germain at ebooksfrance.org
Tue Jan 20 21:58:51 GMT 2004


Hello,
I worked on this bug a bit and now wonders if it isn't a major, rather than 
just grave.
First, the title isn't correct, it should read: 
"margin-top property always ignored at top of blocks"

Consider this very simple testcase:
<div style="margin-top: 100px">foo</div>

It indeed totally breaks a lot of layouts (such as the missing white space 
between articles on the dot, or the *.gnome.org sites) in more or less subtle 
ways. 

I looked at it and found out the problem was in render_block.cpp, two lines 
that were modified in r1.10 (see attached patch for the revert)
The direct retrieval of marginTop() breaks the recursive calculation of 
m_maxTop(Neg|Pos)Margin since it starts anew, so the total margin never 
percolates down to the enclosing block.

This seamingly fixes all testcases for the bug, but of course, just reverting 
something is seldomly a fix :-) so before I go and manually check all the 
test_regression detected changes (114) I'd rather know if there is a 
compelling reason for those lines, that make them unavoidable?
I can't find their purpose or an hint in the ChangeLog.

Greetings,
Germain

P.S special RD: I already checked tests/webcore/fast/block/margin-collapse so 
far:
-nothing broken that was not before
-most changes due to default top-margin of blocks now being collapsed in 
default body margin, resulting in a margin of e.g 13 instead of 10 on body
-testcases fixed: 0{28,32,33,35,41}.html
-testcases that were working, but now rendered better: 0{37,38,39}.html




-------------- next part --------------
A non-text attachment was scrubbed...
Name: render_block.cpp.diff
Type: text/x-diff
Size: 893 bytes
Desc: not available
URL: <https://mail.kde.org/mailman/private/kfm-devel/attachments/20040120/c6d24e28/attachment.diff>


More information about the kfm-devel mailing list