void TouchEvent::initTouchEvent(ScriptState* scriptState, TouchList* touches, TouchList* targetTouches, TouchList* changedTouches, const AtomicString& type, PassRefPtrWillBeRawPtr<AbstractView> view, int, int, int, int, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) { if (dispatched()) return; if (scriptState->world().isIsolatedWorld()) UIEventWithKeyState::didCreateEventInIsolatedWorld(ctrlKey, altKey, shiftKey, metaKey); bool cancelable = true; if (type == EventTypeNames::touchcancel) cancelable = false; initUIEvent(type, true, cancelable, view, 0); m_touches = touches; m_targetTouches = targetTouches; m_changedTouches = changedTouches; m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; }
void MouseEvent::initMouseEvent(ScriptState* scriptState, const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtrWillBeRawPtr<EventTarget> relatedTarget, unsigned short buttons) { if (dispatched()) return; if (scriptState && scriptState->world().isIsolatedWorld()) UIEventWithKeyState::didCreateEventInIsolatedWorld(ctrlKey, altKey, shiftKey, metaKey); initUIEvent(type, canBubble, cancelable, view, detail); m_screenLocation = IntPoint(screenX, screenY); m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; m_button = button == (unsigned short)-1 ? 0 : button; m_buttons = buttons; m_buttonDown = button != (unsigned short)-1; m_relatedTarget = relatedTarget; initCoordinates(IntPoint(clientX, clientY)); // FIXME: m_isSimulated is not set to false here. // FIXME: m_dataTransfer is not set to nullptr here. }
void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTargetNode> relatedTarget) { if (dispatched()) return; initUIEvent(type, canBubble, cancelable, view, detail); m_screenX = screenX; m_screenY = screenY; m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; m_button = button == (unsigned short)-1 ? 0 : button; m_buttonDown = button != (unsigned short)-1; m_relatedTarget = relatedTarget; initCoordinates(clientX, clientY); // FIXME: m_isSimulated is not set to false here. // FIXME: m_clipboard is not set to 0 here. }
void WheelEvent::initWheelEvent(int rawDeltaX, int rawDeltaY, PassRefPtr<AbstractView> view, int screenX, int screenY, int pageX, int pageY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) { if (dispatched()) return; initUIEvent(eventNames().wheelEvent, true, true, view, 0); m_screenLocation = IntPoint(screenX, screenY); m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; // Normalize to 120 multiple for compatibility with IE. m_wheelDelta = IntPoint(rawDeltaX * TickMultiplier, rawDeltaY * TickMultiplier); m_deltaX = -rawDeltaX; m_deltaY = -rawDeltaY; m_deltaMode = DOM_DELTA_PIXEL; m_directionInvertedFromDevice = false; initCoordinates(IntPoint(pageX, pageY)); }
void TouchEvent::initTouchEvent(TouchList* touches, TouchList* targetTouches, TouchList* changedTouches, const AtomicString& type, PassRefPtr<AbstractView> view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) { if (dispatched()) return; initUIEvent(type, true, true, view, 0); m_touches = touches; m_targetTouches = targetTouches; m_changedTouches = changedTouches; m_screenLocation = IntPoint(screenX, screenY); m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; initCoordinates(IntPoint(clientX, clientY)); #if PLATFORM(BLACKBERRY) m_doubleTap = false; m_touchHold = false; #endif }
void MouseEvent::initMouseEvent(const AtomicString& type, bool canBubble, bool cancelable, AbstractView* view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, unsigned short button, PassRefPtr<EventTarget> relatedTarget) { if (dispatched()) return; initUIEvent(type, canBubble, cancelable, view, detail); m_screenLocation = IntPoint(screenX, screenY); m_ctrlKey = ctrlKey; m_altKey = altKey; m_shiftKey = shiftKey; m_metaKey = metaKey; m_button = button == (unsigned short)-1 ? 0 : button; m_syntheticClickType = 0; m_buttonDown = button != (unsigned short)-1; m_relatedTarget = relatedTarget; initCoordinates(IntPoint(clientX, clientY)); // FIXME: m_isSimulated is not set to false here. // FIXME: m_dataTransfer is not set to 0 here. }
void DeviceOrientationEvent::initDeviceOrientationEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceOrientationData* orientation) { if (dispatched()) return; initEvent(type, bubbles, cancelable); m_orientation = orientation; }
void WebGLContextEvent::initEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& statusMessage) { if (dispatched()) return; Event::initEvent(type, canBubble, cancelable); m_statusMessage = statusMessage; }
void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData* deviceMotionData) { if (dispatched()) return; initEvent(type, bubbles, cancelable); m_deviceMotionData = deviceMotionData; }
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, ScriptValue detail) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_detail = detail; }
void Event::InitEvent(EventType type, bool canBubble, bool cancelable) { if (dispatched()) return; type_ = type; can_bubble_ = canBubble; cancelable_ = cancelable; }
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedDetail) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_serializedDetail = serializedDetail; }
void TextEvent::initTextEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<AbstractView> view, const String& data) { if (dispatched()) return; initUIEvent(type, canBubble, cancelable, view, 0); m_data = data; }
void OverflowEvent::initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow) { if (dispatched()) return; m_orient = orient; m_horizontalOverflow = horizontalOverflow; m_verticalOverflow = verticalOverflow; }
void PopStateEvent::initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& state) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_state = state; }
void PopStateEvent::initPopStateEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> stateObject) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_stateObject = stateObject; }
void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) { if (dispatched()) return; m_type = eventTypeArg; m_canBubble = canBubbleArg; m_cancelable = cancelableArg; }
void CompositionEvent::initCompositionEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtrWillBeRawPtr<AbstractView> view, const String& data) { if (dispatched()) return; initUIEvent(type, canBubble, cancelable, view, 0); m_data = data; initializeSegments(); }
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, PassRefPtr<SerializedScriptValue> serializedScriptValue) { ASSERT(m_detail.hasNoValue()); if (dispatched()) return; initEvent(type, canBubble, cancelable); m_serializedScriptValue = serializedScriptValue; }
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const ScriptValue& detail) { ASSERT(!m_serializedScriptValue.get()); if (dispatched()) return; initEvent(type, canBubble, cancelable); m_detail = detail; }
void UIEvent::initUIEvent(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg, AbstractView* viewArg, int detailArg) { if (dispatched()) return; initEvent(typeArg, canBubbleArg, cancelableArg); m_view = viewArg; m_detail = detailArg; }
void OverflowEvent::initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow) { if (dispatched()) return; initEvent(eventNames().overflowchangedEvent, false, false); m_orient = orient; m_horizontalOverflow = horizontalOverflow; m_verticalOverflow = verticalOverflow; }
void CustomEvent::initCustomEvent(const AtomicString& type, bool canBubble, bool cancelable, const Deprecated::ScriptValue& detail) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_detail = detail; m_serializedDetail = nullptr; m_triedToSerialize = false; }
void UIEvent::initUIEventInternal(const AtomicString& typeArg, bool canBubbleArg, bool cancelableArg, PassRefPtrWillBeRawPtr<AbstractView> viewArg, int detailArg, InputDeviceCapabilities* sourceCapabilitiesArg) { if (dispatched()) return; initEvent(typeArg, canBubbleArg, cancelableArg); m_view = viewArg; m_detail = detailArg; m_sourceCapabilities = sourceCapabilitiesArg; }
void CustomEvent::initCustomEvent(JSC::ExecState& state, const AtomicString& type, bool canBubble, bool cancelable, JSC::JSValue detail) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_detail = { state.vm(), detail }; m_serializedDetail = nullptr; m_triedToSerialize = false; }
void ErrorEvent::initErrorEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& message, const String& fileName, unsigned lineNumber) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_message = message; m_fileName = fileName; m_lineNumber = lineNumber; }
void PageTransitionEvent::initPageTransitionEvent(const AtomicString& type, bool canBubbleArg, bool cancelableArg, bool persisted) { if (dispatched()) return; initEvent(type, canBubbleArg, cancelableArg); m_persisted = persisted; }
void DeviceMotionEvent::initDeviceMotionEvent(const AtomicString& type, bool bubbles, bool cancelable, DeviceMotionData* deviceMotionData) { if (dispatched()) return; initEvent(type, bubbles, cancelable); m_deviceMotionData = deviceMotionData; m_acceleration.clear(); m_accelerationIncludingGravity.clear(); m_rotationRate.clear(); }
void MessageEvent::initMessageEvent(const AtomicString& type, bool canBubble, bool cancelable, const String& origin, const String& lastEventId, LocalDOMWindow* source, PassOwnPtr<MessagePortArray> ports) { if (dispatched()) return; initEvent(type, canBubble, cancelable); m_dataType = DataTypeScriptValue; m_origin = origin; m_lastEventId = lastEventId; m_source = source; m_ports = ports; }
void Event::initEvent(const AtomicString& eventTypeArg, bool canBubbleArg, bool cancelableArg) { if (dispatched()) return; m_propagationStopped = false; m_immediatePropagationStopped = false; m_defaultPrevented = false; m_type = eventTypeArg; m_canBubble = canBubbleArg; m_cancelable = cancelableArg; }