Title: [94088] trunk/Source/WebCore
Revision
94088
Author
[email protected]
Date
2011-08-30 10:35:52 -0700 (Tue, 30 Aug 2011)

Log Message

REGRESSION (r93913): Failures in fast/replaced/frame-removed-during-resize.html and scrollbars/scrollable-iframe-remove-crash.html
https://bugs.webkit.org/show_bug.cgi?id=67074

Reviewed by Darin Adler.

Added flag m_isClosed to prevent events that cause Frame to be destroyed
from posting more events into EventQueue of a dying Document.

The tests mentioned above should now pass.

* dom/Document.cpp:
(WebCore::Document::detach):
* dom/EventQueue.cpp:
(WebCore::EventQueue::EventQueue):
(WebCore::EventQueue::enqueueEvent):
(WebCore::EventQueue::close): Renamed method to reflect better what it does.
* dom/EventQueue.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (94087 => 94088)


--- trunk/Source/WebCore/ChangeLog	2011-08-30 17:34:05 UTC (rev 94087)
+++ trunk/Source/WebCore/ChangeLog	2011-08-30 17:35:52 UTC (rev 94088)
@@ -1,3 +1,23 @@
+2011-08-30  Dmitry Titov  <[email protected]>
+
+        REGRESSION (r93913): Failures in fast/replaced/frame-removed-during-resize.html and scrollbars/scrollable-iframe-remove-crash.html
+        https://bugs.webkit.org/show_bug.cgi?id=67074
+
+        Reviewed by Darin Adler.
+
+        Added flag m_isClosed to prevent events that cause Frame to be destroyed
+        from posting more events into EventQueue of a dying Document.
+
+        The tests mentioned above should now pass.
+
+        * dom/Document.cpp:
+        (WebCore::Document::detach):
+        * dom/EventQueue.cpp:
+        (WebCore::EventQueue::EventQueue):
+        (WebCore::EventQueue::enqueueEvent):
+        (WebCore::EventQueue::close): Renamed method to reflect better what it does.
+        * dom/EventQueue.h:
+
 2011-08-30  Tony Chang  <[email protected]>
 
         Fix compile warning on clang:

Modified: trunk/Source/WebCore/dom/Document.cpp (94087 => 94088)


--- trunk/Source/WebCore/dom/Document.cpp	2011-08-30 17:34:05 UTC (rev 94087)
+++ trunk/Source/WebCore/dom/Document.cpp	2011-08-30 17:35:52 UTC (rev 94088)
@@ -1776,7 +1776,7 @@
 
     clearAXObjectCache();
     stopActiveDOMObjects();
-    m_eventQueue->cancelQueuedEvents();
+    m_eventQueue->close();
 
 #if ENABLE(REQUEST_ANIMATION_FRAME)
     // FIXME: consider using ActiveDOMObject.

Modified: trunk/Source/WebCore/dom/EventQueue.cpp (94087 => 94088)


--- trunk/Source/WebCore/dom/EventQueue.cpp	2011-08-30 17:34:05 UTC (rev 94087)
+++ trunk/Source/WebCore/dom/EventQueue.cpp	2011-08-30 17:35:52 UTC (rev 94088)
@@ -62,6 +62,7 @@
 
 EventQueue::EventQueue(ScriptExecutionContext* context)
     : m_pendingEventTimer(adoptPtr(new EventQueueTimer(this, context)))
+    , m_isClosed(false)
 {
 }
 
@@ -71,6 +72,9 @@
 
 void EventQueue::enqueueEvent(PassRefPtr<Event> event)
 {
+    if (m_isClosed)
+        return;
+
     ASSERT(event->target());
     bool wasAdded = m_queuedEvents.add(event).second;
     ASSERT_UNUSED(wasAdded, wasAdded); // It should not have already been in the list.
@@ -109,8 +113,9 @@
     return found;
 }
 
-void EventQueue::cancelQueuedEvents()
+void EventQueue::close()
 {
+    m_isClosed = true;
     m_pendingEventTimer->stop();
     m_queuedEvents.clear();
 }

Modified: trunk/Source/WebCore/dom/EventQueue.h (94087 => 94088)


--- trunk/Source/WebCore/dom/EventQueue.h	2011-08-30 17:34:05 UTC (rev 94087)
+++ trunk/Source/WebCore/dom/EventQueue.h	2011-08-30 17:35:52 UTC (rev 94088)
@@ -53,8 +53,10 @@
     void enqueueEvent(PassRefPtr<Event>);
     void enqueueOrDispatchScrollEvent(PassRefPtr<Node>, ScrollEventTargetType);
     bool cancelEvent(Event*);
-    void cancelQueuedEvents();
 
+    // The accumulated and all the future events will be discarded, no events will be dispatched anymore. 
+    void close();
+
 private:
     explicit EventQueue(ScriptExecutionContext*);
 
@@ -64,7 +66,8 @@
     OwnPtr<EventQueueTimer> m_pendingEventTimer;
     ListHashSet<RefPtr<Event> > m_queuedEvents;
     HashSet<Node*> m_nodesWithQueuedScrollEvents;
-    
+    bool m_isClosed;
+
     friend class EventQueueTimer;    
 };
 
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to