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