| 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 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 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 if (!gNodesDispatchingSimulatedClicks) | 80 if (!gNodesDispatchingSimulatedClicks) |
| 81 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; | 81 gNodesDispatchingSimulatedClicks = new HashSet<Node*>; |
| 82 else if (gNodesDispatchingSimulatedClicks->contains(node)) | 82 else if (gNodesDispatchingSimulatedClicks->contains(node)) |
| 83 return; | 83 return; |
| 84 | 84 |
| 85 gNodesDispatchingSimulatedClicks->add(node); | 85 gNodesDispatchingSimulatedClicks->add(node); |
| 86 | 86 |
| 87 if (mouseEventOptions == SendMouseOverUpDownEvents) | 87 if (mouseEventOptions == SendMouseOverUpDownEvents) |
| 88 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo
ver, node->document().domWindow(), underlyingEvent)).dispatch(); | 88 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseo
ver, node->document().domWindow(), underlyingEvent)).dispatch(); |
| 89 | 89 |
| 90 if (mouseEventOptions != SendNoEvents) | 90 if (mouseEventOptions != SendNoEvents) { |
| 91 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused
own, node->document().domWindow(), underlyingEvent)).dispatch(); | 91 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::moused
own, node->document().domWindow(), underlyingEvent)).dispatch(); |
| 92 node->setActive(true); | 92 node->setActive(true); |
| 93 if (mouseEventOptions != SendNoEvents) | |
| 94 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu
p, node->document().domWindow(), underlyingEvent)).dispatch(); | 93 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::mouseu
p, node->document().domWindow(), underlyingEvent)).dispatch(); |
| 94 } |
| 95 // Some elements (e.g. the color picker) may set active state to true before |
| 96 // calling this method and expect the state to be reset during the call. |
| 95 node->setActive(false); | 97 node->setActive(false); |
| 96 | 98 |
| 97 // always send click | 99 // always send click |
| 98 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod
e->document().domWindow(), underlyingEvent)).dispatch(); | 100 EventDispatcher(node, SimulatedMouseEvent::create(EventTypeNames::click, nod
e->document().domWindow(), underlyingEvent)).dispatch(); |
| 99 | 101 |
| 100 gNodesDispatchingSimulatedClicks->remove(node); | 102 gNodesDispatchingSimulatedClicks->remove(node); |
| 101 } | 103 } |
| 102 | 104 |
| 103 bool EventDispatcher::dispatch() | 105 bool EventDispatcher::dispatch() |
| 104 { | 106 { |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 } | 225 } |
| 224 } | 226 } |
| 225 } | 227 } |
| 226 | 228 |
| 227 const NodeEventContext* EventDispatcher::topNodeEventContext() | 229 const NodeEventContext* EventDispatcher::topNodeEventContext() |
| 228 { | 230 { |
| 229 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); | 231 return m_event->eventPath().isEmpty() ? 0 : &m_event->eventPath().last(); |
| 230 } | 232 } |
| 231 | 233 |
| 232 } | 234 } |
| OLD | NEW |