WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 18:26:50 +0000 (18:26 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 Dec 2007 18:26:50 +0000 (18:26 +0000)
        Reviewed by Darin Adler.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16334
          <rdar://problem/5634923> REGRESSION (r28299): Homepage of any DotMac Web Gallery won't load completely

        Test: fast/dynamic/subtree-no-common-root-static-y.html

        * rendering/RenderObject.cpp:
        (WebCore::RenderObject::markContainingBlocksForLayout): Changed the call
        to setChildNeedsLayout() to not mark containing blocks and added a
        separate call to markContainingBlocksForLayout() that will not schedule
        a layout if we are already in the middle of scheduleRelayoutOfSubtree().

LayoutTests:

        Reviewed by Darin Adler.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16334
          <rdar://problem/5634923> REGRESSION (r28299): Homepage of any DotMac Web Gallery won't load completely

        * fast/dynamic/subtree-no-common-root-static-y.html: Added.
        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.checksum: Added.
        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png: Added.
        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.txt: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@28519 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/dynamic/subtree-no-common-root-static-y.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderObject.cpp

index 7fb1165..77f3076 100644 (file)
@@ -1,3 +1,15 @@
+2007-12-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=16334
+          <rdar://problem/5634923> REGRESSION (r28299): Homepage of any DotMac Web Gallery won't load completely
+
+        * fast/dynamic/subtree-no-common-root-static-y.html: Added.
+        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.checksum: Added.
+        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png: Added.
+        * platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.txt: Added.
+
 2007-12-07  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin.
diff --git a/LayoutTests/fast/dynamic/subtree-no-common-root-static-y.html b/LayoutTests/fast/dynamic/subtree-no-common-root-static-y.html
new file mode 100644 (file)
index 0000000..4e7e090
--- /dev/null
@@ -0,0 +1,32 @@
+<style>
+    .boundary { overflow: hidden; width: 100px; height: 50px; }
+</style>
+<div>
+    <div class="boundary" style="height: 150px;">
+        <div style="position: relative;">
+            <div style="height: 10px;"></div>
+            <div class="boundary" style="position: absolute;">
+                <div id="first" style="background-color: red; width: 0; height: 50px;">
+                </div>
+            </div>
+            <div class="boundary" style="margin-top: 50px;">
+                <div id="second" style="background-color: red; width: 0; height: 59px;">
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+<script>
+    function test()
+    {
+        var first = document.getElementById("first");
+        var second = document.getElementById("second");
+        first.style.width = "100px";
+        first.style.backgroundColor="green";
+        second.style.width = "100px";
+        second.style.backgroundColor="green";
+    }
+
+    document.body.offsetTop;
+    test();
+</script>
diff --git a/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.checksum b/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.checksum
new file mode 100644 (file)
index 0000000..63921e3
--- /dev/null
@@ -0,0 +1 @@
+a91f108103d18e39f0066a51731205c5
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png b/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png
new file mode 100644 (file)
index 0000000..6b7fa99
Binary files /dev/null and b/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.txt b/LayoutTests/platform/mac/fast/dynamic/subtree-no-common-root-static-y-expected.txt
new file mode 100644 (file)
index 0000000..77dd5a8
--- /dev/null
@@ -0,0 +1,17 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock {DIV} at (0,0) size 784x150
+layer at (8,8) size 100x150
+  RenderBlock {DIV} at (0,0) size 100x150
+layer at (8,8) size 100x110
+  RenderBlock (relative positioned) {DIV} at (0,0) size 100x110
+    RenderBlock {DIV} at (0,0) size 100x10
+layer at (8,68) size 100x50 scrollHeight 59
+  RenderBlock {DIV} at (0,60) size 100x50
+    RenderBlock {DIV} at (0,0) size 100x59 [bgcolor=#008000]
+layer at (8,18) size 100x50
+  RenderBlock (positioned) {DIV} at (0,10) size 100x50
+    RenderBlock {DIV} at (0,0) size 100x50 [bgcolor=#008000]
index 225e185..7965326 100644 (file)
@@ -1,3 +1,18 @@
+2007-12-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Darin Adler.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=16334
+          <rdar://problem/5634923> REGRESSION (r28299): Homepage of any DotMac Web Gallery won't load completely
+
+        Test: fast/dynamic/subtree-no-common-root-static-y.html
+
+        * rendering/RenderObject.cpp:
+        (WebCore::RenderObject::markContainingBlocksForLayout): Changed the call
+        to setChildNeedsLayout() to not mark containing blocks and added a
+        separate call to markContainingBlocksForLayout() that will not schedule
+        a layout if we are already in the middle of scheduleRelayoutOfSubtree().
+
 2007-12-07  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin.
index d190e99..c3ee9d8 100644 (file)
@@ -727,8 +727,13 @@ void RenderObject::markContainingBlocksForLayout(bool scheduleRelayout, RenderOb
 
     while (o) {
         if (!last->isText() && (last->style()->position() == FixedPosition || last->style()->position() == AbsolutePosition)) {
-            if (last->hasStaticY())
-                last->parent()->setChildNeedsLayout(true);
+            if (last->hasStaticY()) {
+                RenderObject* parent = last->parent();
+                if (!parent->normalChildNeedsLayout()) {
+                    parent->setChildNeedsLayout(true, false);
+                    parent->markContainingBlocksForLayout(scheduleRelayout, newRoot);
+                }
+            }
             if (o->m_posChildNeedsLayout)
                 return;
             o->m_posChildNeedsLayout = true;