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

Unified Diff: Source/core/dom/EventDispatcher.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/dom/ElementRareData.h ('k') | Source/core/dom/EventPathWalker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/EventDispatcher.cpp
diff --git a/Source/core/dom/EventDispatcher.cpp b/Source/core/dom/EventDispatcher.cpp
index bf9f40bf0f9796c5b60dab82b80b29348bdcf2b1..9bcfb1134e771723e78f9696c9f83a772d9f9fa3 100644
--- a/Source/core/dom/EventDispatcher.cpp
+++ b/Source/core/dom/EventDispatcher.cpp
@@ -60,7 +60,7 @@ EventDispatcher::EventDispatcher(Node* node, PassRefPtr<Event> event)
ASSERT(node);
ASSERT(m_event.get());
ASSERT(!m_event->type().isNull()); // JavaScript code can create an event with an empty name, but not null.
- m_view = node->document()->view();
+ m_view = node->document().view();
EventRetargeter::ensureEventPath(m_node.get(), m_event.get());
}
@@ -84,17 +84,17 @@ void EventDispatcher::dispatchSimulatedClick(Node* node, Event* underlyingEvent,
gNodesDispatchingSimulatedClicks->add(node);
if (mouseEventOptions == SendMouseOverUpDownEvents)
- EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mouseoverEvent, node->document()->defaultView(), underlyingEvent)).dispatch();
+ EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mouseoverEvent, node->document().defaultView(), underlyingEvent)).dispatch();
if (mouseEventOptions != SendNoEvents)
- EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document()->defaultView(), underlyingEvent)).dispatch();
+ EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mousedownEvent, node->document().defaultView(), underlyingEvent)).dispatch();
node->setActive(true, visualOptions == ShowPressedLook);
if (mouseEventOptions != SendNoEvents)
- EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document()->defaultView(), underlyingEvent)).dispatch();
+ EventDispatcher(node, SimulatedMouseEvent::create(eventNames().mouseupEvent, node->document().defaultView(), underlyingEvent)).dispatch();
node->setActive(false);
// always send click
- EventDispatcher(node, SimulatedMouseEvent::create(eventNames().clickEvent, node->document()->defaultView(), underlyingEvent)).dispatch();
+ EventDispatcher(node, SimulatedMouseEvent::create(eventNames().clickEvent, node->document().defaultView(), underlyingEvent)).dispatch();
gNodesDispatchingSimulatedClicks->remove(node);
}
@@ -111,7 +111,7 @@ bool EventDispatcher::dispatch()
ASSERT(!NoEventDispatchAssertion::isEventDispatchForbidden());
ASSERT(m_event->target());
WindowEventContext windowEventContext(m_event.get(), m_node.get(), topEventContext());
- InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchEvent(m_node->document(), *m_event, windowEventContext.window(), m_node.get(), m_event->eventPath());
+ InspectorInstrumentationCookie cookie = InspectorInstrumentation::willDispatchEvent(&m_node->document(), *m_event, windowEventContext.window(), m_node.get(), m_event->eventPath());
void* preDispatchEventHandlerResult;
if (dispatchEventPreProcess(preDispatchEventHandlerResult) == ContinueDispatching)
« no previous file with comments | « Source/core/dom/ElementRareData.h ('k') | Source/core/dom/EventPathWalker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698