| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2013 Google Inc. All rights reserved. | 2 * Copyright (C) 2013 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Neither the name of Google Inc. nor the names of its | 10 * * Neither the name of Google Inc. nor the names of its |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 namespace blink { | 38 namespace blink { |
| 39 | 39 |
| 40 class Event; | 40 class Event; |
| 41 class EventTarget; | 41 class EventTarget; |
| 42 class Node; | 42 class Node; |
| 43 class TouchEvent; | 43 class TouchEvent; |
| 44 class TouchList; | 44 class TouchList; |
| 45 class TreeScope; | 45 class TreeScope; |
| 46 | 46 |
| 47 class CORE_EXPORT EventPath final : public NoBaseWillBeGarbageCollectedFinalized
<EventPath> { | 47 class CORE_EXPORT EventPath final : public GarbageCollectedFinalized<EventPath>
{ |
| 48 USING_FAST_MALLOC_WILL_BE_REMOVED(EventPath); | |
| 49 WTF_MAKE_NONCOPYABLE(EventPath); | 48 WTF_MAKE_NONCOPYABLE(EventPath); |
| 50 public: | 49 public: |
| 51 explicit EventPath(Node&, Event* = nullptr); | 50 explicit EventPath(Node&, Event* = nullptr); |
| 52 | 51 |
| 53 void initializeWith(Node&, Event*); | 52 void initializeWith(Node&, Event*); |
| 54 | 53 |
| 55 NodeEventContext& operator[](size_t index) { return m_nodeEventContexts[inde
x]; } | 54 NodeEventContext& operator[](size_t index) { return m_nodeEventContexts[inde
x]; } |
| 56 const NodeEventContext& operator[](size_t index) const { return m_nodeEventC
ontexts[index]; } | 55 const NodeEventContext& operator[](size_t index) const { return m_nodeEventC
ontexts[index]; } |
| 57 NodeEventContext& at(size_t index) { return m_nodeEventContexts[index]; } | 56 NodeEventContext& at(size_t index) { return m_nodeEventContexts[index]; } |
| 58 NodeEventContext& last() { return m_nodeEventContexts[size() - 1]; } | 57 NodeEventContext& last() { return m_nodeEventContexts[size() - 1]; } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 79 EventPath(); | 78 EventPath(); |
| 80 | 79 |
| 81 void initialize(); | 80 void initialize(); |
| 82 void calculatePath(); | 81 void calculatePath(); |
| 83 void calculateAdjustedTargets(); | 82 void calculateAdjustedTargets(); |
| 84 void calculateTreeOrderAndSetNearestAncestorClosedTree(); | 83 void calculateTreeOrderAndSetNearestAncestorClosedTree(); |
| 85 | 84 |
| 86 void shrink(size_t newSize) { ASSERT(!m_windowEventContext); m_nodeEventCont
exts.shrink(newSize); } | 85 void shrink(size_t newSize) { ASSERT(!m_windowEventContext); m_nodeEventCont
exts.shrink(newSize); } |
| 87 void shrinkIfNeeded(const Node& target, const EventTarget& relatedTarget); | 86 void shrinkIfNeeded(const Node& target, const EventTarget& relatedTarget); |
| 88 | 87 |
| 89 void adjustTouchList(const TouchList*, WillBeHeapVector<RawPtrWillBeMember<T
ouchList>> adjustedTouchList, const WillBeHeapVector<RawPtrWillBeMember<TreeScop
e>>& treeScopes); | 88 void adjustTouchList(const TouchList*, HeapVector<Member<TouchList>> adjuste
dTouchList, const HeapVector<Member<TreeScope>>& treeScopes); |
| 90 | 89 |
| 91 using TreeScopeEventContextMap = WillBeHeapHashMap<RawPtrWillBeMember<TreeSc
ope>, RefPtrWillBeMember<TreeScopeEventContext>>; | 90 using TreeScopeEventContextMap = HeapHashMap<Member<TreeScope>, Member<TreeS
copeEventContext>>; |
| 92 TreeScopeEventContext* ensureTreeScopeEventContext(Node* currentTarget, Tree
Scope*, TreeScopeEventContextMap&); | 91 TreeScopeEventContext* ensureTreeScopeEventContext(Node* currentTarget, Tree
Scope*, TreeScopeEventContextMap&); |
| 93 | 92 |
| 94 using RelatedTargetMap = WillBeHeapHashMap<RawPtrWillBeMember<TreeScope>, Ra
wPtrWillBeMember<EventTarget>>; | 93 using RelatedTargetMap = HeapHashMap<Member<TreeScope>, Member<EventTarget>>
; |
| 95 | 94 |
| 96 static void buildRelatedNodeMap(const Node&, RelatedTargetMap&); | 95 static void buildRelatedNodeMap(const Node&, RelatedTargetMap&); |
| 97 static EventTarget* findRelatedNode(TreeScope&, RelatedTargetMap&); | 96 static EventTarget* findRelatedNode(TreeScope&, RelatedTargetMap&); |
| 98 | 97 |
| 99 #if ENABLE(ASSERT) | 98 #if ENABLE(ASSERT) |
| 100 static void checkReachability(TreeScope&, TouchList&); | 99 static void checkReachability(TreeScope&, TouchList&); |
| 101 #endif | 100 #endif |
| 102 | 101 |
| 103 const NodeEventContext& topNodeEventContext(); | 102 const NodeEventContext& topNodeEventContext(); |
| 104 | 103 |
| 105 WillBeHeapVector<NodeEventContext> m_nodeEventContexts; | 104 HeapVector<NodeEventContext> m_nodeEventContexts; |
| 106 RawPtrWillBeMember<Node> m_node; | 105 Member<Node> m_node; |
| 107 RawPtrWillBeMember<Event> m_event; | 106 Member<Event> m_event; |
| 108 WillBeHeapVector<RefPtrWillBeMember<TreeScopeEventContext>> m_treeScopeEvent
Contexts; | 107 HeapVector<Member<TreeScopeEventContext>> m_treeScopeEventContexts; |
| 109 OwnPtrWillBeMember<WindowEventContext> m_windowEventContext; | 108 Member<WindowEventContext> m_windowEventContext; |
| 110 }; | 109 }; |
| 111 | 110 |
| 112 } // namespace blink | 111 } // namespace blink |
| 113 | 112 |
| 114 #endif | 113 #endif |
| OLD | NEW |