Sha256: 348375960d4ad9048752e21843d984cf564a8082fd845532e8ff2eeba488760a

Contents?: true

Size: 966 Bytes

Versions: 25

Compression:

Stored size: 966 Bytes

Contents

"use strict";

// This mixin doesn't have an IDL equivalent, but since MouseEvent and KeyboardEvent implement getModifierState() the
// same way, its implementation is shared here.

class EventModifierMixinImpl {
  // Event's constructor assumes all options correspond to IDL attributes with the same names, and sets them on `this`.
  // That is not the case for these modifier boolean options, but since the options are set on `this` anyway we'll
  // access them that way. The spec doesn't say much about the case where keyArg is not one of the valid ones
  // (https://w3c.github.io/uievents-key/#keys-modifier), but at least Chrome returns false for invalid modifiers. Since
  // these invalid modifiers will be undefined on `this` (thus `false` after casting it to boolean), we don't need to do
  // extra checking for validity.
  getModifierState(keyArg) {
    return Boolean(this[`modifier${keyArg}`]);
  }
}

exports.implementation = EventModifierMixinImpl;

Version data entries

25 entries across 22 versions & 2 rubygems

Version Path
appmap-0.72.2 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.72.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.72.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.71.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.70.2 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.70.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.70.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.69.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.68.2 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.68.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.68.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.67.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.67.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.66.2 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.66.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.66.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.65.1 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.65.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.64.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js
appmap-0.63.0 ./node_modules/jsdom/lib/jsdom/living/events/EventModifierMixin-impl.js