diff options
author | Allan Sandfeld Jensen <allan.jensen@digia.com> | 2013-09-13 12:51:20 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-09-19 20:50:05 +0200 |
commit | d441d6f39bb846989d95bcf5caf387b42414718d (patch) | |
tree | e367e64a75991c554930278175d403c072de6bb8 /Source/WebCore/dom/EventDispatcher.h | |
parent | 0060b2994c07842f4c59de64b5e3e430525c4b90 (diff) |
Import Qt5x2 branch of QtWebkit for Qt 5.2
Importing a new snapshot of webkit.
Change-Id: I2d01ad12cdc8af8cb015387641120a9d7ea5f10c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'Source/WebCore/dom/EventDispatcher.h')
-rw-r--r-- | Source/WebCore/dom/EventDispatcher.h | 57 |
1 files changed, 16 insertions, 41 deletions
diff --git a/Source/WebCore/dom/EventDispatcher.h b/Source/WebCore/dom/EventDispatcher.h index c8585097a..9c6982c64 100644 --- a/Source/WebCore/dom/EventDispatcher.h +++ b/Source/WebCore/dom/EventDispatcher.h @@ -2,7 +2,7 @@ * Copyright (C) 1999 Lars Knoll (knoll@kde.org) * (C) 1999 Antti Koivisto (koivisto@kde.org) * (C) 2001 Dirk Mueller (mueller@kde.org) - * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserved. + * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved. * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/) * Copyright (C) 2011 Google Inc. All rights reserved. @@ -26,15 +26,16 @@ #ifndef EventDispatcher_h #define EventDispatcher_h +#include "EventContext.h" #include "SimulatedClickOptions.h" #include <wtf/Forward.h> #include <wtf/HashMap.h> +#include <wtf/PassRefPtr.h> #include <wtf/Vector.h> namespace WebCore { class Event; -class EventContext; class EventDispatchMediator; class EventTarget; class FrameView; @@ -45,68 +46,42 @@ class ShadowRoot; class TreeScope; class WindowEventContext; -enum EventDispatchBehavior { - RetargetEvent, - StayInsideShadowDOM -}; - enum EventDispatchContinuation { ContinueDispatching, DoneDispatching }; -class EventRelatedTargetAdjuster { -public: - EventRelatedTargetAdjuster(PassRefPtr<Node>, PassRefPtr<Node> relatedTarget); - void adjust(Vector<EventContext>&); -private: - typedef HashMap<TreeScope*, EventTarget*> RelatedTargetMap; - EventTarget* findRelatedTarget(TreeScope*); - - RefPtr<Node> m_node; - RefPtr<Node> m_relatedTarget; - RelatedTargetMap m_relatedTargetMap; -}; - class EventDispatcher { public: static bool dispatchEvent(Node*, PassRefPtr<EventDispatchMediator>); static void dispatchScopedEvent(Node*, PassRefPtr<EventDispatchMediator>); - static void dispatchSimulatedClick(Node*, Event* underlyingEvent, SimulatedClickMouseEventOptions, SimulatedClickVisualOptions); + static void dispatchSimulatedClick(Element*, Event* underlyingEvent, SimulatedClickMouseEventOptions, SimulatedClickVisualOptions); - bool dispatchEvent(PassRefPtr<Event>); - void adjustRelatedTarget(Event*, PassRefPtr<EventTarget> prpRelatedTarget); - Node* node() const; + bool dispatch(); + Node* node() const { return m_node.get(); } + Event* event() const { return m_event.get(); } + EventPath& eventPath() { return m_eventPath; } private: - EventDispatcher(Node*); - - EventDispatchBehavior determineDispatchBehavior(Event*, ShadowRoot*, EventTarget*); - - void ensureEventAncestors(Event*); + EventDispatcher(Node*, PassRefPtr<Event>); const EventContext* topEventContext(); - EventDispatchContinuation dispatchEventPreProcess(PassRefPtr<Event>, void*& preDispatchEventHandlerResult); - EventDispatchContinuation dispatchEventAtCapturing(PassRefPtr<Event>, WindowEventContext&); - EventDispatchContinuation dispatchEventAtTarget(PassRefPtr<Event>); - EventDispatchContinuation dispatchEventAtBubbling(PassRefPtr<Event>, WindowEventContext&); - void dispatchEventPostProcess(PassRefPtr<Event>, void* preDispatchEventHandlerResult); + EventDispatchContinuation dispatchEventPreProcess(void*& preDispatchEventHandlerResult); + EventDispatchContinuation dispatchEventAtCapturing(WindowEventContext&); + EventDispatchContinuation dispatchEventAtTarget(); + void dispatchEventAtBubbling(WindowEventContext&); + void dispatchEventPostProcess(void* preDispatchEventHandlerResult); - Vector<EventContext> m_ancestors; + EventPath m_eventPath; RefPtr<Node> m_node; + RefPtr<Event> m_event; RefPtr<FrameView> m_view; - bool m_ancestorsInitialized; #ifndef NDEBUG bool m_eventDispatched; #endif }; -inline Node* EventDispatcher::node() const -{ - return m_node.get(); -} - } #endif |