[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 08:23:17 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 9b7c8c9a7cb9d6824d07e085dace3d7fc05d4633
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Fri Jan 23 02:34:56 2004 +0000
Fix a bug I accidentally introduced in static positioned elements. Add more margin collapsing tests.
* ChangeLog:
* khtml/rendering/render_block.cpp:
(khtml::RenderBlock::layoutBlockChildren):
* layout-tests/fast/block/margin-collapse/044-expected.txt: Added.
* layout-tests/fast/block/margin-collapse/044.html: Added.
* layout-tests/fast/block/margin-collapse/045-expected.txt: Added.
* layout-tests/fast/block/margin-collapse/045.html: Added.
* layout-tests/fast/block/margin-collapse/062-expected.txt: Added.
* layout-tests/fast/block/margin-collapse/062.html: Added.
* layout-tests/fast/block/margin-collapse/063-expected.txt: Added.
* layout-tests/fast/block/margin-collapse/063.html: Added.
* layout-tests/fast/block/positioning/007-expected.txt:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5968 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/block/margin-collapse/044-expected.txt b/LayoutTests/fast/block/margin-collapse/044-expected.txt
new file mode 100644
index 0000000..6bee99c
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/044-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x68
+ RenderBlock {HTML} at (0,0) size 800x68 [border: (1px solid #C0C0C0)]
+ RenderBody {BODY} at (1,17) size 798x34
+ RenderBlock (floating) {DIV} at (16,0) size 336x34 [bgcolor=#00FFFF]
+ RenderText {TEXT} at (8,8) size 53x18
+ text run at (8,8) width 53: "FLOAT"
+ RenderBlock (anonymous) at (0,0) size 798x0
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderBlock {DIV} at (16,0) size 766x34 [bgcolor=#FFFF00]
+ RenderText {TEXT} at (352,8) size 56x18
+ text run at (352,8) width 56: "BLOCK"
diff --git a/LayoutTests/fast/block/margin-collapse/044.html b/LayoutTests/fast/block/margin-collapse/044.html
new file mode 100644
index 0000000..b017e83
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/044.html
@@ -0,0 +1,16 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Bug 204831: 1</title>
+ <style type="text/css">
+ * { margin: 0; padding: 0; border: 0; }
+ html { border: solid thin silver; }
+ div { margin: 1em; padding: 0.5em; background: yellow; }
+ .float { width: 20em; margin: 0 1em; float: left; background: aqua; }
+ </style>
+ </head>
+ <body>
+ <div class="float"> FLOAT </div>
+ <div> BLOCK </div>
+ </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/margin-collapse/045-expected.txt b/LayoutTests/fast/block/margin-collapse/045-expected.txt
new file mode 100644
index 0000000..3d037a2
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/045-expected.txt
@@ -0,0 +1,13 @@
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x86
+ RenderBlock {HTML} at (0,0) size 800x86 [border: (1px solid #C0C0C0)]
+ RenderBody {BODY} at (1,1) size 798x68
+ RenderBlock (floating) {DIV} at (16,0) size 336x34 [bgcolor=#00FFFF]
+ RenderText {TEXT} at (8,8) size 53x18
+ text run at (8,8) width 53: "FLOAT"
+ RenderBlock (anonymous) at (0,0) size 798x0
+ RenderText {TEXT} at (0,0) size 0x0
+ RenderBlock {DIV} at (16,34) size 766x34 [bgcolor=#FFFF00]
+ RenderText {TEXT} at (8,8) size 56x18
+ text run at (8,8) width 56: "BLOCK"
diff --git a/LayoutTests/fast/block/margin-collapse/045.html b/LayoutTests/fast/block/margin-collapse/045.html
new file mode 100644
index 0000000..0856036
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/045.html
@@ -0,0 +1,17 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>Bug 204831: 2</title>
+ <style type="text/css">
+ * { margin: 0; padding: 0; border: 0; }
+ html { border: solid thin silver; }
+ div { margin: 1em; padding: 0.5em; background: yellow; }
+ .float { width: 20em; margin: 0 1em; float: left; background: aqua; }
+ .clear { clear: left }
+ </style>
+ </head>
+ <body>
+ <div class="float"> FLOAT </div>
+ <div class="clear"> BLOCK </div>
+ </body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/fast/block/margin-collapse/062-expected.txt b/LayoutTests/fast/block/margin-collapse/062-expected.txt
new file mode 100644
index 0000000..82579a6
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/062-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x46 layerType: background only
+layer at (10,46) size 320x64
+ RenderBlock (positioned) zI: -1 {DIV} at (10,46) size 320x64 [color=#FFFF00] [bgcolor=#FF0000]
+ RenderText zI: -1 {TEXT} at (0,0) size 36x18
+ text run at (0,0) width 36: "FAIL"
+layer at (0,0) size 800x46 layerType: foreground only
+ RenderBlock {HTML} at (0,0) size 800x46
+ RenderBody {BODY} at (10,46) size 780x0
+ RenderBlock {DIV} at (2,0) size 776x0
+ RenderBlock {DIV} at (20,0) size 736x0
+ RenderBlock {DIV} at (0,0) size 736x0
+ RenderBlock (floating) {DIV} at (0,0) size 320x64 [color=#FFFFFF] [bgcolor=#008000]
+ RenderText {TEXT} at (0,0) size 175x18
+ text run at (0,0) width 175: "This block should be green."
+ RenderBlock {DIV} at (50,0) size 680x0
diff --git a/LayoutTests/fast/block/margin-collapse/062.html b/LayoutTests/fast/block/margin-collapse/062.html
new file mode 100644
index 0000000..a3bf3d0
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/062.html
@@ -0,0 +1,28 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html lang="en">
+ <head>
+ <title>Margin collapsing with floats before self collapsing children with margins collapsing with parent</title>
+ <style type="text/css">
+ /* This test requires half-decent z-index support */
+ /* Rendering should not not match 061.html! */
+ html { margin: 0; padding: 0; }
+ body { margin: 0 10px; padding: 0; }
+ .a { position: absolute; top: 46px; left: 10px; width: 20em; height: 4em; background: red; color: yellow; z-index: -1; }
+ .b { float: left; width: 20em; height: 4em; background: green; color: white; }
+ .c1 { margin: 2px; }
+ .c2 { margin: -4px 20px; }
+ .c3 { margin: 0 0 14px; }
+ .c4 { margin: 50px; }
+ </style>
+ </head>
+ <body>
+ <div class="c1">
+ <div class="c2">
+ <div class="c3"></div>
+ </div>
+ </div>
+ <div class="a">FAIL</div>
+ <div class="b">This block should be green.</div>
+ <div class="c4"></div>
+ </body>
+</html>
diff --git a/LayoutTests/fast/block/margin-collapse/063-expected.txt b/LayoutTests/fast/block/margin-collapse/063-expected.txt
new file mode 100644
index 0000000..f881631
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/063-expected.txt
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+ RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x49 layerType: background only
+layer at (10,13) size 320x64
+ RenderBlock (positioned) zI: -1 {DIV} at (10,13) size 320x64 [color=#FFFF00] [bgcolor=#FF0000]
+ RenderText zI: -1 {TEXT} at (0,0) size 36x18
+ text run at (0,0) width 36: "FAIL"
+layer at (0,0) size 800x49 layerType: foreground only
+ RenderBlock {HTML} at (0,0) size 800x49
+ RenderBody {BODY} at (10,2) size 780x1
+ RenderBlock {DIV} at (2,0) size 776x1
+ RenderBlock {DIV} at (20,11) size 736x0
+ RenderBlock {DIV} at (0,0) size 736x0
+ RenderBlock (floating) {DIV} at (0,11) size 320x64 [color=#FFFFFF] [bgcolor=#008000]
+ RenderText {TEXT} at (0,0) size 175x18
+ text run at (0,0) width 175: "This block should be green."
+ RenderBlock {DIV} at (50,47) size 680x0
diff --git a/LayoutTests/fast/block/margin-collapse/063.html b/LayoutTests/fast/block/margin-collapse/063.html
new file mode 100644
index 0000000..3a94c47
--- /dev/null
+++ b/LayoutTests/fast/block/margin-collapse/063.html
@@ -0,0 +1,27 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html lang="en">
+ <head>
+ <title>Margin collapsing with floats before self collapsing children with margins not collapsing with parent</title>
+ <style type="text/css">
+ /* This test requires half-decent z-index support */
+ html { margin: 0; padding: 0; }
+ body { margin: 0 10px; padding: 0; }
+ .a { position: absolute; top: 13px; left: 10px; width: 20em; height: 4em; background: red; color: yellow; z-index: -1; }
+ .b { float: left; width: 20em; height: 4em; background: green; color: white; }
+ .c1 { margin: 2px; padding-top: 1px; } /* prevent collapsing with parent */
+ .c2 { margin: -4px 20px; }
+ .c3 { margin: 0 0 14px; }
+ .c4 { margin: 50px; }
+ </style>
+ </head>
+ <body>
+ <div class="c1">
+ <div class="c2">
+ <div class="c3"></div>
+ </div>
+ </div>
+ <div class="a">FAIL</div>
+ <div class="b">This block should be green.</div>
+ <div class="c4"></div>
+ </body>
+</html>
diff --git a/LayoutTests/fast/block/positioning/007-expected.txt b/LayoutTests/fast/block/positioning/007-expected.txt
index e731b2d..27378a4 100644
--- a/LayoutTests/fast/block/positioning/007-expected.txt
+++ b/LayoutTests/fast/block/positioning/007-expected.txt
@@ -3,5 +3,5 @@ layer at (0,0) size 800x600
layer at (0,0) size 800x116
RenderBlock {HTML} at (0,0) size 800x116
RenderBody {BODY} at (8,8) size 784x100
- RenderBlock zI: 2 {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
- RenderBlock zI: 1 {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+ RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#FF0000]
+ RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 76d5213..dedbae3 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,5 +1,34 @@
2004-01-22 David Hyatt <hyatt at apple.com>
+ Fix a bug I accidentally introduced in static positioned elements. Add more margin collapsing tests.
+
+ * ChangeLog:
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::layoutBlockChildren):
+ * layout-tests/fast/block/margin-collapse/044-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/044.html: Added.
+ * layout-tests/fast/block/margin-collapse/045-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/045.html: Added.
+ * layout-tests/fast/block/margin-collapse/062-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/062.html: Added.
+ * layout-tests/fast/block/margin-collapse/063-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/063.html: Added.
+ * layout-tests/fast/block/positioning/007-expected.txt:
+
+2004-01-22 David Hyatt <hyatt at apple.com>
+
+ Reviewed by NOBODY (OOPS!).
+
+ * khtml/rendering/render_block.cpp:
+ (khtml::RenderBlock::layoutBlockChildren):
+ * layout-tests/fast/block/margin-collapse/062-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/062.html: Added.
+ * layout-tests/fast/block/margin-collapse/063-expected.txt: Added.
+ * layout-tests/fast/block/margin-collapse/063.html: Added.
+ * layout-tests/fast/block/positioning/007-expected.txt:
+
+2004-01-22 David Hyatt <hyatt at apple.com>
+
(1) Implement better XML error handling.
(2) Fix a minor z-index bug with the 'initial' value.
(3) Initial landing of XBL support. Code is all ifnef KHTML_NO_XBL so that it can be turned off easily if
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 719548f..1cbe61e 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -622,7 +622,19 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
child->setStaticX(borderRight()+paddingRight());
}
if (child->hasStaticY()) {
- int marginOffset = (!topMarginContributor || !canCollapseTopWithChildren) ? (prevPosMargin - prevNegMargin) : 0;
+ int marginOffset = 0;
+ bool shouldSynthesizeCollapse = (!topMarginContributor || !canCollapseTopWithChildren);
+ if (shouldSynthesizeCollapse) {
+ int collapsedTopPos = prevPosMargin;
+ int collapsedTopNeg = prevNegMargin;
+ bool posMargin = child->marginTop() >= 0;
+ if (posMargin && child->marginTop() > collapsedTopPos)
+ collapsedTopPos = child->marginTop();
+ else if (!posMargin && child->marginTop() > collapsedTopNeg)
+ collapsedTopNeg = child->marginTop();
+ marginOffset += (collapsedTopPos - collapsedTopNeg) - child->marginTop();
+ }
+
int yPosEstimate = m_height + marginOffset;
child->setStaticY(yPosEstimate);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list