WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2008 20:44:42 +0000 (20:44 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 7 May 2008 20:44:42 +0000 (20:44 +0000)
        Reviewed by John Sullivan.

        - fix https://bugs.webkit.org/show_bug.cgi?id=18909
          <rdar://problem/5914165> REGRESSION (r31872-r31878): Viewed photos not closing completely at indycar.com

        Test: fast/dynamic/positioned-movement-with-positioned-children.html

        * rendering/RenderBlock.cpp:
        (WebCore::RenderBlock::layoutOnlyPositionedObjects): Cover the case of
        a positioned object that has only moved and has only positioned children
        that have changed.
        * rendering/RenderObject.h:
        (WebCore::RenderObject::needsPositionedMovementLayout): Added this
        accessor.

LayoutTests:

        Reviewed by John Sullivan.

        - test for https://bugs.webkit.org/show_bug.cgi?id=18909
          <rdar://problem/5914165> REGRESSION (r31872-r31878): Viewed photos not closing completely at indycar.com

        * fast/dynamic/positioned-movement-with-positioned-children.html: Added.
        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.checksum: Added.
        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png: Added.
        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.txt: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/dynamic/positioned-movement-with-positioned-children.html [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.checksum [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png [new file with mode: 0644]
LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.txt [new file with mode: 0644]
WebCore/ChangeLog
WebCore/rendering/RenderBlock.cpp
WebCore/rendering/RenderObject.h

index ca1b8ed..e9cb4bc 100644 (file)
@@ -1,3 +1,15 @@
+2008-05-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - test for https://bugs.webkit.org/show_bug.cgi?id=18909
+          <rdar://problem/5914165> REGRESSION (r31872-r31878): Viewed photos not closing completely at indycar.com
+
+        * fast/dynamic/positioned-movement-with-positioned-children.html: Added.
+        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.checksum: Added.
+        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png: Added.
+        * platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.txt: Added.
+
 2008-05-07  Justin Garcia  <justin.garcia@apple.com>
 
         Reviewed by John Sullivan.
diff --git a/LayoutTests/fast/dynamic/positioned-movement-with-positioned-children.html b/LayoutTests/fast/dynamic/positioned-movement-with-positioned-children.html
new file mode 100644 (file)
index 0000000..e2f6953
--- /dev/null
@@ -0,0 +1,19 @@
+<body>
+    <div style="background-color: red; width: 100px; height: 100px;">You should not see this. Resize the window.</div>
+    <div id="target" style="position: absolute; left: 8; top: 108px;">
+        <div style="position: absolute; left: 0; top: 0;">
+            <div style="visibility: visible; width: 100px; height: 100px; background-color: green;"></div>
+            <button>Button</button>
+        </div>
+    </div>
+    <script>
+        function test()
+        {
+            document.body.offsetTop;
+            var t = document.getElementById("target");
+            t.style.visibility = "hidden";
+            t.style.top = "8";
+        }
+        test();
+    </script>
+</body>
diff --git a/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.checksum b/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.checksum
new file mode 100644 (file)
index 0000000..1b607c4
--- /dev/null
@@ -0,0 +1 @@
+ac9aef7f008f821d55bbfb576b7c98ce
\ No newline at end of file
diff --git a/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png b/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png
new file mode 100644 (file)
index 0000000..a4b5b93
Binary files /dev/null and b/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.png differ
diff --git a/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.txt b/LayoutTests/platform/mac/fast/dynamic/positioned-movement-with-positioned-children-expected.txt
new file mode 100644 (file)
index 0000000..27f1a50
--- /dev/null
@@ -0,0 +1,19 @@
+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 100x100 [bgcolor=#FF0000]
+        RenderText {#text} at (0,0) size 98x54
+          text run at (0,0) width 98: "You should not"
+          text run at (0,18) width 96: "see this. Resize"
+          text run at (0,36) width 79: "the window."
+layer at (8,8) size 100x122
+  RenderBlock (positioned) {DIV} at (0,0) size 100x122
+    RenderBlock {DIV} at (0,0) size 100x100 [bgcolor=#008000]
+    RenderBlock (anonymous) at (0,100) size 100x22
+      RenderButton {BUTTON} at (2,2) size 51x18 [bgcolor=#C0C0C0] [border: (2px outset #C0C0C0) none (2px outset #C0C0C0)]
+        RenderBlock (anonymous) at (8,2) size 35x13
+          RenderText {#text} at (0,0) size 35x13
+            text run at (0,0) width 35: "Button"
+      RenderText {#text} at (0,0) size 0x0
index 6093948..25725a7 100644 (file)
@@ -1,3 +1,20 @@
+2008-05-07  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by John Sullivan.
+
+        - fix https://bugs.webkit.org/show_bug.cgi?id=18909
+          <rdar://problem/5914165> REGRESSION (r31872-r31878): Viewed photos not closing completely at indycar.com
+
+        Test: fast/dynamic/positioned-movement-with-positioned-children.html
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::layoutOnlyPositionedObjects): Cover the case of
+        a positioned object that has only moved and has only positioned children
+        that have changed.
+        * rendering/RenderObject.h:
+        (WebCore::RenderObject::needsPositionedMovementLayout): Added this
+        accessor.
+
 2008-05-07  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by John.
index f4471cc..8e6c929 100644 (file)
@@ -1330,6 +1330,11 @@ bool RenderBlock::layoutOnlyPositionedObjects()
     else
         view()->disableLayoutState();
 
+    if (needsPositionedMovementLayout()) {
+        calcWidth();
+        calcHeight();
+    }
+
     // All we have to is lay out our positioned objects.
     layoutPositionedObjects(false);
 
index cb99998..9f8834b 100644 (file)
@@ -344,6 +344,7 @@ public:
                                                               
     bool needsLayout() const { return m_needsLayout || m_normalChildNeedsLayout || m_posChildNeedsLayout || m_needsPositionedMovementLayout; }
     bool selfNeedsLayout() const { return m_needsLayout; }
+    bool needsPositionedMovementLayout() const { return m_needsPositionedMovementLayout; }
     bool needsPositionedMovementLayoutOnly() const { return m_needsPositionedMovementLayout && !m_needsLayout && !m_normalChildNeedsLayout && !m_posChildNeedsLayout; }
     bool posChildNeedsLayout() const { return m_posChildNeedsLayout; }
     bool normalChildNeedsLayout() const { return m_normalChildNeedsLayout; }