[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:43:35 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit cc1eecf9f92355ef37610ed2cdf52e2fc1d4a1a2
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jun 3 21:36:15 2004 +0000

    	Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
    
            Reviewed by darin
    
            * khtml/rendering/render_block.cpp:
            (khtml::RenderBlock::layoutBlockChildren):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6756 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/fast/block/float/032-expected.txt b/LayoutTests/fast/block/float/032-expected.txt
new file mode 100644
index 0000000..b0688e8
--- /dev/null
+++ b/LayoutTests/fast/block/float/032-expected.txt
@@ -0,0 +1,66 @@
+layer at (0,0) size 800x1022
+  RenderCanvas at (0,0) size 800x600
+layer at (0,0) size 800x1022
+  RenderBlock {HTML} at (0,0) size 800x1022
+    RenderBody {BODY} at (8,8) size 784x1006
+      RenderBlock {DIV} at (0,0) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (anonymous) at (5,5) size 774x0
+          RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+          RenderText {TEXT} at (0,0) size 0x0
+        RenderImage {IMG} at (205,5) size 100x100 [bgcolor=#800080]
+      RenderBlock (anonymous) at (0,110) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,128) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
+        RenderText {TEXT} at (0,0) size 0x0
+        RenderImage {IMG} at (305,5) size 100x100 [bgcolor=#800080]
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock (anonymous) at (0,238) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,256) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (anonymous) at (5,5) size 774x0
+          RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+          RenderText {TEXT} at (0,0) size 0x0
+        RenderImage {IMG} at (55,5) size 100x100 [bgcolor=#800080]
+      RenderBlock (anonymous) at (0,366) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,384) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
+        RenderText {TEXT} at (0,0) size 0x0
+        RenderImage {IMG} at (55,5) size 100x100 [bgcolor=#800080]
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock (anonymous) at (0,494) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,512) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (anonymous) at (5,5) size 774x0
+          RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+          RenderText {TEXT} at (0,0) size 0x0
+        RenderLineEdit {INPUT} at (205,5) size 100x18 [bgcolor=#800080]
+      RenderBlock (anonymous) at (0,622) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,640) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
+        RenderText {TEXT} at (0,0) size 0x0
+        RenderLineEdit {INPUT} at (305,5) size 100x18 [bgcolor=#800080]
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock (anonymous) at (0,750) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,768) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (anonymous) at (5,5) size 774x0
+          RenderBlock (floating) {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+          RenderText {TEXT} at (0,0) size 0x0
+        RenderLineEdit {INPUT} at (55,5) size 100x18 [bgcolor=#800080]
+      RenderBlock (anonymous) at (0,878) size 784x18
+        RenderBR {BR} at (0,0) size 0x18
+        RenderText {TEXT} at (0,0) size 0x0
+      RenderBlock {DIV} at (0,896) size 784x110 [border: (5px solid #000000)]
+        RenderBlock (floating) {DIV} at (5,5) size 100x100 [bgcolor=#008000]
+        RenderText {TEXT} at (0,0) size 0x0
+        RenderLineEdit {INPUT} at (55,5) size 100x18 [bgcolor=#800080]
+        RenderText {TEXT} at (0,0) size 0x0
diff --git a/LayoutTests/fast/block/float/032.html b/LayoutTests/fast/block/float/032.html
new file mode 100644
index 0000000..478b092
--- /dev/null
+++ b/LayoutTests/fast/block/float/032.html
@@ -0,0 +1,67 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
+<html>
+<head>
+<style>
+body > div { border:5px solid black; height: 100px }
+.float { float: left; width:100px; height:100px; background-color: green }
+.normal { width: 100px; height:100px; background-color: purple }
+.left { margin-left: 200px; }
+.negleft { margin-left: -50px; }
+.block { display: block }
+</style>
+</head>
+<body>
+<div>
+  <div class="float"></div>
+  <img class="block normal left">
+</div>
+
+<br clear="all">
+
+<div>
+    <div class="float"></div>
+    <img class="normal left">
+</div>
+
+<br clear="all">
+
+<div>
+  <div class="float"></div>
+  <img class="block normal negleft">
+</div>
+
+<br clear="all">
+
+<div>
+    <div class="float"></div>
+    <img class="normal negleft">
+</div>
+
+<br clear="all">
+
+<div>
+  <div class="float"></div>
+  <input class="block normal left">
+</div>
+
+<br clear="all">
+
+<div>
+    <div class="float"></div>
+    <input class="normal left">
+</div>
+
+<br clear="all">
+
+<div>
+  <div class="float"></div>
+  <input class="block normal negleft">
+</div>
+
+<br clear="all">
+
+<div>
+    <div class="float"></div>
+    <input class="normal negleft">
+</div>
+
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 646201e..d742037 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,12 @@
+2004-06-02  David Hyatt  <hyatt at apple.com>
+
+	Fix for 3673931, negative margins on objects that dodge floats not handled correctly.
+	
+        Reviewed by darin
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::layoutBlockChildren):
+
 2004-06-03  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by Hyatt
@@ -92,6 +101,7 @@
         * khtml/rendering/render_canvasimage.cpp:
         (RenderCanvasImage::createDrawingContext):
 
+>>>>>>> 1.2855
 2004-06-01  Trey Matteson  <trey at apple.com>
 
 	First cut at the source side of DHTML dragging.  Following IE, new events are added:
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 09a400a..a52b6a2 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -990,8 +990,11 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             // to shift over as necessary to dodge any floats that might get in the way.
             if (child->avoidsFloats()) {
                 int leftOff = leftOffset(m_height);
-                if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type != Variable)
+                if (style()->textAlign() != KHTML_CENTER && child->style()->marginLeft().type != Variable) {
+                    if (child->marginLeft() < 0)
+                        leftOff += child->marginLeft();
                     chPos = kMax(chPos, leftOff); // Let the float sit in the child's margin if it can fit.
+                }
                 else if (leftOff != xPos) {
                     // The object is shifting right. The object might be centered, so we need to
                     // recalculate our horizontal margins. Note that the containing block content
@@ -1009,9 +1012,11 @@ void RenderBlock::layoutBlockChildren( bool relayoutChildren )
             chPos -= child->width() + child->marginRight();
             if (child->avoidsFloats()) {
                 int rightOff = rightOffset(m_height);
-                if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type != Variable)
+                if (style()->textAlign() != KHTML_CENTER && child->style()->marginRight().type != Variable) {
+                    if (child->marginRight() < 0)
+                        rightOff -= child->marginRight();
                     chPos = kMin(chPos, rightOff - child->width()); // Let the float sit in the child's margin if it can fit.
-                else if (rightOff != xPos) {
+                } else if (rightOff != xPos) {
                     // The object is shifting left. The object might be centered, so we need to
                     // recalculate our horizontal margins. Note that the containing block content
                     // width computation will take into account the delta between |rightOff| and |xPos|

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list