[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:49:36 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit dec60d7dc16f3bfb577256483f7eb21fa882854c
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Oct 15 06:20:16 2002 +0000

    	More collapsing margin surgery.  Working on setting up blocks
    	to properly compute their collapsed margins (without actually changing
    	the obsolete collapsing behavior yet).
    
            * khtml/rendering/render_flow.cpp:
            (RenderFlow::RenderFlow):
            (RenderFlow::layout):
            (RenderFlow::layoutBlockChildren):
            * khtml/rendering/render_flow.h:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2323 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index ab29d7d..8863e6f 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,5 +1,17 @@
 2002-10-14  David Hyatt  <hyatt at apple.com>
 
+	More collapsing margin surgery.  Working on setting up blocks 
+	to properly compute their collapsed margins (without actually changing
+	the obsolete collapsing behavior yet).
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::RenderFlow):
+        (RenderFlow::layout):
+        (RenderFlow::layoutBlockChildren):
+        * khtml/rendering/render_flow.h:
+
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
 	Adding helper functions for handling of collapsing margins.
 	Not used yet.
 	
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ab29d7d..8863e6f 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,5 +1,17 @@
 2002-10-14  David Hyatt  <hyatt at apple.com>
 
+	More collapsing margin surgery.  Working on setting up blocks 
+	to properly compute their collapsed margins (without actually changing
+	the obsolete collapsing behavior yet).
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::RenderFlow):
+        (RenderFlow::layout):
+        (RenderFlow::layoutBlockChildren):
+        * khtml/rendering/render_flow.h:
+
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
 	Adding helper functions for handling of collapsing margins.
 	Not used yet.
 	
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ab29d7d..8863e6f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,17 @@
 2002-10-14  David Hyatt  <hyatt at apple.com>
 
+	More collapsing margin surgery.  Working on setting up blocks 
+	to properly compute their collapsed margins (without actually changing
+	the obsolete collapsing behavior yet).
+	
+        * khtml/rendering/render_flow.cpp:
+        (RenderFlow::RenderFlow):
+        (RenderFlow::layout):
+        (RenderFlow::layoutBlockChildren):
+        * khtml/rendering/render_flow.h:
+
+2002-10-14  David Hyatt  <hyatt at apple.com>
+
 	Adding helper functions for handling of collapsing margins.
 	Not used yet.
 	
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index d43b523..e59702b 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -61,6 +61,8 @@ RenderFlow::RenderFlow(DOM::NodeImpl* node)
     m_clearStatus = CNONE;
 
     specialObjects = 0;
+    
+    m_maxTopPosMargin = m_maxTopNegMargin = m_maxBottomPosMargin = m_maxBottomNegMargin = 0;
 }
 
 void RenderFlow::setStyle(RenderStyle *_style)
@@ -217,11 +219,11 @@ void RenderFlow::layout()
 
     bool relayoutChildren = false;
     if ( oldWidth != m_width )
-	relayoutChildren = true;
+        relayoutChildren = true;
 
     // need a small hack here, as tables are done a bit differently
     if ( isTableCell() ) //&& static_cast<RenderTableCell *>(this)->widthChanged() )
-	relayoutChildren = true;
+        relayoutChildren = true;
 
 //     kdDebug( 6040 ) << specialObjects << "," << oldWidth << ","
 //                     << m_width << ","<< layouted() << "," << isAnonymousBox() << ","
@@ -256,6 +258,16 @@ void RenderFlow::layout()
     m_height = 0;
     m_clearStatus = CNONE;
 
+    // Start out by setting our margin values to our current margin.
+    if (m_marginTop > 0)
+        m_maxTopPosMargin = m_marginTop;
+    else
+        m_maxTopNegMargin = m_marginTop;
+    if (m_marginBottom > 0)
+        m_maxBottomPosMargin = m_marginBottom;
+    else
+        m_maxBottomNegMargin = m_marginBottom;
+        
 //    kdDebug( 6040 ) << "childrenInline()=" << childrenInline() << endl;
     if(childrenInline()) {
         // ### make bidi resumeable so that we can get rid of this ugly hack
@@ -268,15 +280,15 @@ void RenderFlow::layout()
     int oldHeight = m_height;
     calcHeight();
     if ( oldHeight != m_height )
-	relayoutChildren = true;
+        relayoutChildren = true;
 
     if ( isTableCell() && lastChild() && lastChild()->hasOverhangingFloats() ) {
         m_height = lastChild()->yPos() + static_cast<RenderFlow*>(lastChild())->floatBottom();
-	m_height += borderBottom() + paddingBottom();
+        m_height += borderBottom() + paddingBottom();
     }
     if( hasOverhangingFloats() && (isFloating() || isTableCell()) ) {
-	m_height = floatBottom();
-	m_height += borderBottom() + paddingBottom();
+        m_height = floatBottom();
+        m_height += borderBottom() + paddingBottom();
     }
 
     layoutSpecialObjects( relayoutChildren );
@@ -333,26 +345,27 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
         xPos = marginLeft() + m_width - paddingRight() - borderRight();
     }
 
+    bool canCollapseWithChildren = !isPositioned() && !isFloating() && !isTableCell();
+    
     RenderObject *child = firstChild();
     RenderFlow *prevFlow = 0;
 
     int prevMargin = 0;
     if(isTableCell() ) {
-	prevMargin = TABLECELLMARGIN;
+        prevMargin = TABLECELLMARGIN;
     } else if ( m_height == 0 ) {
-	// the elements and childs margin collapse if there is no border and padding.
-	prevMargin = marginTop();
-	if ( parent() )
-	    prevMargin = collapseMargins( prevMargin, parent()->marginTop() );
-	if ( prevMargin != TABLECELLMARGIN )
-	    m_height = -prevMargin;
+        // the elements and childs margin collapse if there is no border and padding.
+        prevMargin = marginTop();
+        if ( parent() )
+            prevMargin = collapseMargins( prevMargin, parent()->marginTop() );
+        if ( prevMargin != TABLECELLMARGIN )
+            m_height = -prevMargin;
     }
     //kdDebug() << "RenderFlow::layoutBlockChildren " << prevMargin << endl;
 
     // take care in case we inherited floats
     if (child && floatBottom() > m_height)
-	child->setLayouted(false);
-
+        child->setLayouted(false);
 
 //     QTime t;
 //     t.start();
diff --git a/WebCore/khtml/rendering/render_flow.h b/WebCore/khtml/rendering/render_flow.h
index 74fa74e..b92b104 100644
--- a/WebCore/khtml/rendering/render_flow.h
+++ b/WebCore/khtml/rendering/render_flow.h
@@ -134,6 +134,19 @@ public:
     void bidiReorderLine(const BidiIterator &start, const BidiIterator &end);
     BidiIterator findNextLineBreak(BidiIterator &start);
 
+    virtual short maxTopMargin(bool positive) const {
+        if (positive)
+            return m_maxTopPosMargin;
+        else
+            return m_maxTopNegMargin;
+    }
+    virtual short maxBottomMargin(bool positive) const {
+        if (positive)
+            return m_maxBottomPosMargin;
+        else
+            return m_maxBottomNegMargin;
+    }
+
 protected:
 
     struct SpecialObject {
@@ -183,6 +196,11 @@ private:
     bool firstLine        : 1; // used in inline layouting
     bool m_blockBidi : 1;
     EClear m_clearStatus  : 2; // used during layuting of paragraphs
+    
+    short m_maxTopPosMargin;
+    short m_maxTopNegMargin;
+    short m_maxBottomPosMargin;
+    short m_maxBottomNegMargin;
 };
 
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list