Sha256: 757cffb3a351f8849f34f402b84a12d9094ec6f61996f5dbc204a9c593b0abc3
Contents?: true
Size: 1.92 KB
Versions: 26
Compression:
Stored size: 1.92 KB
Contents
"use strict"; const { mixin } = require("../../utils"); const EventModifierMixinImpl = require("./EventModifierMixin-impl").implementation; const UIEventImpl = require("./UIEvent-impl").implementation; const MouseEventInit = require("../generated/MouseEventInit"); class MouseEventImpl extends UIEventImpl { get x() { return this.clientX; } get y() { return this.clientY; } get pageX() { // TODO: consider dispatch flag and return page-relative event coordinate once layout is supported return this.clientX; // TODO: add horizontal scroll offset once jsdom implements scrolling support } get pageY() { // TODO: consider dispatch flag and return page-relative event coordinate once layout is supported return this.clientY; // TODO: add vertical scroll offset once jsdom implements scrolling support } get offsetX() { // TODO: consider dispatch flag and return target-relative event coordinate once layout is supported return this.pageX; } get offsetY() { // TODO: consider dispatch flag and return target-relative event coordinate once layout is supported return this.pageY; } initMouseEvent( type, bubbles, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget ) { if (this._dispatchFlag) { return; } this.initUIEvent(type, bubbles, cancelable, view, detail); this.screenX = screenX; this.screenY = screenY; this.clientX = clientX; this.clientY = clientY; this.ctrlKey = ctrlKey; this.altKey = altKey; this.shiftKey = shiftKey; this.metaKey = metaKey; this.button = button; this.relatedTarget = relatedTarget; } } mixin(MouseEventImpl.prototype, EventModifierMixinImpl.prototype); MouseEventImpl.defaultInit = MouseEventInit.convert(undefined, undefined); module.exports = { implementation: MouseEventImpl };
Version data entries
26 entries across 26 versions & 1 rubygems