| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 return adoptRef(new MouseEvent(type, canBubble, cancelable, view, | 73 return adoptRef(new MouseEvent(type, canBubble, cancelable, view, |
| 74 detail, screenX, screenY, pageX, pageY, | 74 detail, screenX, screenY, pageX, pageY, |
| 75 movementX, movementY, | 75 movementX, movementY, |
| 76 ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, isSimulated,
syntheticEventType)); | 76 ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget, isSimulated,
syntheticEventType)); |
| 77 } | 77 } |
| 78 | 78 |
| 79 MouseEvent::MouseEvent() | 79 MouseEvent::MouseEvent() |
| 80 : m_button(0) | 80 : m_button(0) |
| 81 , m_buttonDown(false) | 81 , m_buttonDown(false) |
| 82 { | 82 { |
| 83 ScriptWrappable::init(this); | |
| 84 } | 83 } |
| 85 | 84 |
| 86 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
lable, PassRefPtr<AbstractView> view, | 85 MouseEvent::MouseEvent(const AtomicString& eventType, bool canBubble, bool cance
lable, PassRefPtr<AbstractView> view, |
| 87 int detail, int screenX, int screenY, int pageX, int pageY, | 86 int detail, int screenX, int screenY, int pageX, int pageY, |
| 88 int movementX, int movementY, | 87 int movementX, int movementY, |
| 89 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, | 88 bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, |
| 90 unsigned short button, PassRefPtr<EventTarget> relatedTarget, | 89 unsigned short button, PassRefPtr<EventTarget> relatedTarget, |
| 91 bool isSimulated, PlatformMouseEvent::SyntheticEventType syntheticEventType) | 90 bool isSimulated, PlatformMouseEvent::SyntheticEventType syntheticEventType) |
| 92 : MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, IntPoint
(screenX, screenY), | 91 : MouseRelatedEvent(eventType, canBubble, cancelable, view, detail, IntPoint
(screenX, screenY), |
| 93 IntPoint(pageX, pageY), | 92 IntPoint(pageX, pageY), |
| 94 IntPoint(movementX, movementY), | 93 IntPoint(movementX, movementY), |
| 95 ctrlKey, altKey, shiftKey, metaKey, isSimulated) | 94 ctrlKey, altKey, shiftKey, metaKey, isSimulated) |
| 96 , m_button(button == (unsigned short)-1 ? 0 : button) | 95 , m_button(button == (unsigned short)-1 ? 0 : button) |
| 97 , m_buttonDown(button != (unsigned short)-1) | 96 , m_buttonDown(button != (unsigned short)-1) |
| 98 , m_relatedTarget(relatedTarget) | 97 , m_relatedTarget(relatedTarget) |
| 99 , m_syntheticEventType(syntheticEventType) | 98 , m_syntheticEventType(syntheticEventType) |
| 100 { | 99 { |
| 101 ScriptWrappable::init(this); | |
| 102 } | 100 } |
| 103 | 101 |
| 104 MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& init
ializer) | 102 MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& init
ializer) |
| 105 : MouseRelatedEvent(eventType, initializer.bubbles, initializer.cancelable,
initializer.view, initializer.detail, IntPoint(initializer.screenX, initializer.
screenY), | 103 : MouseRelatedEvent(eventType, initializer.bubbles, initializer.cancelable,
initializer.view, initializer.detail, IntPoint(initializer.screenX, initializer.
screenY), |
| 106 IntPoint(0 /* pageX */, 0 /* pageY */), | 104 IntPoint(0 /* pageX */, 0 /* pageY */), |
| 107 IntPoint(0 /* movementX */, 0 /* movementY */), | 105 IntPoint(0 /* movementX */, 0 /* movementY */), |
| 108 initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializ
er.metaKey, false /* isSimulated */) | 106 initializer.ctrlKey, initializer.altKey, initializer.shiftKey, initializ
er.metaKey, false /* isSimulated */) |
| 109 , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button
) | 107 , m_button(initializer.button == (unsigned short)-1 ? 0 : initializer.button
) |
| 110 , m_buttonDown(initializer.button != (unsigned short)-1) | 108 , m_buttonDown(initializer.button != (unsigned short)-1) |
| 111 , m_relatedTarget(initializer.relatedTarget) | 109 , m_relatedTarget(initializer.relatedTarget) |
| 112 { | 110 { |
| 113 ScriptWrappable::init(this); | |
| 114 initCoordinates(IntPoint(initializer.clientX, initializer.clientY)); | 111 initCoordinates(IntPoint(initializer.clientX, initializer.clientY)); |
| 115 } | 112 } |
| 116 | 113 |
| 117 MouseEvent::~MouseEvent() | 114 MouseEvent::~MouseEvent() |
| 118 { | 115 { |
| 119 } | 116 } |
| 120 | 117 |
| 121 void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool c
ancelable, PassRefPtr<AbstractView> view, | 118 void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool c
ancelable, PassRefPtr<AbstractView> view, |
| 122 int detail, int screenX, int screenY, int client
X, int clientY, | 119 int detail, int screenX, int screenY, int client
X, int clientY, |
| 123 bool ctrlKey, bool altKey, bool shiftKey, bool m
etaKey, | 120 bool ctrlKey, bool altKey, bool shiftKey, bool m
etaKey, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 272 event()->button(), relatedTarget); | 269 event()->button(), relatedTarget); |
| 273 if (event()->defaultHandled()) | 270 if (event()->defaultHandled()) |
| 274 doubleClickEvent->setDefaultHandled(); | 271 doubleClickEvent->setDefaultHandled(); |
| 275 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato
r::create(doubleClickEvent)); | 272 EventDispatcher::dispatchEvent(dispatcher->node(), MouseEventDispatchMediato
r::create(doubleClickEvent)); |
| 276 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) | 273 if (doubleClickEvent->defaultHandled() || doubleClickEvent->defaultPrevented
()) |
| 277 return false; | 274 return false; |
| 278 return !swallowEvent; | 275 return !swallowEvent; |
| 279 } | 276 } |
| 280 | 277 |
| 281 } // namespace blink | 278 } // namespace blink |
| OLD | NEW |