Commit a1f9ecd3 authored by yurys@chromium.org's avatar yurys@chromium.org

2011-02-01 Yury Semikhatsky <yurys@chromium.org>

        Unreviewed. Rollout r77230 which caused many layout tests
        crashes on Chromium Debug bots.

        Async event handlers should not fire within a modal dialog
        https://bugs.webkit.org/show_bug.cgi?id=53202

        * dom/Document.cpp:
        (WebCore::Document::Document):
        * dom/EventQueue.cpp:
        (WebCore::EventQueue::EventQueue):
        (WebCore::EventQueue::enqueueEvent):
        (WebCore::EventQueue::pendingEventTimerFired):
        * dom/EventQueue.h:
2011-02-01  Yury Semikhatsky  <yurys@chromium.org>

        Unreviewed. Rollout r77230 which caused many layout tests
        crashes on Chromium Debug bots.

        Async event handlers should not fire within a modal dialog
        https://bugs.webkit.org/show_bug.cgi?id=53202

        * fast/events/scroll-event-during-modal-dialog-expected.txt: Removed.
        * fast/events/scroll-event-during-modal-dialog.html: Removed.


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77241 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent fddf5fba
2011-02-01 Yury Semikhatsky <yurys@chromium.org>
Unreviewed. Rollout r77230 which caused many layout tests
crashes on Chromium Debug bots.
Async event handlers should not fire within a modal dialog
https://bugs.webkit.org/show_bug.cgi?id=53202
* fast/events/scroll-event-during-modal-dialog-expected.txt: Removed.
* fast/events/scroll-event-during-modal-dialog.html: Removed.
2011-02-01 Mihai Parparita <mihaip@chromium.org>
Reviewed by James Robinson.
Tests that scroll events are not fired while modal dialogs are displayed.
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
Scrolling window
Showing modal dialog
Returned from modal dialog
Scroll handler fired
PASS successfullyParsed is true
TEST COMPLETE
<html>
<link rel="stylesheet" href="../js/resources/js-test-style.css">
<script src="../js/resources/js-test-pre.js"></script>
<body style="min-height: 2000px">
<p id="description"></p>
<div id="console"></div>
<script type="text/javascript">
description('Tests that scroll events are not fired while modal dialogs are displayed.');
var triggeredCaptureListener = false;
var triggeredBubbleListener = false;
onscroll = function()
{
debug('Scroll handler fired');
finishJSTest();
}
onload = function()
{
debug('Scrolling window');
window.scrollTo(200, 200);
debug('Showing modal dialog');
showModalDialog('resources/scroll-event-modal-dialog.html');
debug('Returned from modal dialog');
}
var successfullyParsed = true;
var jsTestIsAsync = true;
</script>
<script src="../js/resources/js-test-post.js"></script>
</body>
</html>
2011-02-01 Yury Semikhatsky <yurys@chromium.org>
Unreviewed. Rollout r77230 which caused many layout tests
crashes on Chromium Debug bots.
Async event handlers should not fire within a modal dialog
https://bugs.webkit.org/show_bug.cgi?id=53202
* dom/Document.cpp:
(WebCore::Document::Document):
* dom/EventQueue.cpp:
(WebCore::EventQueue::EventQueue):
(WebCore::EventQueue::enqueueEvent):
(WebCore::EventQueue::pendingEventTimerFired):
* dom/EventQueue.h:
2011-02-01 Zoltan Herczeg <zherczeg@webkit.org>
Reviewed by Dirk Schulze.
......@@ -408,7 +408,7 @@ Document::Document(Frame* frame, const KURL& url, bool isXHTML, bool isHTML, con
, m_normalWorldWrapperCache(0)
#endif
, m_usingGeolocation(false)
, m_eventQueue(EventQueue::create(this))
, m_eventQueue(adoptPtr(new EventQueue))
#if ENABLE(WML)
, m_containsWMLContent(false)
#endif
......
......@@ -28,31 +28,14 @@
#include "EventQueue.h"
#include "DOMWindow.h"
#include "Document.h"
#include "Event.h"
#include "EventNames.h"
#include "ScriptExecutionContext.h"
#include "SuspendableTimer.h"
namespace WebCore {
class EventQueueTimer : public SuspendableTimer {
WTF_MAKE_NONCOPYABLE(EventQueueTimer);
public:
EventQueueTimer(EventQueue* eventQueue, ScriptExecutionContext* context)
: SuspendableTimer(context)
, m_eventQueue(eventQueue) { }
private:
virtual void fired() { m_eventQueue->pendingEventTimerFired(); }
EventQueue* m_eventQueue;
};
EventQueue::EventQueue(ScriptExecutionContext* context)
: m_pendingEventTimer(adoptPtr(new EventQueueTimer(this, context)))
{
}
EventQueue::~EventQueue()
EventQueue::EventQueue()
: m_pendingEventTimer(this, &EventQueue::pendingEventTimerFired)
{
}
......@@ -61,8 +44,8 @@ void EventQueue::enqueueEvent(PassRefPtr<Event> event)
ASSERT(event->target()->toNode() || event->target()->toDOMWindow());
m_queuedEvents.append(event);
if (!m_pendingEventTimer->isActive())
m_pendingEventTimer->startOneShot(0);
if (!m_pendingEventTimer.isActive())
m_pendingEventTimer.startOneShot(0);
}
void EventQueue::enqueueScrollEvent(PassRefPtr<Node> target, ScrollEventTargetType targetType)
......@@ -77,9 +60,9 @@ void EventQueue::enqueueScrollEvent(PassRefPtr<Node> target, ScrollEventTargetTy
enqueueEvent(scrollEvent.release());
}
void EventQueue::pendingEventTimerFired()
void EventQueue::pendingEventTimerFired(Timer<EventQueue>*)
{
ASSERT(!m_pendingEventTimer->isActive());
ASSERT(!m_pendingEventTimer.isActive());
Vector<RefPtr<Event> > queuedEvents;
queuedEvents.swap(m_queuedEvents);
......
......@@ -27,51 +27,38 @@
#ifndef EventQueue_h
#define EventQueue_h
#include "Timer.h"
#include <wtf/HashSet.h>
#include <wtf/Noncopyable.h>
#include <wtf/OwnPtr.h>
#include <wtf/PassOwnPtr.h>
#include <wtf/RefPtr.h>
#include <wtf/Vector.h>
namespace WebCore {
class Event;
class EventQueueTimer;
class Node;
class ScriptExecutionContext;
class EventQueue {
WTF_MAKE_NONCOPYABLE(EventQueue);
public:
enum ScrollEventTargetType {
ScrollEventDocumentTarget,
ScrollEventElementTarget
};
static PassOwnPtr<EventQueue> create(ScriptExecutionContext* context)
{
return adoptPtr(new EventQueue(context));
}
~EventQueue();
EventQueue();
void enqueueEvent(PassRefPtr<Event>);
void enqueueScrollEvent(PassRefPtr<Node>, ScrollEventTargetType);
private:
explicit EventQueue(ScriptExecutionContext*);
void pendingEventTimerFired();
void pendingEventTimerFired(Timer<EventQueue>*);
void dispatchEvent(PassRefPtr<Event>);
OwnPtr<EventQueueTimer> m_pendingEventTimer;
Timer<EventQueue> m_pendingEventTimer;
Vector<RefPtr<Event> > m_queuedEvents;
HashSet<Node*> m_nodesWithQueuedScrollEvents;
friend class EventQueueTimer;
};
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment