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

Side by Side Diff: Source/core/events/EventDispatcher.cpp

Issue 27183013: Use [ImplementedAs=domWindow] for Document.defaultView() (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 2 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * Copyright (C) 2011 Google Inc. All rights reserved. 8 * Copyright (C) 2011 Google Inc. All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 return; 77 return;
78 78
79 if (!gNodesDispatchingSimulatedClicks) 79 if (!gNodesDispatchingSimulatedClicks)
80 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; 80 gNodesDispatchingSimulatedClicks = new HashSet<Node*>;
81 else if (gNodesDispatchingSimulatedClicks->contains(node)) 81 else if (gNodesDispatchingSimulatedClicks->contains(node))
82 return; 82 return;
83 83
84 gNodesDispatchingSimulatedClicks->add(node); 84 gNodesDispatchingSimulatedClicks->add(node);
85 85
86 if (mouseEventOptions == SendMouseOverUpDownEvents) 86 if (mouseEventOptions == SendMouseOverUpDownEvents)
87 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo ver, node->document().defaultView(), underlyingEvent)).dispatch(); 87 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo ver, node->document().domWindow(), underlyingEvent)).dispatch();
88 88
89 if (mouseEventOptions != SendNoEvents) 89 if (mouseEventOptions != SendNoEvents)
90 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused own, node->document().defaultView(), underlyingEvent)).dispatch(); 90 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused own, node->document().domWindow(), underlyingEvent)).dispatch();
91 node->setActive(true, visualOptions == ShowPressedLook); 91 node->setActive(true, visualOptions == ShowPressedLook);
92 if (mouseEventOptions != SendNoEvents) 92 if (mouseEventOptions != SendNoEvents)
93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu p, node->document().defaultView(), underlyingEvent)).dispatch(); 93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu p, node->document().domWindow(), underlyingEvent)).dispatch();
94 node->setActive(false); 94 node->setActive(false);
95 95
96 // always send click 96 // always send click
97 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().defaultView(), underlyingEvent)).dispatch(); 97 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod e->document().domWindow(), underlyingEvent)).dispatch();
98 98
99 gNodesDispatchingSimulatedClicks->remove(node); 99 gNodesDispatchingSimulatedClicks->remove(node);
100 } 100 }
101 101
102 bool EventDispatcher::dispatch() 102 bool EventDispatcher::dispatch()
103 { 103 {
104 #ifndef NDEBUG 104 #ifndef NDEBUG
105 ASSERT(!m_eventDispatched); 105 ASSERT(!m_eventDispatched);
106 m_eventDispatched = true; 106 m_eventDispatched = true;
107 #endif 107 #endif
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 } 218 }
219 } 219 }
220 } 220 }
221 221
222 const EventContext* EventDispatcher::topEventContext() 222 const EventContext* EventDispatcher::topEventContext()
223 { 223 {
224 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( ); 224 return m_event->eventPath().isEmpty() ? 0 : m_event->eventPath().last().get( );
225 } 225 }
226 226
227 } 227 }
OLDNEW
« no previous file with comments | « Source/core/dom/custom/CustomElementCallbackInvocation.cpp ('k') | Source/core/page/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698