| 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 21 matching lines...) Expand all Loading... |
| 32 | 32 |
| 33 MouseEvent* MouseEvent::create(ScriptState* scriptState, const AtomicString& typ
e, const MouseEventInit& initializer) | 33 MouseEvent* MouseEvent::create(ScriptState* scriptState, const AtomicString& typ
e, const MouseEventInit& initializer) |
| 34 { | 34 { |
| 35 if (scriptState && scriptState->world().isIsolatedWorld()) | 35 if (scriptState && scriptState->world().isIsolatedWorld()) |
| 36 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); | 36 UIEventWithKeyState::didCreateEventInIsolatedWorld(initializer.ctrlKey()
, initializer.altKey(), initializer.shiftKey(), initializer.metaKey()); |
| 37 return new MouseEvent(type, initializer); | 37 return new MouseEvent(type, initializer); |
| 38 } | 38 } |
| 39 | 39 |
| 40 MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
, const PlatformMouseEvent& event, int detail, Node* relatedTarget) | 40 MouseEvent* MouseEvent::create(const AtomicString& eventType, AbstractView* view
, const PlatformMouseEvent& event, int detail, Node* relatedTarget) |
| 41 { | 41 { |
| 42 ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButt
on); | |
| 43 | |
| 44 bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventT
ype == EventTypeNames::mouseleave; | 42 bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventT
ype == EventTypeNames::mouseleave; |
| 45 bool isCancelable = !isMouseEnterOrLeave; | 43 bool isCancelable = !isMouseEnterOrLeave; |
| 46 bool isBubbling = !isMouseEnterOrLeave; | 44 bool isBubbling = !isMouseEnterOrLeave; |
| 47 | 45 |
| 48 return MouseEvent::create( | 46 return MouseEvent::create( |
| 49 eventType, isBubbling, isCancelable, view, | 47 eventType, isBubbling, isCancelable, view, |
| 50 detail, event.globalPosition().x(), event.globalPosition().y(), event.po
sition().x(), event.position().y(), | 48 detail, event.globalPosition().x(), event.globalPosition().y(), event.po
sition().x(), event.position().y(), |
| 51 event.movementDelta().x(), event.movementDelta().y(), | 49 event.movementDelta().x(), event.movementDelta().y(), |
| 52 event.getModifiers(), event.button(), | 50 event.getModifiers(), event.button(), |
| 53 platformModifiersToButtons(event.getModifiers()), | 51 platformModifiersToButtons(event.getModifiers()), |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 doubleClickEvent->setTrusted(mouseEvent.isTrusted()); | 303 doubleClickEvent->setTrusted(mouseEvent.isTrusted()); |
| 306 if (mouseEvent.defaultHandled()) | 304 if (mouseEvent.defaultHandled()) |
| 307 doubleClickEvent->setDefaultHandled(); | 305 doubleClickEvent->setDefaultHandled(); |
| 308 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve
nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); | 306 DispatchEventResult doubleClickDispatchResult = EventDispatcher::dispatchEve
nt(dispatcher.node(), MouseEventDispatchMediator::create(doubleClickEvent)); |
| 309 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) | 307 if (doubleClickDispatchResult != DispatchEventResult::NotCanceled) |
| 310 return doubleClickDispatchResult; | 308 return doubleClickDispatchResult; |
| 311 return dispatchResult; | 309 return dispatchResult; |
| 312 } | 310 } |
| 313 | 311 |
| 314 } // namespace blink | 312 } // namespace blink |
| OLD | NEW |