MouseRelatedEvent::MouseRelatedEvent(const AtomicString& eventType, const MouseEventInit& initializer) : UIEventWithKeyState(eventType, initializer) , m_screenLocation(IntPoint(initializer.screenX(), initializer.screenY())) , m_movementDelta(IntPoint(initializer.movementX(), initializer.movementY())) , m_positionType(PositionType::Position) { initCoordinates(IntPoint(initializer.clientX(), initializer.clientY())); }
MouseEvent::MouseEvent(const AtomicString& eventType, const MouseEventInit& initializer) : MouseRelatedEvent(eventType, initializer.bubbles(), initializer.cancelable(), initializer.view(), initializer.detail(), IntPoint(initializer.screenX(), initializer.screenY()), IntPoint(0 /* pageX */, 0 /* pageY */), IntPoint(0 /* movementX */, 0 /* movementY */), initializer.ctrlKey(), initializer.altKey(), initializer.shiftKey(), initializer.metaKey(), false /* isSimulated */) , m_button(initializer.button() == (unsigned short)-1 ? 0 : initializer.button()) , m_buttons(initializer.buttons()) , m_buttonDown(initializer.button() != (unsigned short)-1) , m_relatedTarget(initializer.relatedTarget()) , m_dataTransfer(nullptr) , m_syntheticEventType(PlatformMouseEvent::RealOrIndistinguishable) { initCoordinates(IntPoint(initializer.clientX(), initializer.clientY())); }