OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All Rights Reserved. | 2 * Copyright (C) 2010 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 | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 bool isUnreachableNode(EventTarget*); | 81 bool isUnreachableNode(EventTarget*); |
82 #endif | 82 #endif |
83 | 83 |
84 TreeScope& m_treeScope; | 84 TreeScope& m_treeScope; |
85 RefPtr<EventTarget> m_target; | 85 RefPtr<EventTarget> m_target; |
86 RefPtr<EventTarget> m_relatedTarget; | 86 RefPtr<EventTarget> m_relatedTarget; |
87 RefPtr<NodeList> m_eventPath; | 87 RefPtr<NodeList> m_eventPath; |
88 RefPtr<TouchEventContext> m_touchEventContext; | 88 RefPtr<TouchEventContext> m_touchEventContext; |
89 }; | 89 }; |
90 | 90 |
91 class EventContext { | 91 class NodeEventContext { |
92 public: | 92 public: |
93 // FIXME: Use ContainerNode instead of Node. | 93 // FIXME: Use ContainerNode instead of Node. |
94 EventContext(PassRefPtr<Node>, PassRefPtr<EventTarget> currentTarget); | 94 NodeEventContext(PassRefPtr<Node>, PassRefPtr<EventTarget> currentTarget); |
95 ~EventContext(); | 95 ~NodeEventContext(); |
96 | 96 |
97 Node* node() const { return m_node.get(); } | 97 Node* node() const { return m_node.get(); } |
98 EventTarget* currentTarget() const { return m_currentTarget.get(); } | 98 EventTarget* currentTarget() const { return m_currentTarget.get(); } |
99 | 99 |
100 TreeScopeEventContext* treeScopeEventContext() const { return m_treeScopeEve
ntContext.get(); } | 100 TreeScopeEventContext* treeScopeEventContext() const { return m_treeScopeEve
ntContext.get(); } |
101 void setTreeScopeEventContext(PassRefPtr<TreeScopeEventContext> prpTreeScope
EventContext) { m_treeScopeEventContext = prpTreeScopeEventContext; } | 101 void setTreeScopeEventContext(PassRefPtr<TreeScopeEventContext> prpTreeScope
EventContext) { m_treeScopeEventContext = prpTreeScopeEventContext; } |
102 | 102 |
103 EventTarget* target() const { return m_treeScopeEventContext->target(); } | 103 EventTarget* target() const { return m_treeScopeEventContext->target(); } |
104 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related
Target(); } | 104 EventTarget* relatedTarget() const { return m_treeScopeEventContext->related
Target(); } |
105 TouchEventContext* touchEventContext() const { return m_treeScopeEventContex
t->touchEventContext(); } | 105 TouchEventContext* touchEventContext() const { return m_treeScopeEventContex
t->touchEventContext(); } |
(...skipping 24 matching lines...) Expand all Loading... |
130 | 130 |
131 inline void TreeScopeEventContext::setRelatedTarget(PassRefPtr<EventTarget> rela
tedTarget) | 131 inline void TreeScopeEventContext::setRelatedTarget(PassRefPtr<EventTarget> rela
tedTarget) |
132 { | 132 { |
133 ASSERT(!isUnreachableNode(relatedTarget.get())); | 133 ASSERT(!isUnreachableNode(relatedTarget.get())); |
134 m_relatedTarget = relatedTarget; | 134 m_relatedTarget = relatedTarget; |
135 } | 135 } |
136 | 136 |
137 } | 137 } |
138 | 138 |
139 #endif // EventContext_h | 139 #endif // EventContext_h |
OLD | NEW |