-
-
Notifications
You must be signed in to change notification settings - Fork 755
/
jsdom+19.0.0.patch
135 lines (126 loc) · 4.8 KB
/
jsdom+19.0.0.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
diff --git a/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js b/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js
index d9df3cd..8d34a3d 100644
--- a/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js
+++ b/node_modules/jsdom/lib/jsdom/living/events/InputEvent-impl.js
@@ -3,7 +3,21 @@ const UIEventImpl = require("./UIEvent-impl").implementation;
const InputEventInit = require("../generated/InputEventInit");
// https://w3c.github.io/uievents/#interface-inputevent
-class InputEventImpl extends UIEventImpl { }
+class InputEventImpl extends UIEventImpl {
+ initInputEvent(type, bubbles, cancelable, data, isComposing) {
+ if (this._dispatchFlag) {
+ return;
+ }
+
+ this.initUIEvent(type, bubbles, cancelable);
+ this.data = data;
+ this.isComposing = isComposing;
+ }
+
+ getTargetRanges() {
+ return []
+ }
+}
InputEventImpl.defaultInit = InputEventInit.convert(undefined, undefined);
module.exports = {
diff --git a/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js b/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js
index ca8c6c2..669f596 100644
--- a/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js
+++ b/node_modules/jsdom/lib/jsdom/living/generated/InputEvent.js
@@ -116,6 +116,15 @@ exports.install = (globalObject, globalNames) => {
return exports.setup(Object.create(new.target.prototype), globalObject, args);
}
+ getTargetRanges() {
+ const esValue = this !== null && this !== undefined ? this : globalObject;
+ if (!exports.is(esValue)) {
+ throw new TypeError("'getTargetRanges' called on an object that is not a valid instance of InputEvent.");
+ }
+
+ return utils.tryWrapperForImpl(esValue[implSymbol].getTargetRanges());
+ }
+
get data() {
const esValue = this !== null && this !== undefined ? this : globalObject;
@@ -149,11 +158,23 @@ exports.install = (globalObject, globalNames) => {
return esValue[implSymbol]["inputType"];
}
+
+ get dataTransfer() {
+ const esValue = this !== null && this !== undefined ? this : globalObject;
+
+ if (!exports.is(esValue)) {
+ throw new TypeError("'get dataTransfer' called on an object that is not a valid instance of InputEvent.");
+ }
+
+ return utils.tryWrapperForImpl(esValue[implSymbol]["dataTransfer"]);
+ }
}
Object.defineProperties(InputEvent.prototype, {
+ getTargetRanges: { enumerable: true },
data: { enumerable: true },
isComposing: { enumerable: true },
inputType: { enumerable: true },
+ dataTransfer: { enumerable: true },
[Symbol.toStringTag]: { value: "InputEvent", configurable: true }
});
ctorRegistry[interfaceName] = InputEvent;
diff --git a/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js b/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js
index 480be50..e1da617 100644
--- a/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js
+++ b/node_modules/jsdom/lib/jsdom/living/generated/InputEventInit.js
@@ -3,6 +3,7 @@
const conversions = require("webidl-conversions");
const utils = require("./utils.js");
+const StaticRange = require("./StaticRange.js");
const UIEventInit = require("./UIEventInit.js");
exports._convertInherit = (globalObject, obj, ret, { context = "The provided value" } = {}) => {
@@ -26,6 +27,21 @@ exports._convertInherit = (globalObject, obj, ret, { context = "The provided val
}
}
+ {
+ const key = "dataTransfer";
+ let value = obj === undefined || obj === null ? undefined : obj[key];
+ if (value !== undefined) {
+ if (value === null || value === undefined) {
+ value = null;
+ } else {
+ value = utils.tryImplForWrapper(value);
+ }
+ ret[key] = value;
+ } else {
+ ret[key] = null;
+ }
+ }
+
{
const key = "inputType";
let value = obj === undefined || obj === null ? undefined : obj[key];
@@ -55,6 +71,29 @@ exports._convertInherit = (globalObject, obj, ret, { context = "The provided val
ret[key] = false;
}
}
+
+ {
+ const key = "targetRanges";
+ let value = obj === undefined || obj === null ? undefined : obj[key];
+ if (value !== undefined) {
+ if (!utils.isObject(value)) {
+ throw new TypeError(context + " has member 'targetRanges' that" + " is not an iterable object.");
+ } else {
+ const V = [];
+ const tmp = value;
+ for (let nextItem of tmp) {
+ nextItem = StaticRange.convert(nextItem, {
+ context: context + " has member 'targetRanges' that" + "'s element"
+ });
+ V.push(nextItem);
+ }
+ value = V;
+ }
+ ret[key] = value;
+ } else {
+ ret[key] = [];
+ }
+ }
};
exports.convert = (globalObject, obj, { context = "The provided value" } = {}) => {