OLD | NEW |
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 | 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All |
6 * rights reserved. | 6 * rights reserved. |
7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 7 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. | 8 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. |
9 * (http://www.torchmobile.com/) | 9 * (http://www.torchmobile.com/) |
10 * Copyright (C) 2011 Google Inc. All rights reserved. | 10 * Copyright (C) 2011 Google Inc. All rights reserved. |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 | 90 |
91 if (isDisabledFormControl(&node)) | 91 if (isDisabledFormControl(&node)) |
92 return; | 92 return; |
93 | 93 |
94 if (nodesDispatchingSimulatedClicks.contains(&node)) | 94 if (nodesDispatchingSimulatedClicks.contains(&node)) |
95 return; | 95 return; |
96 | 96 |
97 nodesDispatchingSimulatedClicks.insert(&node); | 97 nodesDispatchingSimulatedClicks.insert(&node); |
98 | 98 |
99 if (mouseEventOptions == SendMouseOverUpDownEvents) | 99 if (mouseEventOptions == SendMouseOverUpDownEvents) |
100 EventDispatcher(node, MouseEvent::create(EventTypeNames::mouseover, | 100 EventDispatcher(node, |
101 node.document().domWindow(), | 101 MouseEvent::create(EventTypeNames::mouseover, |
102 underlyingEvent, creationScope)) | 102 node.document().domWindow(), |
| 103 underlyingEvent, creationScope)) |
103 .dispatch(); | 104 .dispatch(); |
104 | 105 |
105 if (mouseEventOptions != SendNoEvents) { | 106 if (mouseEventOptions != SendNoEvents) { |
106 EventDispatcher(node, MouseEvent::create(EventTypeNames::mousedown, | 107 EventDispatcher(node, |
107 node.document().domWindow(), | 108 MouseEvent::create(EventTypeNames::mousedown, |
108 underlyingEvent, creationScope)) | 109 node.document().domWindow(), |
| 110 underlyingEvent, creationScope)) |
109 .dispatch(); | 111 .dispatch(); |
110 node.setActive(true); | 112 node.setActive(true); |
111 EventDispatcher(node, MouseEvent::create(EventTypeNames::mouseup, | 113 EventDispatcher( |
112 node.document().domWindow(), | 114 node, |
113 underlyingEvent, creationScope)) | 115 MouseEvent::create(EventTypeNames::mouseup, node.document().domWindow(), |
| 116 underlyingEvent, creationScope)) |
114 .dispatch(); | 117 .dispatch(); |
115 } | 118 } |
116 // Some elements (e.g. the color picker) may set active state to true before | 119 // Some elements (e.g. the color picker) may set active state to true before |
117 // calling this method and expect the state to be reset during the call. | 120 // calling this method and expect the state to be reset during the call. |
118 node.setActive(false); | 121 node.setActive(false); |
119 | 122 |
120 // always send click | 123 // always send click |
121 EventDispatcher(node, MouseEvent::create(EventTypeNames::click, | 124 EventDispatcher( |
122 node.document().domWindow(), | 125 node, |
123 underlyingEvent, creationScope)) | 126 MouseEvent::create(EventTypeNames::click, node.document().domWindow(), |
| 127 underlyingEvent, creationScope)) |
124 .dispatch(); | 128 .dispatch(); |
125 | 129 |
126 nodesDispatchingSimulatedClicks.erase(&node); | 130 nodesDispatchingSimulatedClicks.erase(&node); |
127 } | 131 } |
128 | 132 |
129 DispatchEventResult EventDispatcher::dispatch() { | 133 DispatchEventResult EventDispatcher::dispatch() { |
130 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("blink.debug"), | 134 TRACE_EVENT0(TRACE_DISABLED_BY_DEFAULT("blink.debug"), |
131 "EventDispatcher::dispatch"); | 135 "EventDispatcher::dispatch"); |
132 | 136 |
133 #if DCHECK_IS_ON() | 137 #if DCHECK_IS_ON() |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
307 // events to open select boxes. | 311 // events to open select boxes. |
308 if (!m_event->isTrusted() && m_event->isMouseEvent() && | 312 if (!m_event->isTrusted() && m_event->isMouseEvent() && |
309 m_event->type() == EventTypeNames::mousedown && | 313 m_event->type() == EventTypeNames::mousedown && |
310 isHTMLSelectElement(*m_node)) { | 314 isHTMLSelectElement(*m_node)) { |
311 UseCounter::count(m_node->document(), | 315 UseCounter::count(m_node->document(), |
312 UseCounter::UntrustedMouseDownEventDispatchedToSelect); | 316 UseCounter::UntrustedMouseDownEventDispatchedToSelect); |
313 } | 317 } |
314 } | 318 } |
315 | 319 |
316 } // namespace blink | 320 } // namespace blink |
OLD | NEW |