lwc 2.31.1 → 2.32.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +237 -264
- package/dist/engine-dom/iife/es2017/engine-dom.js +237 -264
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +109 -160
- package/dist/engine-dom/iife/es5/engine-dom.js +233 -242
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +142 -199
- package/dist/engine-dom/umd/es2017/engine-dom.js +237 -264
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +109 -160
- package/dist/engine-dom/umd/es5/engine-dom.js +233 -242
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +142 -199
- package/dist/engine-server/commonjs/es2017/engine-server.js +218 -224
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
- package/dist/engine-server/esm/es2017/engine-server.js +218 -224
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +644 -882
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +85 -345
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +85 -345
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +676 -909
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +644 -882
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +85 -345
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +85 -345
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +2 -2
- package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +2 -2
- package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
- package/package.json +7 -7
|
@@ -176,7 +176,7 @@
|
|
|
176
176
|
var hasNativeSymbolSupport = /*@__PURE__*/function () {
|
|
177
177
|
return Symbol('x').toString() === 'Symbol(x)';
|
|
178
178
|
}();
|
|
179
|
-
/** version: 2.
|
|
179
|
+
/** version: 2.32.1 */
|
|
180
180
|
|
|
181
181
|
/*
|
|
182
182
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -340,9 +340,7 @@
|
|
|
340
340
|
*/
|
|
341
341
|
var _window = window,
|
|
342
342
|
windowAddEventListener = _window.addEventListener,
|
|
343
|
-
windowRemoveEventListener = _window.removeEventListener
|
|
344
|
-
windowGetComputedStyle = _window.getComputedStyle,
|
|
345
|
-
windowGetSelection = _window.getSelection;
|
|
343
|
+
windowRemoveEventListener = _window.removeEventListener;
|
|
346
344
|
|
|
347
345
|
/*
|
|
348
346
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -452,7 +450,8 @@
|
|
|
452
450
|
return win;
|
|
453
451
|
}
|
|
454
452
|
var skipGlobalPatching;
|
|
455
|
-
//
|
|
453
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
454
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
456
455
|
function isGlobalPatchingSkipped(node) {
|
|
457
456
|
// we lazily compute this value instead of doing it during evaluation, this helps
|
|
458
457
|
// for apps that are setting this after the engine code is evaluated.
|
|
@@ -493,7 +492,7 @@
|
|
|
493
492
|
});
|
|
494
493
|
}
|
|
495
494
|
var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
|
|
496
|
-
/** version: 2.
|
|
495
|
+
/** version: 2.32.1 */
|
|
497
496
|
|
|
498
497
|
/*
|
|
499
498
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1356,17 +1355,12 @@
|
|
|
1356
1355
|
},
|
|
1357
1356
|
textContent: {
|
|
1358
1357
|
get: function get() {
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
return textContentGetter.call(this);
|
|
1364
|
-
}
|
|
1365
|
-
// TODO [#1222]: remove global bypass
|
|
1366
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
1367
|
-
return textContentGetter.call(this);
|
|
1358
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
1359
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
1360
|
+
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
1361
|
+
return textContentGetterPatched.call(this);
|
|
1368
1362
|
}
|
|
1369
|
-
return
|
|
1363
|
+
return textContentGetter.call(this);
|
|
1370
1364
|
},
|
|
1371
1365
|
set: textContentSetterPatched,
|
|
1372
1366
|
enumerable: true,
|
|
@@ -1427,7 +1421,8 @@
|
|
|
1427
1421
|
},
|
|
1428
1422
|
compareDocumentPosition: {
|
|
1429
1423
|
value: function value(otherNode) {
|
|
1430
|
-
//
|
|
1424
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
1425
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
1431
1426
|
if (isGlobalPatchingSkipped(this)) {
|
|
1432
1427
|
return compareDocumentPosition.call(this, otherNode);
|
|
1433
1428
|
}
|
|
@@ -1446,20 +1441,15 @@
|
|
|
1446
1441
|
if (this === otherNode) {
|
|
1447
1442
|
return true;
|
|
1448
1443
|
}
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
1454
|
-
return containsPatched.call(this, otherNode);
|
|
1455
|
-
}
|
|
1456
|
-
return contains.call(this, otherNode);
|
|
1444
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
1445
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
1446
|
+
if (otherNode == null) {
|
|
1447
|
+
return false;
|
|
1457
1448
|
}
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
return contains.call(this, otherNode);
|
|
1449
|
+
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
1450
|
+
return containsPatched.call(this, otherNode);
|
|
1461
1451
|
}
|
|
1462
|
-
return
|
|
1452
|
+
return contains.call(this, otherNode);
|
|
1463
1453
|
},
|
|
1464
1454
|
enumerable: true,
|
|
1465
1455
|
writable: true,
|
|
@@ -1467,17 +1457,9 @@
|
|
|
1467
1457
|
},
|
|
1468
1458
|
cloneNode: {
|
|
1469
1459
|
value: function value(deep) {
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
}
|
|
1474
|
-
return cloneNode.call(this, deep);
|
|
1475
|
-
}
|
|
1476
|
-
if (isTrue(deep)) {
|
|
1477
|
-
// TODO [#1222]: remove global bypass
|
|
1478
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
1479
|
-
return cloneNode.call(this, deep);
|
|
1480
|
-
}
|
|
1460
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
1461
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
1462
|
+
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
1481
1463
|
return cloneNodePatched.call(this, deep);
|
|
1482
1464
|
}
|
|
1483
1465
|
return cloneNode.call(this, deep);
|
|
@@ -2491,7 +2473,8 @@
|
|
|
2491
2473
|
if (isNull(elm)) {
|
|
2492
2474
|
return null;
|
|
2493
2475
|
}
|
|
2494
|
-
//
|
|
2476
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2477
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2495
2478
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm) ? elm : null;
|
|
2496
2479
|
},
|
|
2497
2480
|
writable: true,
|
|
@@ -2502,7 +2485,8 @@
|
|
|
2502
2485
|
value: function value() {
|
|
2503
2486
|
var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
|
|
2504
2487
|
var filtered = ArrayFind.call(elements,
|
|
2505
|
-
//
|
|
2488
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2489
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2506
2490
|
function (elm) {
|
|
2507
2491
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2508
2492
|
});
|
|
@@ -2516,7 +2500,8 @@
|
|
|
2516
2500
|
value: function value() {
|
|
2517
2501
|
var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
|
|
2518
2502
|
var filtered = ArrayFilter.call(elements,
|
|
2519
|
-
//
|
|
2503
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2504
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2520
2505
|
function (elm) {
|
|
2521
2506
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2522
2507
|
});
|
|
@@ -2530,7 +2515,8 @@
|
|
|
2530
2515
|
value: function value() {
|
|
2531
2516
|
var elements = arrayFromCollection(getElementsByClassName.apply(this, ArraySlice.call(arguments)));
|
|
2532
2517
|
var filtered = ArrayFilter.call(elements,
|
|
2533
|
-
//
|
|
2518
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2519
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2534
2520
|
function (elm) {
|
|
2535
2521
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2536
2522
|
});
|
|
@@ -2544,7 +2530,8 @@
|
|
|
2544
2530
|
value: function value() {
|
|
2545
2531
|
var elements = arrayFromCollection(getElementsByTagName.apply(this, ArraySlice.call(arguments)));
|
|
2546
2532
|
var filtered = ArrayFilter.call(elements,
|
|
2547
|
-
//
|
|
2533
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2534
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2548
2535
|
function (elm) {
|
|
2549
2536
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2550
2537
|
});
|
|
@@ -2558,7 +2545,8 @@
|
|
|
2558
2545
|
value: function value() {
|
|
2559
2546
|
var elements = arrayFromCollection(getElementsByTagNameNS.apply(this, ArraySlice.call(arguments)));
|
|
2560
2547
|
var filtered = ArrayFilter.call(elements,
|
|
2561
|
-
//
|
|
2548
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2549
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2562
2550
|
function (elm) {
|
|
2563
2551
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2564
2552
|
});
|
|
@@ -2574,7 +2562,8 @@
|
|
|
2574
2562
|
value: function value() {
|
|
2575
2563
|
var elements = arrayFromCollection(getElementsByName.apply(this, ArraySlice.call(arguments)));
|
|
2576
2564
|
var filtered = ArrayFilter.call(elements,
|
|
2577
|
-
//
|
|
2565
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
2566
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
2578
2567
|
function (elm) {
|
|
2579
2568
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
|
|
2580
2569
|
});
|
|
@@ -3672,7 +3661,8 @@
|
|
|
3672
3661
|
} else if (context instanceof HTMLBodyElement) {
|
|
3673
3662
|
// `context` is document.body which is already patched.
|
|
3674
3663
|
filtered = ArrayFilter.call(unfilteredNodes,
|
|
3675
|
-
//
|
|
3664
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3665
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3676
3666
|
function (elm) {
|
|
3677
3667
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
|
|
3678
3668
|
});
|
|
@@ -3738,17 +3728,12 @@
|
|
|
3738
3728
|
defineProperties(Element.prototype, {
|
|
3739
3729
|
innerHTML: {
|
|
3740
3730
|
get: function get() {
|
|
3741
|
-
|
|
3742
|
-
|
|
3743
|
-
|
|
3744
|
-
|
|
3745
|
-
return innerHTMLGetter.call(this);
|
|
3731
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3732
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3733
|
+
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
3734
|
+
return innerHTMLGetterPatched.call(this);
|
|
3746
3735
|
}
|
|
3747
|
-
|
|
3748
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
3749
|
-
return innerHTMLGetter.call(this);
|
|
3750
|
-
}
|
|
3751
|
-
return innerHTMLGetterPatched.call(this);
|
|
3736
|
+
return innerHTMLGetter.call(this);
|
|
3752
3737
|
},
|
|
3753
3738
|
set: function set(v) {
|
|
3754
3739
|
innerHTMLSetter.call(this, v);
|
|
@@ -3758,17 +3743,12 @@
|
|
|
3758
3743
|
},
|
|
3759
3744
|
outerHTML: {
|
|
3760
3745
|
get: function get() {
|
|
3761
|
-
|
|
3762
|
-
|
|
3763
|
-
|
|
3764
|
-
|
|
3765
|
-
return outerHTMLGetter.call(this);
|
|
3766
|
-
}
|
|
3767
|
-
// TODO [#1222]: remove global bypass
|
|
3768
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
3769
|
-
return outerHTMLGetter.call(this);
|
|
3746
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3747
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3748
|
+
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
3749
|
+
return outerHTMLGetterPatched.call(this);
|
|
3770
3750
|
}
|
|
3771
|
-
return
|
|
3751
|
+
return outerHTMLGetter.call(this);
|
|
3772
3752
|
},
|
|
3773
3753
|
set: function set(v) {
|
|
3774
3754
|
outerHTMLSetter.call(this, v);
|
|
@@ -3870,35 +3850,24 @@
|
|
|
3870
3850
|
});
|
|
3871
3851
|
return isUndefined(elm) ? null : elm;
|
|
3872
3852
|
} else {
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
// Element is inside a shadow but we dont know which one. Use the
|
|
3878
|
-
// "nearest" owner key to filter by ownership.
|
|
3879
|
-
var contextNearestOwnerKey = getNodeNearestOwnerKey(this);
|
|
3880
|
-
var _elm = ArrayFind.call(nodeList, function (elm) {
|
|
3881
|
-
return getNodeNearestOwnerKey(elm) === contextNearestOwnerKey;
|
|
3882
|
-
});
|
|
3883
|
-
return isUndefined(_elm) ? null : _elm;
|
|
3853
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3854
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3855
|
+
// `this` is a manually inserted element inside a shadowRoot, return the first element.
|
|
3856
|
+
return nodeList.length === 0 ? null : nodeList[0];
|
|
3884
3857
|
}
|
|
3885
3858
|
} else {
|
|
3886
|
-
if (!
|
|
3887
|
-
|
|
3888
|
-
|
|
3889
|
-
return isUndefined(_elm3) ? null : _elm3;
|
|
3890
|
-
}
|
|
3859
|
+
if (!(this instanceof HTMLBodyElement)) {
|
|
3860
|
+
var _elm2 = nodeList[0];
|
|
3861
|
+
return isUndefined(_elm2) ? null : _elm2;
|
|
3891
3862
|
}
|
|
3892
3863
|
// element belonging to the document
|
|
3893
|
-
var
|
|
3894
|
-
// TODO [#1222]: remove global bypass
|
|
3895
|
-
function (elm) {
|
|
3864
|
+
var _elm = ArrayFind.call(nodeList, function (elm) {
|
|
3896
3865
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(_this3);
|
|
3897
3866
|
});
|
|
3898
|
-
return isUndefined(
|
|
3867
|
+
return isUndefined(_elm) ? null : _elm;
|
|
3899
3868
|
}
|
|
3900
3869
|
}
|
|
3901
|
-
function getFilteredArrayOfNodes(context, unfilteredNodes
|
|
3870
|
+
function getFilteredArrayOfNodes(context, unfilteredNodes) {
|
|
3902
3871
|
var filtered;
|
|
3903
3872
|
if (isSyntheticShadowHost(context)) {
|
|
3904
3873
|
// element with shadowRoot attached
|
|
@@ -3920,22 +3889,16 @@
|
|
|
3920
3889
|
filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
|
|
3921
3890
|
return getNodeNearestOwnerKey(elm) === ownerKey;
|
|
3922
3891
|
});
|
|
3923
|
-
} else if (shadowDomSemantic === 1 /* ShadowDomSemantic.Enabled */) {
|
|
3924
|
-
// context is inside a shadow, we dont know which one.
|
|
3925
|
-
var contextNearestOwnerKey = getNodeNearestOwnerKey(context);
|
|
3926
|
-
filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
|
|
3927
|
-
return getNodeNearestOwnerKey(elm) === contextNearestOwnerKey;
|
|
3928
|
-
});
|
|
3929
3892
|
} else {
|
|
3930
|
-
//
|
|
3893
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3894
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3895
|
+
// context is manually inserted without lwc:dom-manual, return everything
|
|
3931
3896
|
filtered = ArraySlice.call(unfilteredNodes);
|
|
3932
3897
|
}
|
|
3933
3898
|
} else {
|
|
3934
|
-
if (context instanceof HTMLBodyElement
|
|
3899
|
+
if (context instanceof HTMLBodyElement) {
|
|
3935
3900
|
// `context` is document.body or element belonging to the document with the patch enabled
|
|
3936
|
-
filtered = ArrayFilter.call(unfilteredNodes,
|
|
3937
|
-
// TODO [#1222]: remove global bypass
|
|
3938
|
-
function (elm) {
|
|
3901
|
+
filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
|
|
3939
3902
|
return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
|
|
3940
3903
|
});
|
|
3941
3904
|
} else {
|
|
@@ -3964,13 +3927,11 @@
|
|
|
3964
3927
|
querySelectorAll: {
|
|
3965
3928
|
value: function value() {
|
|
3966
3929
|
var nodeList = arrayFromCollection(querySelectorAll$1.apply(this, ArraySlice.call(arguments)));
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
return createStaticNodeList(getFilteredArrayOfNodes(this, nodeList, 1 /* ShadowDomSemantic.Enabled */));
|
|
3930
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3931
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3932
|
+
var filteredResults = getFilteredArrayOfNodes(this, nodeList);
|
|
3933
|
+
return createStaticNodeList(filteredResults);
|
|
3972
3934
|
},
|
|
3973
|
-
|
|
3974
3935
|
writable: true,
|
|
3975
3936
|
enumerable: true,
|
|
3976
3937
|
configurable: true
|
|
@@ -3982,11 +3943,9 @@
|
|
|
3982
3943
|
getElementsByClassName: {
|
|
3983
3944
|
value: function value() {
|
|
3984
3945
|
var elements = arrayFromCollection(getElementsByClassName$1.apply(this, ArraySlice.call(arguments)));
|
|
3985
|
-
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
|
|
3989
|
-
return createStaticHTMLCollection(filteredResults);
|
|
3946
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3947
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3948
|
+
return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
|
|
3990
3949
|
},
|
|
3991
3950
|
writable: true,
|
|
3992
3951
|
enumerable: true,
|
|
@@ -3995,11 +3954,9 @@
|
|
|
3995
3954
|
getElementsByTagName: {
|
|
3996
3955
|
value: function value() {
|
|
3997
3956
|
var elements = arrayFromCollection(getElementsByTagName$1.apply(this, ArraySlice.call(arguments)));
|
|
3998
|
-
|
|
3999
|
-
|
|
4000
|
-
|
|
4001
|
-
var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
|
|
4002
|
-
return createStaticHTMLCollection(filteredResults);
|
|
3957
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3958
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3959
|
+
return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
|
|
4003
3960
|
},
|
|
4004
3961
|
writable: true,
|
|
4005
3962
|
enumerable: true,
|
|
@@ -4008,11 +3965,9 @@
|
|
|
4008
3965
|
getElementsByTagNameNS: {
|
|
4009
3966
|
value: function value() {
|
|
4010
3967
|
var elements = arrayFromCollection(getElementsByTagNameNS$1.apply(this, ArraySlice.call(arguments)));
|
|
4011
|
-
|
|
4012
|
-
|
|
4013
|
-
|
|
4014
|
-
var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
|
|
4015
|
-
return createStaticHTMLCollection(filteredResults);
|
|
3968
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
3969
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
3970
|
+
return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
|
|
4016
3971
|
},
|
|
4017
3972
|
writable: true,
|
|
4018
3973
|
enumerable: true,
|
|
@@ -4025,199 +3980,6 @@
|
|
|
4025
3980
|
defineProperty(HTMLElement.prototype, 'getElementsByClassName', getOwnPropertyDescriptor(Element.prototype, 'getElementsByClassName'));
|
|
4026
3981
|
}
|
|
4027
3982
|
|
|
4028
|
-
/*
|
|
4029
|
-
* Copyright (c) 2018, salesforce.com, inc.
|
|
4030
|
-
* All rights reserved.
|
|
4031
|
-
* SPDX-License-Identifier: MIT
|
|
4032
|
-
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
4033
|
-
*/
|
|
4034
|
-
function getElementComputedStyle(element) {
|
|
4035
|
-
var win = getOwnerWindow(element);
|
|
4036
|
-
return windowGetComputedStyle.call(win, element);
|
|
4037
|
-
}
|
|
4038
|
-
function getWindowSelection(node) {
|
|
4039
|
-
var win = getOwnerWindow(node);
|
|
4040
|
-
return windowGetSelection.call(win);
|
|
4041
|
-
}
|
|
4042
|
-
function nodeIsBeingRendered(nodeComputedStyle) {
|
|
4043
|
-
return nodeComputedStyle.visibility === 'visible' && nodeComputedStyle.display !== 'none';
|
|
4044
|
-
}
|
|
4045
|
-
function getSelectionState(element) {
|
|
4046
|
-
var win = getOwnerWindow(element);
|
|
4047
|
-
var selection = getWindowSelection(element);
|
|
4048
|
-
if (selection === null) {
|
|
4049
|
-
return null;
|
|
4050
|
-
}
|
|
4051
|
-
var ranges = [];
|
|
4052
|
-
for (var i = 0; i < selection.rangeCount; i++) {
|
|
4053
|
-
ranges.push(selection.getRangeAt(i));
|
|
4054
|
-
}
|
|
4055
|
-
var state = {
|
|
4056
|
-
element: element,
|
|
4057
|
-
onselect: win.onselect,
|
|
4058
|
-
onselectstart: win.onselectstart,
|
|
4059
|
-
onselectionchange: win.onselectionchange,
|
|
4060
|
-
ranges: ranges
|
|
4061
|
-
};
|
|
4062
|
-
win.onselect = null;
|
|
4063
|
-
win.onselectstart = null;
|
|
4064
|
-
win.onselectionchange = null;
|
|
4065
|
-
return state;
|
|
4066
|
-
}
|
|
4067
|
-
function restoreSelectionState(state) {
|
|
4068
|
-
if (state === null) {
|
|
4069
|
-
return;
|
|
4070
|
-
}
|
|
4071
|
-
var element = state.element,
|
|
4072
|
-
onselect = state.onselect,
|
|
4073
|
-
onselectstart = state.onselectstart,
|
|
4074
|
-
onselectionchange = state.onselectionchange,
|
|
4075
|
-
ranges = state.ranges;
|
|
4076
|
-
var win = getOwnerWindow(element);
|
|
4077
|
-
var selection = getWindowSelection(element);
|
|
4078
|
-
selection.removeAllRanges();
|
|
4079
|
-
for (var i = 0; i < ranges.length; i++) {
|
|
4080
|
-
selection.addRange(ranges[i]);
|
|
4081
|
-
}
|
|
4082
|
-
win.onselect = onselect;
|
|
4083
|
-
win.onselectstart = onselectstart;
|
|
4084
|
-
win.onselectionchange = onselectionchange;
|
|
4085
|
-
}
|
|
4086
|
-
/**
|
|
4087
|
-
* Gets the "innerText" of a text node using the Selection API
|
|
4088
|
-
*
|
|
4089
|
-
* NOTE: For performance reasons, since this function will be called multiple times while calculating the innerText of
|
|
4090
|
-
* an element, it does not restore the current selection.
|
|
4091
|
-
*/
|
|
4092
|
-
function getTextNodeInnerText(textNode) {
|
|
4093
|
-
var selection = getWindowSelection(textNode);
|
|
4094
|
-
if (selection === null) {
|
|
4095
|
-
return textNode.textContent || '';
|
|
4096
|
-
}
|
|
4097
|
-
var range = document.createRange();
|
|
4098
|
-
range.selectNodeContents(textNode);
|
|
4099
|
-
var domRect = range.getBoundingClientRect();
|
|
4100
|
-
if (domRect.height <= 0 || domRect.width <= 0) {
|
|
4101
|
-
// the text node is not rendered
|
|
4102
|
-
return '';
|
|
4103
|
-
}
|
|
4104
|
-
// Needed to remove non rendered characters from the text node.
|
|
4105
|
-
selection.removeAllRanges();
|
|
4106
|
-
selection.addRange(range);
|
|
4107
|
-
var selectionText = selection.toString();
|
|
4108
|
-
// The textNode is visible, but it may not be selectable. When the text is not selectable,
|
|
4109
|
-
// textContent is the nearest approximation to innerText.
|
|
4110
|
-
return selectionText ? selectionText : textNode.textContent || '';
|
|
4111
|
-
}
|
|
4112
|
-
var nodeIsElement = function nodeIsElement(node) {
|
|
4113
|
-
return node.nodeType === ELEMENT_NODE;
|
|
4114
|
-
};
|
|
4115
|
-
var nodeIsText = function nodeIsText(node) {
|
|
4116
|
-
return node.nodeType === TEXT_NODE;
|
|
4117
|
-
};
|
|
4118
|
-
/**
|
|
4119
|
-
* Spec: https://html.spec.whatwg.org/multipage/dom.html#inner-text-collection-steps
|
|
4120
|
-
* One spec implementation: https://github.com/servo/servo/blob/721271dcd3c20db5ca8cf146e2b5907647afb4d6/components/layout/query.rs#L1132
|
|
4121
|
-
*/
|
|
4122
|
-
function innerTextCollectionSteps(node) {
|
|
4123
|
-
var items = [];
|
|
4124
|
-
if (nodeIsElement(node)) {
|
|
4125
|
-
var tagName = node.tagName;
|
|
4126
|
-
var computedStyle = getElementComputedStyle(node);
|
|
4127
|
-
if (tagName === 'OPTION') {
|
|
4128
|
-
// For options, is hard to get the "rendered" text, let's use the original getter.
|
|
4129
|
-
return [1, innerTextGetter.call(node), 1];
|
|
4130
|
-
} else if (tagName === 'TEXTAREA') {
|
|
4131
|
-
return [];
|
|
4132
|
-
} else {
|
|
4133
|
-
var childNodes = node.childNodes;
|
|
4134
|
-
for (var i = 0, n = childNodes.length; i < n; i++) {
|
|
4135
|
-
ArrayPush.apply(items, innerTextCollectionSteps(childNodes[i]));
|
|
4136
|
-
}
|
|
4137
|
-
}
|
|
4138
|
-
if (!nodeIsBeingRendered(computedStyle)) {
|
|
4139
|
-
if (tagName === 'SELECT' || tagName === 'DATALIST') {
|
|
4140
|
-
// the select is either: .visibility != 'visible' or .display === hidden, therefore this select should
|
|
4141
|
-
// not display any value.
|
|
4142
|
-
return [];
|
|
4143
|
-
}
|
|
4144
|
-
return items;
|
|
4145
|
-
}
|
|
4146
|
-
if (tagName === 'BR') {
|
|
4147
|
-
items.push("\n" /* line feed */);
|
|
4148
|
-
}
|
|
4149
|
-
|
|
4150
|
-
var display = computedStyle.display;
|
|
4151
|
-
if (display === 'table-cell') {
|
|
4152
|
-
// omitting case: and node's CSS box is not the last 'table-cell' box of its enclosing 'table-row' box
|
|
4153
|
-
items.push("\t" /* tab */);
|
|
4154
|
-
}
|
|
4155
|
-
|
|
4156
|
-
if (display === 'table-row') {
|
|
4157
|
-
// omitting case: and node's CSS box is not the last 'table-row' box of the nearest ancestor 'table' box
|
|
4158
|
-
items.push("\n" /* line feed */);
|
|
4159
|
-
}
|
|
4160
|
-
|
|
4161
|
-
if (tagName === 'P') {
|
|
4162
|
-
items.unshift(2);
|
|
4163
|
-
items.push(2);
|
|
4164
|
-
}
|
|
4165
|
-
if (display === 'block' || display === 'table-caption' || display === 'flex' || display === 'table') {
|
|
4166
|
-
items.unshift(1);
|
|
4167
|
-
items.push(1);
|
|
4168
|
-
}
|
|
4169
|
-
} else if (nodeIsText(node)) {
|
|
4170
|
-
items.push(getTextNodeInnerText(node));
|
|
4171
|
-
}
|
|
4172
|
-
return items;
|
|
4173
|
-
}
|
|
4174
|
-
/**
|
|
4175
|
-
* InnerText getter spec: https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
|
|
4176
|
-
*
|
|
4177
|
-
* One spec implementation: https://github.com/servo/servo/blob/721271dcd3c20db5ca8cf146e2b5907647afb4d6/components/layout/query.rs#L1087
|
|
4178
|
-
*/
|
|
4179
|
-
function getInnerText(element) {
|
|
4180
|
-
var thisComputedStyle = getElementComputedStyle(element);
|
|
4181
|
-
if (!nodeIsBeingRendered(thisComputedStyle)) {
|
|
4182
|
-
return getTextContent(element) || '';
|
|
4183
|
-
}
|
|
4184
|
-
var selectionState = getSelectionState(element);
|
|
4185
|
-
var results = [];
|
|
4186
|
-
var childNodes = element.childNodes;
|
|
4187
|
-
for (var i = 0, n = childNodes.length; i < n; i++) {
|
|
4188
|
-
ArrayPush.apply(results, innerTextCollectionSteps(childNodes[i]));
|
|
4189
|
-
}
|
|
4190
|
-
restoreSelectionState(selectionState);
|
|
4191
|
-
var elementInnerText = '';
|
|
4192
|
-
var maxReqLineBreakCount = 0;
|
|
4193
|
-
for (var _i = 0, _n = results.length; _i < _n; _i++) {
|
|
4194
|
-
var item = results[_i];
|
|
4195
|
-
if (typeof item === 'string') {
|
|
4196
|
-
if (maxReqLineBreakCount > 0) {
|
|
4197
|
-
for (var j = 0; j < maxReqLineBreakCount; j++) {
|
|
4198
|
-
elementInnerText += "\n";
|
|
4199
|
-
}
|
|
4200
|
-
maxReqLineBreakCount = 0;
|
|
4201
|
-
}
|
|
4202
|
-
if (item.length > 0) {
|
|
4203
|
-
elementInnerText += item;
|
|
4204
|
-
}
|
|
4205
|
-
} else {
|
|
4206
|
-
if (elementInnerText.length == 0) {
|
|
4207
|
-
// Remove required line break count at the start.
|
|
4208
|
-
continue;
|
|
4209
|
-
}
|
|
4210
|
-
// Store the count if it's the max of this run,
|
|
4211
|
-
// but it may be ignored if no text item is found afterwards,
|
|
4212
|
-
// which means that these are consecutive line breaks at the end.
|
|
4213
|
-
if (item > maxReqLineBreakCount) {
|
|
4214
|
-
maxReqLineBreakCount = item;
|
|
4215
|
-
}
|
|
4216
|
-
}
|
|
4217
|
-
}
|
|
4218
|
-
return elementInnerText;
|
|
4219
|
-
}
|
|
4220
|
-
|
|
4221
3983
|
/*
|
|
4222
3984
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4223
3985
|
* All rights reserved.
|
|
@@ -4696,20 +4458,9 @@
|
|
|
4696
4458
|
if (innerTextGetter !== null && innerTextSetter !== null) {
|
|
4697
4459
|
defineProperty(HTMLElement.prototype, 'innerText', {
|
|
4698
4460
|
get: function get() {
|
|
4699
|
-
|
|
4700
|
-
|
|
4701
|
-
|
|
4702
|
-
if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4703
|
-
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
4704
|
-
return getInnerText(this);
|
|
4705
|
-
}
|
|
4706
|
-
return innerTextGetter.call(this);
|
|
4707
|
-
}
|
|
4708
|
-
// TODO [#1222]: remove global bypass
|
|
4709
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
4710
|
-
return innerTextGetter.call(this);
|
|
4711
|
-
}
|
|
4712
|
-
return getInnerText(this);
|
|
4461
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
4462
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
4463
|
+
return innerTextGetter.call(this);
|
|
4713
4464
|
},
|
|
4714
4465
|
set: function set(v) {
|
|
4715
4466
|
innerTextSetter.call(this, v);
|
|
@@ -4725,20 +4476,9 @@
|
|
|
4725
4476
|
// As a setter, it removes the current node and replaces it with the given text.
|
|
4726
4477
|
defineProperty(HTMLElement.prototype, 'outerText', {
|
|
4727
4478
|
get: function get() {
|
|
4728
|
-
|
|
4729
|
-
|
|
4730
|
-
|
|
4731
|
-
if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4732
|
-
if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
|
|
4733
|
-
return getInnerText(this);
|
|
4734
|
-
}
|
|
4735
|
-
return outerTextGetter.call(this);
|
|
4736
|
-
}
|
|
4737
|
-
// TODO [#1222]: remove global bypass
|
|
4738
|
-
if (isGlobalPatchingSkipped(this)) {
|
|
4739
|
-
return outerTextGetter.call(this);
|
|
4740
|
-
}
|
|
4741
|
-
return getInnerText(this);
|
|
4479
|
+
// Note: we deviate from native shadow here, but are not fixing
|
|
4480
|
+
// due to backwards compat: https://github.com/salesforce/lwc/pull/3103
|
|
4481
|
+
return outerTextGetter.call(this);
|
|
4742
4482
|
},
|
|
4743
4483
|
set: function set(v) {
|
|
4744
4484
|
// Invoking the `outerText` setter on a host element should trigger its disconnection, but until we merge node reactions, it will not work.
|
|
@@ -4877,8 +4617,8 @@
|
|
|
4877
4617
|
adoptChildNode(node, DocumentResolverFn, undefined);
|
|
4878
4618
|
}
|
|
4879
4619
|
}
|
|
4880
|
-
for (var
|
|
4881
|
-
var _node = addedNodes[
|
|
4620
|
+
for (var _i = 0, _len = addedNodes.length; _i < _len; _i += 1) {
|
|
4621
|
+
var _node = addedNodes[_i];
|
|
4882
4622
|
if (compareDocumentPosition.call(elm, _node) & _Node.DOCUMENT_POSITION_CONTAINED_BY) {
|
|
4883
4623
|
adoptChildNode(_node, fn, shadowToken);
|
|
4884
4624
|
}
|
|
@@ -4950,6 +4690,6 @@
|
|
|
4950
4690
|
}));
|
|
4951
4691
|
});
|
|
4952
4692
|
}
|
|
4953
|
-
/** version: 2.
|
|
4693
|
+
/** version: 2.32.1 */
|
|
4954
4694
|
|
|
4955
4695
|
}));
|