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 22 matching lines...) Expand all Loading... |
33 | 33 |
34 MouseEvent* MouseEvent::create(ScriptState* scriptState, const AtomicString& typ
e, const MouseEventInit& initializer) | 34 MouseEvent* MouseEvent::create(ScriptState* scriptState, const AtomicString& typ
e, const MouseEventInit& initializer) |
35 { | 35 { |
36 if (scriptState && scriptState->world().isIsolatedWorld()) | 36 if (scriptState && scriptState->world().isIsolatedWorld()) |
37 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); | 37 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); |
38 return new MouseEvent(type, initializer); | 38 return new MouseEvent(type, initializer); |
39 } | 39 } |
40 | 40 |
41 MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
, const PlatformMouseEvent& event, int detail, Node* relatedTarget) | 41 MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
, const PlatformMouseEvent& event, int detail, Node* relatedTarget) |
42 { | 42 { |
43 DCHECK(event.type() == PlatformEvent::MouseMoved || event.pointerProperties(
).button != WebPointerProperties::Button::NoButton); | |
44 | |
45 bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventT
ype == EventTypeNames::mouseleave; | 43 bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventT
ype == EventTypeNames::mouseleave; |
46 bool isCancelable = !isMouseEnterOrLeave; | 44 bool isCancelable = !isMouseEnterOrLeave; |
47 bool isBubbling = !isMouseEnterOrLeave; | 45 bool isBubbling = !isMouseEnterOrLeave; |
48 | 46 |
49 return MouseEvent::create( | 47 return MouseEvent::create( |
50 eventType, isBubbling, isCancelable, view, | 48 eventType, isBubbling, isCancelable, view, |
51 detail, event.globalPosition().x(), event.globalPosition().y(), event.po
sition().x(), event.position().y(), | 49 detail, event.globalPosition().x(), event.globalPosition().y(), event.po
sition().x(), event.position().y(), |
52 event.movementDelta().x(), event.movementDelta().y(), | 50 event.movementDelta().x(), event.movementDelta().y(), |
53 event.getModifiers(), static_cast<short>(event.pointerProperties().butto
n), | 51 event.getModifiers(), static_cast<short>(event.pointerProperties().butto
n), |
54 platformModifiersToButtons(event.getModifiers()), | 52 platformModifiersToButtons(event.getModifiers()), |
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
290 doubleClickEvent->setTrusted(mouseEvent.isTrusted()); | 288 doubleClickEvent->setTrusted(mouseEvent.isTrusted()); |
291 if (mouseEvent.defaultHandled()) | 289 if (mouseEvent.defaultHandled()) |
292 doubleClickEvent->setDefaultHandled(); | 290 doubleClickEvent->setDefaultHandled(); |
293 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve
nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); | 291 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve
nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); |
294 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) | 292 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) |
295 return doubleClickDispatchResult; | 293 return doubleClickDispatchResult; |
296 return dispatchResult; | 294 return dispatchResult; |
297 } | 295 } |
298 | 296 |
299 } // namespace blink | 297 } // namespace blink |
OLD | NEW |