| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) | 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) |
| 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) | 3 * Copyright (C) 2001 Tobias Anton (anton@stud.fbi.fh-darmstadt.de) |
| 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) | 4 * Copyright (C) 2006 Samuel Weinig (sam.weinig@gmail.com) |
| 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2008 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 | 177 |
| 178 Node* MouseEvent::fromElement() const | 178 Node* MouseEvent::fromElement() const |
| 179 { | 179 { |
| 180 // MSIE extension - "object from which activation or the mouse pointer is ex
iting during the event" (huh?) | 180 // MSIE extension - "object from which activation or the mouse pointer is ex
iting during the event" (huh?) |
| 181 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea
ve) | 181 if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouselea
ve) |
| 182 return relatedTarget() ? relatedTarget()->toNode() : 0; | 182 return relatedTarget() ? relatedTarget()->toNode() : 0; |
| 183 | 183 |
| 184 return target() ? target()->toNode() : 0; | 184 return target() ? target()->toNode() : 0; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void MouseEvent::trace(Visitor* visitor) | |
| 188 { | |
| 189 visitor->trace(m_relatedTarget); | |
| 190 MouseRelatedEvent::trace(visitor); | |
| 191 } | |
| 192 | |
| 193 PassRefPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString&
eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent) | 187 PassRefPtr<SimulatedMouseEvent> SimulatedMouseEvent::create(const AtomicString&
eventType, PassRefPtr<AbstractView> view, PassRefPtr<Event> underlyingEvent) |
| 194 { | 188 { |
| 195 return adoptRef(new SimulatedMouseEvent(eventType, view, underlyingEvent)); | 189 return adoptRef(new SimulatedMouseEvent(eventType, view, underlyingEvent)); |
| 196 } | 190 } |
| 197 | 191 |
| 198 SimulatedMouseEvent::~SimulatedMouseEvent() | 192 SimulatedMouseEvent::~SimulatedMouseEvent() |
| 199 { | 193 { |
| 200 } | 194 } |
| 201 | 195 |
| 202 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
tr<AbstractView> view, PassRefPtr<Event> underlyingEvent) | 196 SimulatedMouseEvent::SimulatedMouseEvent(const AtomicString& eventType, PassRefP
tr<AbstractView> view, PassRefPtr<Event> underlyingEvent) |
| 203 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false,
false, false, 0, | 197 : MouseEvent(eventType, true, true, view, 0, 0, 0, 0, 0, 0, 0, false, false,
false, false, 0, |
| 204 nullptr, true, PlatformMouseEvent::RealOrIndistinguishable) | 198 nullptr, true, PlatformMouseEvent::RealOrIndistinguishable) |
| 205 { | 199 { |
| 206 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve
nt.get())) { | 200 if (UIEventWithKeyState* keyStateEvent = findEventWithKeyState(underlyingEve
nt.get())) { |
| 207 m_ctrlKey = keyStateEvent->ctrlKey(); | 201 m_ctrlKey = keyStateEvent->ctrlKey(); |
| 208 m_altKey = keyStateEvent->altKey(); | 202 m_altKey = keyStateEvent->altKey(); |
| 209 m_shiftKey = keyStateEvent->shiftKey(); | 203 m_shiftKey = keyStateEvent->shiftKey(); |
| 210 m_metaKey = keyStateEvent->metaKey(); | 204 m_metaKey = keyStateEvent->metaKey(); |
| 211 } | 205 } |
| 212 setUnderlyingEvent(underlyingEvent); | 206 setUnderlyingEvent(underlyingEvent); |
| 213 | 207 |
| 214 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) { | 208 if (this->underlyingEvent() && this->underlyingEvent()->isMouseEvent()) { |
| 215 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent()); | 209 MouseEvent* mouseEvent = toMouseEvent(this->underlyingEvent()); |
| 216 m_screenLocation = mouseEvent->screenLocation(); | 210 m_screenLocation = mouseEvent->screenLocation(); |
| 217 initCoordinates(mouseEvent->clientLocation()); | 211 initCoordinates(mouseEvent->clientLocation()); |
| 218 } | 212 } |
| 219 } | 213 } |
| 220 | 214 |
| 221 void SimulatedMouseEvent::trace(Visitor* visitor) | |
| 222 { | |
| 223 MouseEvent::trace(visitor); | |
| 224 } | |
| 225 | |
| 226 PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRe
fPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) | 215 PassRefPtr<MouseEventDispatchMediator> MouseEventDispatchMediator::create(PassRe
fPtr<MouseEvent> mouseEvent, MouseEventType mouseEventType) |
| 227 { | 216 { |
| 228 return adoptRef(new MouseEventDispatchMediator(mouseEvent, mouseEventType)); | 217 return adoptRef(new MouseEventDispatchMediator(mouseEvent, mouseEventType)); |
| 229 } | 218 } |
| 230 | 219 |
| 231 MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtr<MouseEvent> mo
useEvent, MouseEventType mouseEventType) | 220 MouseEventDispatchMediator::MouseEventDispatchMediator(PassRefPtr<MouseEvent> mo
useEvent, MouseEventType mouseEventType) |
| 232 : EventDispatchMediator(mouseEvent), m_mouseEventType(mouseEventType) | 221 : EventDispatchMediator(mouseEvent), m_mouseEventType(mouseEventType) |
| 233 { | 222 { |
| 234 } | 223 } |
| 235 | 224 |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 event()->button(), relatedTarget); | 258 event()->button(), relatedTarget); |
| 270 if (event()->defaultHandled()) | 259 if (event()->defaultHandled()) |
| 271 doubleClickEvent->setDefaultHandled(); | 260 doubleClickEvent->setDefaultHandled(); |
| 272 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato
r::create(doubleClickEvent)); | 261 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato
r::create(doubleClickEvent)); |
| 273 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) | 262 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) |
| 274 return false; | 263 return false; |
| 275 return !swallowEvent; | 264 return !swallowEvent; |
| 276 } | 265 } |
| 277 | 266 |
| 278 } // namespace blink | 267 } // namespace blink |
| OLD | NEW |