[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:51:45 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 8e9813e74c9b1fc4868992570c3e1f322bb30601
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Oct 21 08:16:13 2002 +0000
Fix for margin problems on aintitcool.com. There was a subtlety
to WinIE's quirk. For <h1>-<h6> only, they don't collapse the
bottom margin for table cells (they still collapse the top
margin). I just love emulating the odd behavior of WinIE.
Wheee.
* khtml/rendering/render_flow.cpp:
(RenderFlow::layoutBlockChildren):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2392 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f5ecccd..fdeaa60 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,14 @@
+2002-10-21 David Hyatt <hyatt at apple.com>
+
+ Fix for margin problems on aintitcool.com. There was a subtlety
+ to WinIE's quirk. For <h1>-<h6> only, they don't collapse the
+ bottom margin for table cells (they still collapse the top
+ margin). I just love emulating the odd behavior of WinIE.
+ Wheee.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+
2002-10-20 Darin Adler <darin at apple.com>
Redid my fix. It was just an ordering thing. The image had to already be
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f5ecccd..fdeaa60 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,14 @@
+2002-10-21 David Hyatt <hyatt at apple.com>
+
+ Fix for margin problems on aintitcool.com. There was a subtlety
+ to WinIE's quirk. For <h1>-<h6> only, they don't collapse the
+ bottom margin for table cells (they still collapse the top
+ margin). I just love emulating the odd behavior of WinIE.
+ Wheee.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+
2002-10-20 Darin Adler <darin at apple.com>
Redid my fix. It was just an ordering thing. The image had to already be
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f5ecccd..fdeaa60 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,14 @@
+2002-10-21 David Hyatt <hyatt at apple.com>
+
+ Fix for margin problems on aintitcool.com. There was a subtlety
+ to WinIE's quirk. For <h1>-<h6> only, they don't collapse the
+ bottom margin for table cells (they still collapse the top
+ margin). I just love emulating the odd behavior of WinIE.
+ Wheee.
+
+ * khtml/rendering/render_flow.cpp:
+ (RenderFlow::layoutBlockChildren):
+
2002-10-20 Darin Adler <darin at apple.com>
Redid my fix. It was just an ordering thing. The image had to already be
diff --git a/WebCore/khtml/rendering/render_flow.cpp b/WebCore/khtml/rendering/render_flow.cpp
index 093b9af..0ced634 100644
--- a/WebCore/khtml/rendering/render_flow.cpp
+++ b/WebCore/khtml/rendering/render_flow.cpp
@@ -37,6 +37,8 @@
#include "xml/dom_nodeimpl.h"
#include "xml/dom_docimpl.h"
#include "khtmlview.h"
+#include "htmltags.h"
+
using namespace DOM;
using namespace khtml;
@@ -361,9 +363,17 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
// self-collapsing blocks.
bool topMarginContributor = true;
+ // The last non-collapsed child we encountered.
+ // We will avoid throwing away the bottom margins if the last non-collapsed child encountered is
+ // an H1-H6 element. -dwh
+ RenderObject* lastNonCollapsedChild = 0;
+
// These flags track the previous maximal positive and negative margins.
int prevPosMargin = maxTopMargin(true);
int prevNegMargin = maxTopMargin(false);
+
+ // Whether or not we encountered an element with clear set that actually had to
+ // be pushed down below a float.
int clearOccurred = false;
int oldPosMargin = prevPosMargin;
@@ -463,6 +473,7 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
ypos = m_height + prevPosMargin - prevNegMargin;
}
else {
+ lastNonCollapsedChild = child;
if (!topMarginContributor ||
(!canCollapseWithChildren &&
(element()->getDocument()->parseMode() == DocumentImpl::Strict ||
@@ -558,11 +569,24 @@ void RenderFlow::layoutBlockChildren( bool relayoutChildren )
// with it.
if (canCollapseWithChildren && !autoHeight)
canCollapseWithChildren = false;
-
+
+ // XXX This is a gross hack. Basically if the last child is marginless, we will (in quirks
+ // mode) allow the collapsed bottom margin to be added to the table cell. This is a sleazy
+ // way of keeping <td><p>Foo</p></td> from showing a bottom margin but still allowing
+ // <td><font><h3>Foo</h3></font></td> to show a bottom margin.
+ // A better fix (since we only cared about H1-H6 in the first place would be to recur
+ // into the last non-collapsed children until you don't find one any more, and if that
+ // innermost child was an H1-H6, use it. -dwh
+ int marginBottom = -1;
+ if (lastNonCollapsedChild)
+ marginBottom = lastNonCollapsedChild->marginBottom();
+
// If we can't collapse with children then go ahead and add in the bottom margins.
if (!canCollapseWithChildren && !topMarginContributor &&
(element()->getDocument()->parseMode() == DocumentImpl::Strict ||
- !isTableCell()))
+ !isTableCell() || (lastNonCollapsedChild && lastNonCollapsedChild->element() &&
+ lastNonCollapsedChild->element()->id() >= ID_H1 &&
+ lastNonCollapsedChild->element()->id() <= ID_H6) || (marginBottom == 0)))
m_height += prevPosMargin - prevNegMargin;
m_height += toAdd;
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list