Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(822)

Unified Diff: Source/core/events/EventPath.h

Issue 108723007: Introduce TreeScopeEventContext (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rename SharedEventContext to TreeScopeEventContext Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/events/EventDispatcher.cpp ('k') | Source/core/events/EventPath.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/events/EventPath.h
diff --git a/Source/core/events/EventPath.h b/Source/core/events/EventPath.h
index e5db6c4caf156a57247f8b1f543db7c3659baf18..a1d3fe8c3a34bbd842735d221a94973f2c34a62f 100644
--- a/Source/core/events/EventPath.h
+++ b/Source/core/events/EventPath.h
@@ -29,7 +29,7 @@
#include "core/events/EventContext.h"
-#include "wtf/OwnPtr.h"
+#include "wtf/HashMap.h"
#include "wtf/Vector.h"
namespace WebCore {
@@ -37,6 +37,9 @@ namespace WebCore {
class Event;
class EventTarget;
class Node;
+class TouchEvent;
+class TouchList;
+class TreeScope;
enum EventDispatchBehavior {
RetargetEvent,
@@ -56,7 +59,8 @@ public:
bool isEmpty() const { return m_eventContexts.isEmpty(); }
size_t size() const { return m_eventContexts.size(); }
- void shrink(size_t newSize) { m_eventContexts.shrink(newSize); }
+ void adjustForRelatedTarget(Node*, EventTarget* relatedTarget);
+ void adjustForTouchEvent(Node*, TouchEvent&);
static Node* parent(Node*);
static EventTarget* eventTargetRespectingTargetRules(Node*);
@@ -70,11 +74,26 @@ private:
void calculatePath();
void calculateAdjustedTargets();
- void calculateAdjustedEventPathForEachNode();
+ void calculateAdjustedEventPath();
+
+ void shrink(size_t newSize) { m_eventContexts.shrink(newSize); }
+ void shrinkIfNeeded(const Node* target, const EventTarget* relatedTarget);
+
+ void adjustTouchList(const Node*, const TouchList*, Vector<TouchList*> adjustedTouchList, const Vector<TreeScope*>& treeScopes);
+
+ typedef HashMap<TreeScope*, EventTarget*> RelatedTargetMap;
+
+ static void buildRelatedNodeMap(const Node*, RelatedTargetMap&);
+ static EventTarget* findRelatedNode(TreeScope*, RelatedTargetMap&);
+
+#ifndef NDEBUG
+ static void checkReachability(TreeScope&, TouchList&);
+#endif
Vector<EventContext, 64> m_eventContexts;
Node* m_node;
Event* m_event;
+ Vector<RefPtr<TreeScopeEventContext> > m_sharedEventContexts;
};
} // namespace
« no previous file with comments | « Source/core/events/EventDispatcher.cpp ('k') | Source/core/events/EventPath.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698