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

Side by Side Diff: Source/core/dom/EventContext.cpp

Issue 15063004: Make Event.path() return a pre-calculated NodeList rather than calculating it dynamically. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Add an include. Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/EventContext.h ('k') | Source/core/dom/EventRetargeter.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 14 matching lines...) Expand all
25 */ 25 */
26 26
27 #include "config.h" 27 #include "config.h"
28 #include "core/dom/EventContext.h" 28 #include "core/dom/EventContext.h"
29 29
30 #include "core/dom/Document.h" 30 #include "core/dom/Document.h"
31 #include "core/dom/Event.h" 31 #include "core/dom/Event.h"
32 #include "core/dom/FocusEvent.h" 32 #include "core/dom/FocusEvent.h"
33 #include "core/dom/MouseEvent.h" 33 #include "core/dom/MouseEvent.h"
34 #include "core/dom/Node.h" 34 #include "core/dom/Node.h"
35 #include "core/dom/StaticNodeList.h"
35 #include "core/dom/TouchEvent.h" 36 #include "core/dom/TouchEvent.h"
36 #include "core/dom/TouchList.h" 37 #include "core/dom/TouchList.h"
37 #include "core/page/DOMWindow.h" 38 #include "core/page/DOMWindow.h"
38 39
39 namespace WebCore { 40 namespace WebCore {
40 41
41 EventContext::EventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> curren tTarget, PassRefPtr<EventTarget> target) 42 EventContext::EventContext(PassRefPtr<Node> node, PassRefPtr<EventTarget> curren tTarget, PassRefPtr<EventTarget> target)
42 : m_node(node) 43 : m_node(node)
43 , m_currentTarget(currentTarget) 44 , m_currentTarget(currentTarget)
44 , m_target(target) 45 , m_target(target)
45 { 46 {
46 ASSERT(m_node); 47 ASSERT(m_node);
47 ASSERT(!isUnreachableNode(m_target.get())); 48 ASSERT(!isUnreachableNode(m_target.get()));
48 } 49 }
49 50
50 EventContext::~EventContext() 51 EventContext::~EventContext()
51 { 52 {
52 } 53 }
53 54
55 void EventContext::adoptEventPath(Vector<RefPtr<Node> >& nodes)
56 {
57 m_eventPath = StaticNodeList::adopt(nodes);
58 }
59
54 void EventContext::handleLocalEvents(Event* event) const 60 void EventContext::handleLocalEvents(Event* event) const
55 { 61 {
56 event->setTarget(m_target.get()); 62 event->setTarget(m_target.get());
57 event->setCurrentTarget(m_currentTarget.get()); 63 event->setCurrentTarget(m_currentTarget.get());
58 m_node->handleLocalEvents(event); 64 m_node->handleLocalEvents(event);
59 } 65 }
60 66
61 bool EventContext::isMouseOrFocusEventContext() const 67 bool EventContext::isMouseOrFocusEventContext() const
62 { 68 {
63 return false; 69 return false;
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 133
128 #ifndef NDEBUG 134 #ifndef NDEBUG
129 void TouchEventContext::checkReachability(TouchList* touchList) const 135 void TouchEventContext::checkReachability(TouchList* touchList) const
130 { 136 {
131 for (size_t i = 0; i < touchList->length(); ++i) 137 for (size_t i = 0; i < touchList->length(); ++i)
132 ASSERT(touchList->item(i)->target()->toNode()->treeScope()->isInclusiveA ncestorOf(m_node->treeScope())); 138 ASSERT(touchList->item(i)->target()->toNode()->treeScope()->isInclusiveA ncestorOf(m_node->treeScope()));
133 } 139 }
134 #endif 140 #endif
135 141
136 } 142 }
OLDNEW
« no previous file with comments | « Source/core/dom/EventContext.h ('k') | Source/core/dom/EventRetargeter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698