[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    discussing #67527,
From:       Germain Garand <germain () ebooksfrance ! org>
Date:       2004-01-20 21:58:51
Message-ID: 200401202158.51665.germain () ebooksfrance ! org
[Download RAW message or body]

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





["render_block.cpp.diff" (text/x-diff)]

Index: rendering/render_block.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/rendering/render_block.cpp,v
retrieving revision 1.20
diff -u -3 -p -B -r1.20 render_block.cpp
--- rendering/render_block.cpp	15 Jan 2004 09:20:54 -0000	1.20
+++ rendering/render_block.cpp	20 Jan 2004 21:35:27 -0000
@@ -825,8 +825,8 @@ void RenderBlock::layoutBlockChildren( b
         // values.
         if (shouldCollapseChild) {
             // Get our max pos and neg top margins.
-            int posTop =  kMax( int( child->marginTop() ), 0 );
-            int negTop = -kMin( int( child->marginTop() ), 0 );
+            int posTop = child->maxTopMargin(true);
+            int negTop = child->maxTopMargin(false);
 
             // See if the top margin is quirky. We only care if this child has
             // margins that will collapse with us.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic