@lwc/synthetic-shadow 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/env/document.d.ts +2 -2
- package/dist/faux-shadow/node.d.ts +0 -7
- package/dist/faux-shadow/shadow-root.d.ts +0 -7
- package/dist/index.cjs.js +31 -316
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.d.ts +0 -2
- package/dist/index.js +31 -316
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/polyfills/iframe-content-window/detect.d.ts +0 -1
- package/dist/polyfills/iframe-content-window/main.d.ts +0 -1
- package/dist/polyfills/iframe-content-window/patch.d.ts +0 -1
- package/dist/polyfills/window-event-target/detect.d.ts +0 -1
- package/dist/polyfills/window-event-target/main.d.ts +0 -1
- package/dist/polyfills/window-event-target/polyfill.d.ts +0 -1
package/dist/env/document.d.ts
CHANGED
@@ -2,7 +2,7 @@ declare const DocumentPrototypeActiveElement: (this: Document) => Element | null
|
|
2
2
|
declare const elementFromPoint: (x: number, y: number) => Element | null;
|
3
3
|
declare const elementsFromPoint: (x: number, y: number) => Element[];
|
4
4
|
declare const defaultViewGetter: (this: Document) => Window | null;
|
5
|
-
declare const
|
5
|
+
declare const querySelectorAll: {
|
6
6
|
<K extends keyof HTMLElementTagNameMap>(selectors: K): NodeListOf<HTMLElementTagNameMap[K]>;
|
7
7
|
<K_1 extends keyof SVGElementTagNameMap>(selectors: K_1): NodeListOf<SVGElementTagNameMap[K_1]>;
|
8
8
|
<K_2 extends keyof MathMLElementTagNameMap>(selectors: K_2): NodeListOf<MathMLElementTagNameMap[K_2]>;
|
@@ -21,4 +21,4 @@ declare const createComment: (data: string) => Comment, querySelectorAll: {
|
|
21
21
|
(namespace: string | null, localName: string): HTMLCollectionOf<Element>;
|
22
22
|
};
|
23
23
|
declare const getElementsByName: (elementName: string) => NodeListOf<HTMLElement>;
|
24
|
-
export { elementFromPoint, elementsFromPoint,
|
24
|
+
export { elementFromPoint, elementsFromPoint, DocumentPrototypeActiveElement, querySelectorAll, getElementById, getElementsByClassName, getElementsByName, getElementsByTagName, getElementsByTagNameNS, defaultViewGetter, };
|
@@ -5,11 +5,4 @@
|
|
5
5
|
* because we don't want to patch the children getters for those elements.
|
6
6
|
*/
|
7
7
|
export declare function hasMountedChildren(node: Node): boolean;
|
8
|
-
/**
|
9
|
-
* These 2 methods are providing a machinery to understand who is accessing the
|
10
|
-
* .childNodes member property of a node. If it is used from inside the synthetic shadow
|
11
|
-
* or from an external invoker. This helps to produce the right output in one very peculiar
|
12
|
-
* case, the IE11 debugging comment for shadowRoot representation on the devtool.
|
13
|
-
*/
|
14
|
-
export declare function isExternalChildNodeAccessorFlagOn(): boolean;
|
15
8
|
export declare const getInternalChildNodes: (node: Node) => NodeListOf<ChildNode>;
|
@@ -13,10 +13,3 @@ export declare function SyntheticShadowRoot(): void;
|
|
13
13
|
export declare namespace SyntheticShadowRoot {
|
14
14
|
var prototype: any;
|
15
15
|
}
|
16
|
-
/**
|
17
|
-
* This method is only intended to be used in non-production mode in IE11
|
18
|
-
* and its role is to produce a 1-1 mapping between a shadowRoot instance
|
19
|
-
* and a comment node that is intended to use to trick the IE11 DevTools
|
20
|
-
* to show the content of the shadowRoot in the DOM Explorer.
|
21
|
-
*/
|
22
|
-
export declare function getIE11FakeShadowRootPlaceholder(host: Element): Comment;
|
package/dist/index.cjs.js
CHANGED
@@ -114,17 +114,7 @@ const KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
114
114
|
const KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
115
115
|
const KEY__NATIVE_GET_ELEMENT_BY_ID = '$nativeGetElementById$';
|
116
116
|
const KEY__NATIVE_QUERY_SELECTOR_ALL = '$nativeQuerySelectorAll$';
|
117
|
-
|
118
|
-
/*
|
119
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
120
|
-
* All rights reserved.
|
121
|
-
* SPDX-License-Identifier: MIT
|
122
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
123
|
-
*/
|
124
|
-
// We use this to detect symbol support in order to avoid the expensive symbol polyfill. Note that
|
125
|
-
// we can't use typeof since it will fail when transpiling.
|
126
|
-
const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === 'Symbol(x)')();
|
127
|
-
/** version: 3.0.1 */
|
117
|
+
/** version: 3.1.0 */
|
128
118
|
|
129
119
|
/**
|
130
120
|
* Copyright (C) 2023 salesforce.com, inc.
|
@@ -133,7 +123,7 @@ const hasNativeSymbolSupport = /*@__PURE__*/ (() => Symbol('x').toString() === '
|
|
133
123
|
if (!_globalThis.lwcRuntimeFlags) {
|
134
124
|
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', { value: create(null) });
|
135
125
|
}
|
136
|
-
/** version: 3.0
|
126
|
+
/** version: 3.1.0 */
|
137
127
|
|
138
128
|
/*
|
139
129
|
* Copyright (c) 2018, salesforce.com, inc.
|
@@ -153,13 +143,9 @@ const lastChildGetter = getOwnPropertyDescriptor(nodePrototype, 'lastChild').get
|
|
153
143
|
const textContentGetter = getOwnPropertyDescriptor(nodePrototype, 'textContent').get;
|
154
144
|
const parentNodeGetter = getOwnPropertyDescriptor(nodePrototype, 'parentNode').get;
|
155
145
|
const ownerDocumentGetter = getOwnPropertyDescriptor(nodePrototype, 'ownerDocument').get;
|
156
|
-
const parentElementGetter =
|
157
|
-
? getOwnPropertyDescriptor(nodePrototype, 'parentElement').get
|
158
|
-
: getOwnPropertyDescriptor(HTMLElement.prototype, 'parentElement').get; // IE11
|
146
|
+
const parentElementGetter = getOwnPropertyDescriptor(nodePrototype, 'parentElement').get;
|
159
147
|
const textContextSetter = getOwnPropertyDescriptor(nodePrototype, 'textContent').set;
|
160
|
-
const childNodesGetter =
|
161
|
-
? getOwnPropertyDescriptor(nodePrototype, 'childNodes').get
|
162
|
-
: getOwnPropertyDescriptor(HTMLElement.prototype, 'childNodes').get; // IE11
|
148
|
+
const childNodesGetter = getOwnPropertyDescriptor(nodePrototype, 'childNodes').get;
|
163
149
|
const isConnected = hasOwnProperty.call(nodePrototype, 'isConnected')
|
164
150
|
? getOwnPropertyDescriptor(nodePrototype, 'isConnected').get
|
165
151
|
: function () {
|
@@ -202,26 +188,18 @@ const outerTextGetter = outerTextDescriptor
|
|
202
188
|
const outerTextSetter = outerTextDescriptor
|
203
189
|
? outerTextDescriptor.set
|
204
190
|
: null;
|
205
|
-
const innerHTMLDescriptor =
|
206
|
-
? getOwnPropertyDescriptor(Element.prototype, 'innerHTML')
|
207
|
-
: getOwnPropertyDescriptor(HTMLElement.prototype, 'innerHTML'); // IE11
|
191
|
+
const innerHTMLDescriptor = getOwnPropertyDescriptor(Element.prototype, 'innerHTML');
|
208
192
|
const innerHTMLGetter = innerHTMLDescriptor.get;
|
209
193
|
const innerHTMLSetter = innerHTMLDescriptor.set;
|
210
|
-
const outerHTMLDescriptor =
|
211
|
-
? getOwnPropertyDescriptor(Element.prototype, 'outerHTML')
|
212
|
-
: getOwnPropertyDescriptor(HTMLElement.prototype, 'outerHTML'); // IE11
|
194
|
+
const outerHTMLDescriptor = getOwnPropertyDescriptor(Element.prototype, 'outerHTML');
|
213
195
|
const outerHTMLGetter = outerHTMLDescriptor.get;
|
214
196
|
const outerHTMLSetter = outerHTMLDescriptor.set;
|
215
197
|
const tagNameGetter = getOwnPropertyDescriptor(Element.prototype, 'tagName').get;
|
216
198
|
const tabIndexDescriptor = getOwnPropertyDescriptor(HTMLElement.prototype, 'tabIndex');
|
217
199
|
const tabIndexGetter = tabIndexDescriptor.get;
|
218
200
|
const tabIndexSetter = tabIndexDescriptor.set;
|
219
|
-
const matches =
|
220
|
-
|
221
|
-
: Element.prototype.msMatchesSelector; // IE11
|
222
|
-
const childrenGetter = hasOwnProperty.call(Element.prototype, 'children')
|
223
|
-
? getOwnPropertyDescriptor(Element.prototype, 'children').get
|
224
|
-
: getOwnPropertyDescriptor(HTMLElement.prototype, 'children').get; // IE11
|
201
|
+
const matches = Element.prototype.matches;
|
202
|
+
const childrenGetter = getOwnPropertyDescriptor(Element.prototype, 'children').get;
|
225
203
|
// for IE11, access from HTMLElement
|
226
204
|
// for all other browsers access the method from the parent Element interface
|
227
205
|
const { getElementsByClassName: getElementsByClassName$1 } = HTMLElement.prototype;
|
@@ -275,16 +253,12 @@ const composedPath = hasOwnProperty.call(Event.prototype, 'composedPath')
|
|
275
253
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
276
254
|
*/
|
277
255
|
const DocumentPrototypeActiveElement = getOwnPropertyDescriptor(Document.prototype, 'activeElement').get;
|
278
|
-
const elementFromPoint =
|
279
|
-
|
280
|
-
: Document.prototype.msElementFromPoint; // IE11
|
281
|
-
const elementsFromPoint = hasOwnProperty.call(Document.prototype, 'elementsFromPoint')
|
282
|
-
? Document.prototype.elementsFromPoint
|
283
|
-
: Document.prototype.msElementsFromPoint; // IE11
|
256
|
+
const elementFromPoint = Document.prototype.elementFromPoint;
|
257
|
+
const elementsFromPoint = Document.prototype.elementsFromPoint;
|
284
258
|
// defaultView can be null when a document has no browsing context. For example, the owner document
|
285
259
|
// of a node in a template doesn't have a default view: https://jsfiddle.net/hv9z0q5a/
|
286
260
|
const defaultViewGetter = getOwnPropertyDescriptor(Document.prototype, 'defaultView').get;
|
287
|
-
const {
|
261
|
+
const { querySelectorAll, getElementById, getElementsByClassName, getElementsByTagName, getElementsByTagNameNS, } = Document.prototype;
|
288
262
|
// In Firefox v57 and lower, getElementsByName is defined on HTMLDocument.prototype
|
289
263
|
// In all other browsers have the method on Document.prototype
|
290
264
|
const { getElementsByName } = HTMLDocument.prototype;
|
@@ -330,7 +304,7 @@ const isInstanceOfNativeShadowRoot = isNull(NativeShadowRoot)
|
|
330
304
|
* SPDX-License-Identifier: MIT
|
331
305
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
332
306
|
*/
|
333
|
-
function detect$
|
307
|
+
function detect$2 () {
|
334
308
|
return typeof HTMLSlotElement === 'undefined';
|
335
309
|
}
|
336
310
|
|
@@ -345,7 +319,7 @@ const CHAR_S = 115;
|
|
345
319
|
const CHAR_L = 108;
|
346
320
|
const CHAR_O = 111;
|
347
321
|
const CHAR_T = 116;
|
348
|
-
function apply$
|
322
|
+
function apply$2() {
|
349
323
|
// IE11 does not have this element definition
|
350
324
|
// we don't care much about the construction phase, just the prototype
|
351
325
|
class HTMLSlotElement {
|
@@ -380,8 +354,8 @@ function apply$4() {
|
|
380
354
|
* SPDX-License-Identifier: MIT
|
381
355
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
382
356
|
*/
|
383
|
-
if (detect$
|
384
|
-
apply$
|
357
|
+
if (detect$2()) {
|
358
|
+
apply$2();
|
385
359
|
}
|
386
360
|
|
387
361
|
/*
|
@@ -1282,15 +1256,6 @@ function childNodesGetterPatched() {
|
|
1282
1256
|
if (isSyntheticShadowHost(this)) {
|
1283
1257
|
const owner = getNodeOwner(this);
|
1284
1258
|
const childNodes = isNull(owner) ? [] : getAllMatches(owner, getFilteredChildNodes(this));
|
1285
|
-
if (process.env.NODE_ENV !== 'production' &&
|
1286
|
-
isFalse(hasNativeSymbolSupport) &&
|
1287
|
-
isExternalChildNodeAccessorFlagOn()) {
|
1288
|
-
// inserting a comment node as the first childNode to trick the IE11
|
1289
|
-
// DevTool to show the content of the shadowRoot, this should only happen
|
1290
|
-
// in dev-mode and in IE11 (which we detect by looking at the symbol).
|
1291
|
-
// Plus it should only be in place if we know it is an external invoker.
|
1292
|
-
ArrayUnshift.call(childNodes, getIE11FakeShadowRootPlaceholder(this));
|
1293
|
-
}
|
1294
1259
|
return createStaticNodeList(childNodes);
|
1295
1260
|
}
|
1296
1261
|
// nothing to do here since this does not have a synthetic shadow attached to it
|
@@ -1505,40 +1470,9 @@ defineProperties(_Node.prototype, {
|
|
1505
1470
|
},
|
1506
1471
|
},
|
1507
1472
|
});
|
1508
|
-
|
1509
|
-
|
1510
|
-
|
1511
|
-
* .childNodes member property of a node. If it is used from inside the synthetic shadow
|
1512
|
-
* or from an external invoker. This helps to produce the right output in one very peculiar
|
1513
|
-
* case, the IE11 debugging comment for shadowRoot representation on the devtool.
|
1514
|
-
*/
|
1515
|
-
function isExternalChildNodeAccessorFlagOn() {
|
1516
|
-
return !internalChildNodeAccessorFlag;
|
1517
|
-
}
|
1518
|
-
const getInternalChildNodes = process.env.NODE_ENV !== 'production' && isFalse(hasNativeSymbolSupport)
|
1519
|
-
? function (node) {
|
1520
|
-
internalChildNodeAccessorFlag = true;
|
1521
|
-
let childNodes;
|
1522
|
-
let error = null;
|
1523
|
-
try {
|
1524
|
-
childNodes = node.childNodes;
|
1525
|
-
}
|
1526
|
-
catch (e) {
|
1527
|
-
// childNodes accessor should never throw, but just in case!
|
1528
|
-
error = e;
|
1529
|
-
}
|
1530
|
-
finally {
|
1531
|
-
internalChildNodeAccessorFlag = false;
|
1532
|
-
if (!isNull(error)) {
|
1533
|
-
// re-throwing after restoring the state machinery for setInternalChildNodeAccessorFlag
|
1534
|
-
throw error; // eslint-disable-line no-unsafe-finally
|
1535
|
-
}
|
1536
|
-
}
|
1537
|
-
return childNodes;
|
1538
|
-
}
|
1539
|
-
: function (node) {
|
1540
|
-
return node.childNodes;
|
1541
|
-
};
|
1473
|
+
const getInternalChildNodes = function (node) {
|
1474
|
+
return node.childNodes;
|
1475
|
+
};
|
1542
1476
|
// IE11 extra patches for wrong prototypes
|
1543
1477
|
if (hasOwnProperty.call(HTMLElement.prototype, 'contains')) {
|
1544
1478
|
defineProperty(HTMLElement.prototype, 'contains', getOwnPropertyDescriptor(_Node.prototype, 'contains'));
|
@@ -2346,42 +2280,6 @@ defineProperty(SyntheticShadowRoot, Symbol.hasInstance, {
|
|
2346
2280
|
getPrototypeOf(object) === SyntheticShadowRoot.prototype));
|
2347
2281
|
},
|
2348
2282
|
});
|
2349
|
-
/**
|
2350
|
-
* This method is only intended to be used in non-production mode in IE11
|
2351
|
-
* and its role is to produce a 1-1 mapping between a shadowRoot instance
|
2352
|
-
* and a comment node that is intended to use to trick the IE11 DevTools
|
2353
|
-
* to show the content of the shadowRoot in the DOM Explorer.
|
2354
|
-
*/
|
2355
|
-
function getIE11FakeShadowRootPlaceholder(host) {
|
2356
|
-
const shadowRoot = getShadowRoot(host);
|
2357
|
-
// @ts-ignore this $$placeholder$$ is not a security issue because you must
|
2358
|
-
// have access to the shadowRoot in order to extract the fake node, which give
|
2359
|
-
// you access to the same childNodes of the shadowRoot, so, who cares.
|
2360
|
-
let c = shadowRoot.$$placeholder$$;
|
2361
|
-
if (!isUndefined(c)) {
|
2362
|
-
return c;
|
2363
|
-
}
|
2364
|
-
const doc = getOwnerDocument(host);
|
2365
|
-
// @ts-ignore $$placeholder$$ is fine, read the node above.
|
2366
|
-
c = shadowRoot.$$placeholder$$ = createComment.call(doc, '');
|
2367
|
-
defineProperties(c, {
|
2368
|
-
childNodes: {
|
2369
|
-
get() {
|
2370
|
-
return shadowRoot.childNodes;
|
2371
|
-
},
|
2372
|
-
enumerable: true,
|
2373
|
-
configurable: true,
|
2374
|
-
},
|
2375
|
-
tagName: {
|
2376
|
-
get() {
|
2377
|
-
return `#shadow-root (${shadowRoot.mode})`;
|
2378
|
-
},
|
2379
|
-
enumerable: true,
|
2380
|
-
configurable: true,
|
2381
|
-
},
|
2382
|
-
});
|
2383
|
-
return c;
|
2384
|
-
}
|
2385
2283
|
|
2386
2284
|
/*
|
2387
2285
|
* Copyright (c) 2018, salesforce.com, inc.
|
@@ -2660,7 +2558,7 @@ Object.defineProperty(window, 'ShadowRoot', {
|
|
2660
2558
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2661
2559
|
*/
|
2662
2560
|
const composedDescriptor = Object.getOwnPropertyDescriptor(Event.prototype, 'composed');
|
2663
|
-
function detect$
|
2561
|
+
function detect$1() {
|
2664
2562
|
if (!composedDescriptor) {
|
2665
2563
|
// No need to apply this polyfill if this client completely lacks
|
2666
2564
|
// support for the composed property.
|
@@ -2692,7 +2590,7 @@ function handleClick(event) {
|
|
2692
2590
|
},
|
2693
2591
|
});
|
2694
2592
|
}
|
2695
|
-
function apply$
|
2593
|
+
function apply$1() {
|
2696
2594
|
HTMLElement.prototype.click = function () {
|
2697
2595
|
addEventListener.call(this, 'click', handleClick);
|
2698
2596
|
try {
|
@@ -2710,8 +2608,8 @@ function apply$3() {
|
|
2710
2608
|
* SPDX-License-Identifier: MIT
|
2711
2609
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2712
2610
|
*/
|
2713
|
-
if (detect$
|
2714
|
-
apply$
|
2611
|
+
if (detect$1()) {
|
2612
|
+
apply$1();
|
2715
2613
|
}
|
2716
2614
|
|
2717
2615
|
/*
|
@@ -2720,7 +2618,7 @@ if (detect$3()) {
|
|
2720
2618
|
* SPDX-License-Identifier: MIT
|
2721
2619
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2722
2620
|
*/
|
2723
|
-
function detect
|
2621
|
+
function detect() {
|
2724
2622
|
return new Event('test', { composed: true }).composed !== true;
|
2725
2623
|
}
|
2726
2624
|
|
@@ -2730,7 +2628,7 @@ function detect$2() {
|
|
2730
2628
|
* SPDX-License-Identifier: MIT
|
2731
2629
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2732
2630
|
*/
|
2733
|
-
function apply
|
2631
|
+
function apply() {
|
2734
2632
|
// https://github.com/w3c/webcomponents/issues/513#issuecomment-224183937
|
2735
2633
|
const composedEvents = assign(create(null), {
|
2736
2634
|
beforeinput: 1,
|
@@ -2824,8 +2722,8 @@ function apply$2() {
|
|
2824
2722
|
* SPDX-License-Identifier: MIT
|
2825
2723
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2826
2724
|
*/
|
2827
|
-
if (detect
|
2828
|
-
apply
|
2725
|
+
if (detect()) {
|
2726
|
+
apply();
|
2829
2727
|
}
|
2830
2728
|
|
2831
2729
|
/*
|
@@ -2877,121 +2775,6 @@ if (typeof ClipboardEvent !== 'undefined') {
|
|
2877
2775
|
});
|
2878
2776
|
}
|
2879
2777
|
|
2880
|
-
/*
|
2881
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
2882
|
-
* All rights reserved.
|
2883
|
-
* SPDX-License-Identifier: MIT
|
2884
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2885
|
-
*/
|
2886
|
-
function detect$1() {
|
2887
|
-
// Note: when using this in mobile apps, we might have a DOM that does not support iframes.
|
2888
|
-
const hasIframe = typeof HTMLIFrameElement !== 'undefined';
|
2889
|
-
// This polyfill should only apply in compat mode; see https://github.com/salesforce/lwc/issues/1513
|
2890
|
-
const isCompat = typeof Proxy !== 'undefined' && isTrue(Proxy.isCompat);
|
2891
|
-
return hasIframe && isCompat;
|
2892
|
-
}
|
2893
|
-
|
2894
|
-
/*
|
2895
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
2896
|
-
* All rights reserved.
|
2897
|
-
* SPDX-License-Identifier: MIT
|
2898
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2899
|
-
*/
|
2900
|
-
function apply$1() {
|
2901
|
-
// the iframe property descriptor for `contentWindow` should always be available, otherwise this method should never be called
|
2902
|
-
const desc = getOwnPropertyDescriptor(HTMLIFrameElement.prototype, 'contentWindow');
|
2903
|
-
const { get: originalGetter } = desc;
|
2904
|
-
desc.get = function () {
|
2905
|
-
const original = originalGetter.call(this);
|
2906
|
-
// If the original iframe element is not a keyed node, then do not wrap it
|
2907
|
-
if (isNull(original) || isUndefined(getNodeOwnerKey(this))) {
|
2908
|
-
return original;
|
2909
|
-
}
|
2910
|
-
// only if the element is an iframe inside a shadowRoot, we care about this problem
|
2911
|
-
// because in that case, the code that is accessing the iframe, is very likely code
|
2912
|
-
// compiled with proxy-compat transformation. It is true that other code without those
|
2913
|
-
// transformations might also access an iframe from within a shadowRoot, but in that,
|
2914
|
-
// case, which is more rare, we still return the wrapper, and it should work the same,
|
2915
|
-
// this part is just an optimization.
|
2916
|
-
return wrapIframeWindow(original);
|
2917
|
-
};
|
2918
|
-
defineProperty(HTMLIFrameElement.prototype, 'contentWindow', desc);
|
2919
|
-
}
|
2920
|
-
function wrapIframeWindow(win) {
|
2921
|
-
return {
|
2922
|
-
addEventListener() {
|
2923
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2924
|
-
// @ts-ignore type-mismatch
|
2925
|
-
return win.addEventListener.apply(win, arguments);
|
2926
|
-
},
|
2927
|
-
blur() {
|
2928
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2929
|
-
// @ts-ignore type-mismatch
|
2930
|
-
return win.blur.apply(win, arguments);
|
2931
|
-
},
|
2932
|
-
close() {
|
2933
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2934
|
-
// @ts-ignore type-mismatch
|
2935
|
-
return win.close.apply(win, arguments);
|
2936
|
-
},
|
2937
|
-
focus() {
|
2938
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2939
|
-
// @ts-ignore type-mismatch
|
2940
|
-
return win.focus.apply(win, arguments);
|
2941
|
-
},
|
2942
|
-
postMessage() {
|
2943
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2944
|
-
// @ts-ignore type-mismatch
|
2945
|
-
return win.postMessage.apply(win, arguments);
|
2946
|
-
},
|
2947
|
-
removeEventListener() {
|
2948
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
2949
|
-
// @ts-ignore type-mismatch
|
2950
|
-
return win.removeEventListener.apply(win, arguments);
|
2951
|
-
},
|
2952
|
-
get closed() {
|
2953
|
-
return win.closed;
|
2954
|
-
},
|
2955
|
-
get frames() {
|
2956
|
-
return win.frames;
|
2957
|
-
},
|
2958
|
-
get length() {
|
2959
|
-
return win.length;
|
2960
|
-
},
|
2961
|
-
get location() {
|
2962
|
-
return win.location;
|
2963
|
-
},
|
2964
|
-
set location(value) {
|
2965
|
-
win.location = value;
|
2966
|
-
},
|
2967
|
-
get opener() {
|
2968
|
-
return win.opener;
|
2969
|
-
},
|
2970
|
-
get parent() {
|
2971
|
-
return win.parent;
|
2972
|
-
},
|
2973
|
-
get self() {
|
2974
|
-
return win.self;
|
2975
|
-
},
|
2976
|
-
get top() {
|
2977
|
-
return win.top;
|
2978
|
-
},
|
2979
|
-
get window() {
|
2980
|
-
return win.window;
|
2981
|
-
},
|
2982
|
-
}; // this is limited
|
2983
|
-
}
|
2984
|
-
|
2985
|
-
/*
|
2986
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
2987
|
-
* All rights reserved.
|
2988
|
-
* SPDX-License-Identifier: MIT
|
2989
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
2990
|
-
*/
|
2991
|
-
if (detect$1()) {
|
2992
|
-
apply$1();
|
2993
|
-
}
|
2994
|
-
|
2995
2778
|
/*
|
2996
2779
|
* Copyright (c) 2018, salesforce.com, inc.
|
2997
2780
|
* All rights reserved.
|
@@ -3233,7 +3016,7 @@ defineProperty(window, 'MutationObserver', {
|
|
3233
3016
|
* SPDX-License-Identifier: MIT
|
3234
3017
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
3235
3018
|
*/
|
3236
|
-
function patchedAddEventListener
|
3019
|
+
function patchedAddEventListener(type, listener, optionsOrCapture) {
|
3237
3020
|
if (isSyntheticShadowHost(this)) {
|
3238
3021
|
// Typescript does not like it when you treat the `arguments` object as an array
|
3239
3022
|
// @ts-ignore type-mismatch
|
@@ -3256,7 +3039,7 @@ function patchedAddEventListener$1(type, listener, optionsOrCapture) {
|
|
3256
3039
|
// The third argument is optional, so passing in `undefined` for `optionsOrCapture` gives capture=false
|
3257
3040
|
return addEventListener.call(this, type, wrappedListener, optionsOrCapture);
|
3258
3041
|
}
|
3259
|
-
function patchedRemoveEventListener
|
3042
|
+
function patchedRemoveEventListener(_type, _listener, _optionsOrCapture) {
|
3260
3043
|
if (isSyntheticShadowHost(this)) {
|
3261
3044
|
// Typescript does not like it when you treat the `arguments` object as an array
|
3262
3045
|
// @ts-ignore type-mismatch
|
@@ -3276,87 +3059,19 @@ function patchedRemoveEventListener$1(_type, _listener, _optionsOrCapture) {
|
|
3276
3059
|
}
|
3277
3060
|
defineProperties(eventTargetPrototype, {
|
3278
3061
|
addEventListener: {
|
3279
|
-
value: patchedAddEventListener
|
3062
|
+
value: patchedAddEventListener,
|
3280
3063
|
enumerable: true,
|
3281
3064
|
writable: true,
|
3282
3065
|
configurable: true,
|
3283
3066
|
},
|
3284
3067
|
removeEventListener: {
|
3285
|
-
value: patchedRemoveEventListener
|
3068
|
+
value: patchedRemoveEventListener,
|
3286
3069
|
enumerable: true,
|
3287
3070
|
writable: true,
|
3288
3071
|
configurable: true,
|
3289
3072
|
},
|
3290
3073
|
});
|
3291
3074
|
|
3292
|
-
/*
|
3293
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
3294
|
-
* All rights reserved.
|
3295
|
-
* SPDX-License-Identifier: MIT
|
3296
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
3297
|
-
*/
|
3298
|
-
function detect() {
|
3299
|
-
return typeof EventTarget === 'undefined';
|
3300
|
-
}
|
3301
|
-
|
3302
|
-
/*
|
3303
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
3304
|
-
* All rights reserved.
|
3305
|
-
* SPDX-License-Identifier: MIT
|
3306
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
3307
|
-
*/
|
3308
|
-
function patchedAddEventListener(_type, _listener, _options) {
|
3309
|
-
if (arguments.length > 1) {
|
3310
|
-
const args = ArraySlice.call(arguments);
|
3311
|
-
args[1] = getEventListenerWrapper(args[1]);
|
3312
|
-
// Ignore types because we're passing through to native method
|
3313
|
-
// @ts-ignore type-mismatch
|
3314
|
-
return windowAddEventListener.apply(this, args);
|
3315
|
-
}
|
3316
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
3317
|
-
// @ts-ignore type-mismatch
|
3318
|
-
return windowAddEventListener.apply(this, arguments);
|
3319
|
-
}
|
3320
|
-
function patchedRemoveEventListener(_type, _listener, _options) {
|
3321
|
-
if (arguments.length > 1) {
|
3322
|
-
const args = ArraySlice.call(arguments);
|
3323
|
-
args[1] = getEventListenerWrapper(args[1]);
|
3324
|
-
// Ignore types because we're passing through to native method
|
3325
|
-
// @ts-ignore type-mismatch
|
3326
|
-
windowRemoveEventListener.apply(this, args);
|
3327
|
-
}
|
3328
|
-
// Account for listeners that were added before this polyfill was applied
|
3329
|
-
// Typescript does not like it when you treat the `arguments` object as an array
|
3330
|
-
// @ts-ignore type-mismatch
|
3331
|
-
windowRemoveEventListener.apply(this, arguments);
|
3332
|
-
}
|
3333
|
-
function apply() {
|
3334
|
-
defineProperties(Window.prototype, {
|
3335
|
-
addEventListener: {
|
3336
|
-
value: patchedAddEventListener,
|
3337
|
-
enumerable: true,
|
3338
|
-
writable: true,
|
3339
|
-
configurable: true,
|
3340
|
-
},
|
3341
|
-
removeEventListener: {
|
3342
|
-
value: patchedRemoveEventListener,
|
3343
|
-
enumerable: true,
|
3344
|
-
writable: true,
|
3345
|
-
configurable: true,
|
3346
|
-
},
|
3347
|
-
});
|
3348
|
-
}
|
3349
|
-
|
3350
|
-
/*
|
3351
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
3352
|
-
* All rights reserved.
|
3353
|
-
* SPDX-License-Identifier: MIT
|
3354
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
3355
|
-
*/
|
3356
|
-
if (detect()) {
|
3357
|
-
apply();
|
3358
|
-
}
|
3359
|
-
|
3360
3075
|
/*
|
3361
3076
|
* Copyright (c) 2018, salesforce.com, inc.
|
3362
3077
|
* All rights reserved.
|
@@ -4752,5 +4467,5 @@ defineProperty(Element.prototype, '$domManual$', {
|
|
4752
4467
|
},
|
4753
4468
|
configurable: true,
|
4754
4469
|
});
|
4755
|
-
/** version: 3.0
|
4470
|
+
/** version: 3.1.0 */
|
4756
4471
|
//# sourceMappingURL=index.cjs.js.map
|