[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:50:11 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 729277aeda022e7ca5b69fe15e38bcc79e0ba92a
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 16 00:39:15 2002 +0000
More work on making blocks correctly compute their maximal
positive and negative margins. Adding code to ensure
that floats and absolute/fixed positioned elements know
not to collapse with children or with themselves. Also adding
code to teach empty blocks that they can collapse their own
margins together.
* khtml/rendering/render_flow.cpp:
(RenderFlow::layout):
(RenderFlow::layoutBlockChildren):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2337 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 64d1c5f..bb4ee31 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,16 @@
+2002-10-15 David Hyatt <hyatt at apple.com>
+
+ More work on making blocks correctly compute their maximal
+ positive and negative margins. Adding code to ensure
+ that floats and absolute/fixed positioned elements know
+ not to collapse with children or with themselves. Also adding
+ code to teach empty blocks that they can collapse their own
+ margins together.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layout):
+ (RenderFlow::layoutBlockChildren):
+
2002-10-15 Darin Adler <darin at apple.com>
WebCore support for using referrer even in loads that are not initiated
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 64d1c5f..bb4ee31 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,16 @@
+2002-10-15 David Hyatt <hyatt at apple.com>
+
+ More work on making blocks correctly compute their maximal
+ positive and negative margins. Adding code to ensure
+ that floats and absolute/fixed positioned elements know
+ not to collapse with children or with themselves. Also adding
+ code to teach empty blocks that they can collapse their own
+ margins together.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layout):
+ (RenderFlow::layoutBlockChildren):
+
2002-10-15 Darin Adler <darin at apple.com>
WebCore support for using referrer even in loads that are not initiated
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 64d1c5f..bb4ee31 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,16 @@
+2002-10-15 David Hyatt <hyatt at apple.com>
+
+ More work on making blocks correctly compute their maximal
+ positive and negative margins. Adding code to ensure
+ that floats and absolute/fixed positioned elements know
+ not to collapse with children or with themselves. Also adding
+ code to teach empty blocks that they can collapse their own
+ margins together.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layout):
+ (RenderFlow::layoutBlockChildren):
+
2002-10-15 Darin Adler <darin at apple.com>
WebCore support for using referrer even in loads that are not initiated
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 27aacc0..08bf435 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -258,6 +258,7 @@ void RenderFlow::layout()
m_height = 0;
m_clearStatus = CNONE;
+ // COLLAPSING MARGIN CODE
// Start out by setting our margin values to our current margin.
if (m_marginTop > 0)
m_maxTopPosMargin = m_marginTop;
@@ -267,7 +268,8 @@ void RenderFlow::layout()
m_maxBottomPosMargin = m_marginBottom;
else
m_maxBottomNegMargin = m_marginBottom;
-
+ bool canCollapseOwnMargins = !isPositioned() && !isFloating() && !isTableCell();
+
// kdDebug( 6040 ) << "childrenInline()=" << childrenInline() << endl;
if(childrenInline()) {
// ### make bidi resumeable so that we can get rid of this ugly hack
@@ -295,6 +297,30 @@ void RenderFlow::layout()
//kdDebug() << renderName() << " layout width=" << m_width << " height=" << m_height << endl;
+ // COLLAPSING MARGIN CODE
+ if (canCollapseOwnMargins && m_height == 0) {
+ // We are an empty block with no border and padding and a computed height
+ // of 0. The CSS spec states that empty blocks collapse their margins
+ // together.
+ // When blocks are empty, we just use the top margin values and set the
+ // bottom margin max values to 0. This way we don't factor in the values
+ // twice when we collapse with our previous vertically adjacent and
+ // following vertically adjacent blocks.
+ m_maxBottomPosMargin = m_maxBottomNegMargin = 0;
+ if (m_marginTop >= 0 && m_marginBottom >= 0)
+ m_maxTopPosMargin = m_marginTop > m_marginBottom ? m_marginTop : m_marginBottom;
+ else if (m_marginTop >= 0) {
+ m_maxTopPosMargin = m_marginTop;
+ m_maxTopNegMargin = m_marginBottom;
+ }
+ else if (m_marginBottom >= 0) {
+ m_maxTopPosMargin = m_marginBottom;
+ m_maxTopNegMargin = m_marginTop;
+ }
+ else
+ m_maxTopNegMargin = m_marginTop > m_marginBottom ? -m_marginBottom : -m_marginTop;
+ }
+
setLayouted();
}
@@ -345,12 +371,13 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
xPos = marginLeft() + m_width - paddingRight() - borderRight();
}
- // FIXME: The following variable appears to be unused.
- // bool canCollapseWithChildren = !isPositioned() && !isFloating() && !isTableCell();
-
RenderObject *child = firstChild();
RenderFlow *prevFlow = 0;
+ // COLLAPSING MARGIN CODE
+ //bool canCollapseWithChildren = !isPositioned() && !isFloating() && !isTableCell() &&
+ // (m_height == 0);
+
int prevMargin = 0;
if(isTableCell() ) {
prevMargin = TABLECELLMARGIN;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list