WebCore:
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2007 20:54:03 +0000 (20:54 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Dec 2007 20:54:03 +0000 (20:54 +0000)
        Reviewed by Eric Seidel.

        - fix http://bugs.webkit.org/show_bug.cgi?id=16490
          ASSERT in ~FrameView while viewing/reloading WICD test case

        Test: fast/dynamic/paused-event-dispatch.html

        * page/FrameView.cpp:
        (WebCore::FrameView::~FrameView):
        (WebCore::FrameView::layout): Changed to always pause event dispatch and
        always resume event dispatch, regardless of whether the post-layout
        task time is active. However, if it is active, assert that event
        dispatch is still paused.

LayoutTests:

        Reviewed by Eric Seidel.

        - test for http://bugs.webkit.org/show_bug.cgi?id=16490
          ASSERT in ~FrameView while viewing/reloading WICD test case

        * fast/dynamic/paused-event-dispatch-expected.txt: Added.
        * fast/dynamic/paused-event-dispatch.html: Added.
        * fast/dynamic/resources/paused-event-dispatch-iframe.html: Added.

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

LayoutTests/ChangeLog
LayoutTests/fast/dynamic/paused-event-dispatch-expected.txt [new file with mode: 0644]
LayoutTests/fast/dynamic/paused-event-dispatch.html [new file with mode: 0644]
LayoutTests/fast/dynamic/resources/paused-event-dispatch-iframe.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/page/FrameView.cpp

index 1dd1ab920f013f799c6ec2a63fa65b0cf071eada..aa329ac9fc1d846041690c0f1001330c50cd7905 100644 (file)
@@ -1,3 +1,14 @@
+2007-12-27  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Eric Seidel.
+
+        - test for http://bugs.webkit.org/show_bug.cgi?id=16490
+          ASSERT in ~FrameView while viewing/reloading WICD test case
+
+        * fast/dynamic/paused-event-dispatch-expected.txt: Added.
+        * fast/dynamic/paused-event-dispatch.html: Added.
+        * fast/dynamic/resources/paused-event-dispatch-iframe.html: Added.
+
 2007-12-27  Sam Weinig  <sam@webkit.org>
 
         Reviewed by Maciej.
diff --git a/LayoutTests/fast/dynamic/paused-event-dispatch-expected.txt b/LayoutTests/fast/dynamic/paused-event-dispatch-expected.txt
new file mode 100644 (file)
index 0000000..2a1e307
--- /dev/null
@@ -0,0 +1,5 @@
+Test for http://bugs.webkit.org/show_bug.cgi?id=16490 ASSERT in ~FrameView while viewing/reloading WICD test case.
+
+
+PASS
+
diff --git a/LayoutTests/fast/dynamic/paused-event-dispatch.html b/LayoutTests/fast/dynamic/paused-event-dispatch.html
new file mode 100644 (file)
index 0000000..56055f5
--- /dev/null
@@ -0,0 +1,43 @@
+<p>
+    Test for <i><a href="http://bugs.webkit.org/show_bug.cgi?id=16490">http://bugs.webkit.org/show_bug.cgi?id=16490</a>
+    ASSERT in ~FrameView while viewing/reloading WICD test case</i>.
+</p>
+<div>
+    <iframe onload="test()" style="width: 100%;" src="resources/paused-event-dispatch-iframe.html"></iframe>
+</div>
+<div id="bottomBox" style="position: absolute; left: 0; top: 5000px; height: 10px; width: 10px;"></div>
+<div style="height: 100px; width: 100px; overflow: auto;" id="overflow">
+    <div style="height: 200px;" id="tallBox"></div>
+</div>
+<div id="result">FAIL</div>
+<script>
+    function overflowChanged()
+    {
+        document.getElementById("result").innerText = "PASS";
+    }
+
+    function test()
+    {
+        document.body.offsetTop;
+        var bottomBox = document.getElementById("bottomBox");
+        bottomBox.parentNode.removeChild(bottomBox);
+        document.addEventListener("overflowchanged", overflowChanged, true, true);
+    }
+
+    function iframeResized()
+    {
+        document.body.appendChild(document.createElement("div"));
+        if (window.layoutTestController) {
+            layoutTestController.waitUntilDone();
+            layoutTestController.dumpAsText();
+        }
+        setTimeout(finish, 0);
+    }
+
+    function finish()
+    {
+        document.getElementById("tallBox").style.height = "50px";
+        if (window.layoutTestController)
+            layoutTestController.notifyDone();
+    }
+</script>
diff --git a/LayoutTests/fast/dynamic/resources/paused-event-dispatch-iframe.html b/LayoutTests/fast/dynamic/resources/paused-event-dispatch-iframe.html
new file mode 100644 (file)
index 0000000..ef29d9f
--- /dev/null
@@ -0,0 +1,2 @@
+<body onresize="parent.iframeResized()">
+</body>
index 6d958a9d4845321afe7c3ebb283b2afb129c21fc..a0be36c87521dba55536efd0299d573390293b6e 100644 (file)
@@ -1,3 +1,19 @@
+2007-12-27  Dan Bernstein  <mitz@apple.com>
+
+        Reviewed by Eric Seidel.
+
+        - fix http://bugs.webkit.org/show_bug.cgi?id=16490
+          ASSERT in ~FrameView while viewing/reloading WICD test case
+
+        Test: fast/dynamic/paused-event-dispatch.html
+
+        * page/FrameView.cpp:
+        (WebCore::FrameView::~FrameView):
+        (WebCore::FrameView::layout): Changed to always pause event dispatch and
+        always resume event dispatch, regardless of whether the post-layout
+        task time is active. However, if it is active, assert that event
+        dispatch is still paused.
+
 2007-12-27  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Maciej.
index d79ebe0463b887171fe181cfb7da4f6056594958..5b36a62d948e724484815371f602471f67f456d0 100644 (file)
@@ -155,7 +155,8 @@ FrameView::~FrameView()
     resetScrollbars();
 
     ASSERT(m_refCount == 0);
-    ASSERT(d->m_scheduledEvents.isEmpty() && !d->m_enqueueEvents);
+    ASSERT(d->m_scheduledEvents.isEmpty());
+    ASSERT(!d->m_enqueueEvents);
 
     if (m_frame) {
         ASSERT(m_frame->view() != this || !m_frame->document() || !m_frame->document()->renderer());
@@ -444,8 +445,7 @@ void FrameView::layout(bool allowSubtree)
     
     RenderLayer* layer = root->enclosingLayer();
 
-    if (!d->postLayoutTasksTimer.isActive())
-        pauseScheduledEvents();
+    pauseScheduledEvents();
 
     if (subtree)
         root->view()->pushLayoutState(root);
@@ -504,6 +504,9 @@ void FrameView::layout(bool allowSubtree)
             pauseScheduledEvents();
             layout();
         }
+    } else {
+        resumeScheduledEvents();
+        ASSERT(d->m_enqueueEvents);
     }
 
     d->nestedLayoutCount--;