[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

hyatt at apple.com hyatt at apple.com
Wed Dec 22 13:31:35 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 652b6bf5d3a11a2f1b7bf41f7c116aee4e2f6ab8
Author: hyatt at apple.com <hyatt at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Sep 18 04:09:23 2010 +0000

    https://bugs.webkit.org/show_bug.cgi?id=46027, image on gamespot.com paginates without bringing its enclosing border along.
    
    Reviewed by Sam Weinig.
    
    Make sure that unsplittable objects like replaced elements propagate their pagination strut outward to the parent block
    when appropriate.  An image on a line did this, but a block-level image did not.
    
    Added fast/multicol/image-inside-nested-blocks-with-border.html
    
    WebCore:
    
    * rendering/RenderBlock.cpp:
    (WebCore::RenderBlock::layoutBlockChild):
    
    LayoutTests:
    
    * fast/multicol/image-inside-nested-blocks-with-border-expected.txt: Added.
    * fast/multicol/image-inside-nested-blocks-with-border.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67774 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index d6d706b..9074aa9 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-17  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46027, image on gamespot.com paginates without bringing its enclosing border along.
+        
+        Make sure that unsplittable objects like replaced elements propagate their pagination strut outward to the parent block
+        when appropriate.  An image on a line did this, but a block-level image did not.
+
+        Added fast/multicol/image-inside-nested-blocks-with-border.html
+
+        * fast/multicol/image-inside-nested-blocks-with-border-expected.txt: Added.
+        * fast/multicol/image-inside-nested-blocks-with-border.html: Added.
+
 2010-09-17  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Remove passing tests from expectations.
diff --git a/LayoutTests/editing/selection/5136696-expected.txt b/LayoutTests/fast/multicol/image-inside-nested-blocks-with-border-expected.txt
similarity index 100%
copy from LayoutTests/editing/selection/5136696-expected.txt
copy to LayoutTests/fast/multicol/image-inside-nested-blocks-with-border-expected.txt
diff --git a/LayoutTests/fast/multicol/image-inside-nested-blocks-with-border.html b/LayoutTests/fast/multicol/image-inside-nested-blocks-with-border.html
new file mode 100644
index 0000000..b53db8a
--- /dev/null
+++ b/LayoutTests/fast/multicol/image-inside-nested-blocks-with-border.html
@@ -0,0 +1,44 @@
+<html>
+<body>
+<div id="tests" style="-webkit-column-count:2; height:300px; width:600px; -webkit-column-gap:0">
+<div style="height:280px"></div>
+<div id="f1" style="border:5px solid black; float:left">
+<img style="display:block;width:140px;height:80px;">
+</div>
+</div>
+<div id="result"></div>
+<script>
+    function floatOffset(float)
+    {
+        var parentRect = document.getElementById('tests').getBoundingClientRect();
+        var rect = float.getBoundingClientRect();
+        return { width: rect.left - parentRect.left, height: rect.top - parentRect.top  };
+    }
+
+    var tests = [
+        ["f1", 300, 0]
+    ];
+
+    var test;
+    var failures = 0;
+    while (test = tests.shift()) {
+        var float = document.getElementById(test[0]);
+        var result = floatOffset(float);
+        var passed = result.width === test[1] && result.height === test[2]
+        float.style.backgroundColor = passed ? "green" : "red";
+        if (!passed)
+            failures++
+    }
+
+    if (window.layoutTestController) {
+        layoutTestController.dumpAsText();
+        document.getElementById("tests").style.display = "none";
+    }
+
+    document.getElementById("result").innerText = failures ? "FAIL: " + failures + " cases failed" : "PASS";
+</script>
+
+
+
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index fbb2684..030c52c 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,17 @@
+2010-09-17  David Hyatt  <hyatt at apple.com>
+
+        Reviewed by Sam Weinig.
+
+        https://bugs.webkit.org/show_bug.cgi?id=46027, image on gamespot.com paginates without bringing its enclosing border along.
+        
+        Make sure that unsplittable objects like replaced elements propagate their pagination strut outward to the parent block
+        when appropriate.  An image on a line did this, but a block-level image did not.
+
+        Added fast/multicol/image-inside-nested-blocks-with-border.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutBlockChild):
+
 2010-09-17  Dimitri Glazkov  <dglazkov at chromium.org>
 
         Unreviewed, build fix.
diff --git a/WebCore/rendering/RenderBlock.cpp b/WebCore/rendering/RenderBlock.cpp
index cc99cb7..bd06bae 100644
--- a/WebCore/rendering/RenderBlock.cpp
+++ b/WebCore/rendering/RenderBlock.cpp
@@ -1872,19 +1872,28 @@ void RenderBlock::layoutBlockChild(RenderBox* child, MarginInfo& marginInfo, int
         yAfterClear = applyBeforeBreak(child, yAfterClear);
     
         // For replaced elements and scrolled elements, we want to shift them to the next page if they don't fit on the current one.
-        yAfterClear = adjustForUnsplittableChild(child, yAfterClear);
+        int yBeforeUnsplittableAdjustment = yAfterClear;
+        int yAfterUnsplittableAdjustment = adjustForUnsplittableChild(child, yAfterClear);
         
-        if (childRenderBlock && childRenderBlock->paginationStrut()) {
+        int paginationStrut = 0;
+        int unsplittableAdjustmentDelta = yAfterUnsplittableAdjustment - yBeforeUnsplittableAdjustment;
+        if (unsplittableAdjustmentDelta)
+            paginationStrut = unsplittableAdjustmentDelta;
+        else if (childRenderBlock && childRenderBlock->paginationStrut())
+            paginationStrut = childRenderBlock->paginationStrut();
+
+        if (paginationStrut) {
             // We are willing to propagate out to our parent block as long as we were at the top of the block prior
             // to collapsing our margins, and as long as we didn't clear or move as a result of other pagination.
             if (atTopOfBlock && oldY == yBeforeClear && !isPositioned() && !isTableCell()) {
                 // FIXME: Should really check if we're exceeding the page height before propagating the strut, but we don't
                 // have all the information to do so (the strut only has the remaining amount to push).  Gecko gets this wrong too
                 // and pushes to the next page anyway, so not too concerned about it.
-                setPaginationStrut(yAfterClear + childRenderBlock->paginationStrut());
-                childRenderBlock->setPaginationStrut(0);
+                setPaginationStrut(yAfterClear + paginationStrut);
+                if (childRenderBlock)
+                    childRenderBlock->setPaginationStrut(0);
             } else
-                yAfterClear += childRenderBlock->paginationStrut();
+                yAfterClear += paginationStrut;
         }
 
         // Similar to how we apply clearance.  Go ahead and boost height() to be the place where we're going to position the child.

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list