PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget) { ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton); bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventType == EventTypeNames::mouseleave; bool isCancelable = !isMouseEnterOrLeave; bool isBubbling = !isMouseEnterOrLeave; return MouseEvent::create(eventType, isBubbling, isCancelable, view, detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), event.movementDelta().x(), event.movementDelta().y(), event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(), relatedTarget, nullptr, false); }
Ref<MouseEvent> MouseEvent::create(const AtomicString& eventType, AbstractView* view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget) { bool isMouseEnterOrLeave = eventType == eventNames().mouseenterEvent || eventType == eventNames().mouseleaveEvent; bool isCancelable = eventType != eventNames().mousemoveEvent && !isMouseEnterOrLeave; bool canBubble = !isMouseEnterOrLeave; return MouseEvent::create(eventType, canBubble, isCancelable, event.timestamp(), view, detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), #if ENABLE(POINTER_LOCK) event.movementDelta().x(), event.movementDelta().y(), #endif event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(), relatedTarget, event.force(), event.syntheticClickType()); }
PassRefPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtr<Node> relatedTarget) { ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton); bool isCancelable = eventType != eventNames().mousemoveEvent; return MouseEvent::create(eventType, true, isCancelable, view, detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), #if ENABLE(POINTER_LOCK) event.movementDelta().x(), event.movementDelta().y(), #endif event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), event.button(), relatedTarget, 0, false); }
PassRefPtrWillBeRawPtr<MouseEvent> MouseEvent::create(const AtomicString& eventType, PassRefPtrWillBeRawPtr<AbstractView> view, const PlatformMouseEvent& event, int detail, PassRefPtrWillBeRawPtr<Node> relatedTarget) { ASSERT(event.type() == PlatformEvent::MouseMoved || event.button() != NoButton); bool isMouseEnterOrLeave = eventType == EventTypeNames::mouseenter || eventType == EventTypeNames::mouseleave; bool isCancelable = !isMouseEnterOrLeave; bool isBubbling = !isMouseEnterOrLeave; return MouseEvent::create( eventType, isBubbling, isCancelable, view, detail, event.globalPosition().x(), event.globalPosition().y(), event.position().x(), event.position().y(), event.movementDelta().x(), event.movementDelta().y(), event.modifiers(), event.button(), platformModifiersToButtons(event.modifiers()), relatedTarget, event.timestamp(), event.syntheticEventType()); }