lwc 2.32.0 → 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.
Files changed (39) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +222 -249
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +222 -249
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +94 -145
  5. package/dist/engine-dom/iife/es5/engine-dom.js +211 -226
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +120 -183
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +222 -249
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +94 -145
  11. package/dist/engine-dom/umd/es5/engine-dom.js +211 -226
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +120 -183
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +218 -224
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +218 -224
  17. package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +676 -909
  18. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +676 -909
  19. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
  20. package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +644 -882
  21. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +85 -345
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +85 -345
  24. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +676 -909
  25. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
  26. package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +644 -882
  27. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +85 -345
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +85 -345
  30. package/dist/wire-service/esm/es2017/wire-service.js +2 -2
  31. package/dist/wire-service/iife/es2017/wire-service.js +2 -2
  32. package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
  33. package/dist/wire-service/iife/es5/wire-service.js +2 -2
  34. package/dist/wire-service/iife/es5/wire-service_debug.js +2 -2
  35. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  36. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  37. package/dist/wire-service/umd/es5/wire-service.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service_debug.js +2 -2
  39. 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.32.0 */
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
- // TODO [#1222]: remove global bypass
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.32.0 */
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
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1360
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1361
- return textContentGetterPatched.call(this);
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 textContentGetterPatched.call(this);
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
- // TODO [#1222]: remove global bypass
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
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1450
- if (otherNode == null) {
1451
- return false;
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
- // TODO [#1222]: remove global bypass
1459
- if (isGlobalPatchingSkipped(this)) {
1460
- return contains.call(this, otherNode);
1449
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1450
+ return containsPatched.call(this, otherNode);
1461
1451
  }
1462
- return containsPatched.call(this, otherNode);
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
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1471
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1472
- return cloneNodePatched.call(this, deep);
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- // TODO [#1222]: remove global bypass
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
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
3742
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3743
- return innerHTMLGetterPatched.call(this);
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
- // TODO [#1222]: remove global bypass
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
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
3762
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3763
- return outerHTMLGetterPatched.call(this);
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 outerHTMLGetterPatched.call(this);
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
- if (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3874
- // `this` is a manually inserted element inside a shadowRoot, return the first element.
3875
- return nodeList.length === 0 ? null : nodeList[0];
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 (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3887
- if (!(this instanceof HTMLBodyElement)) {
3888
- var _elm3 = nodeList[0];
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 _elm2 = ArrayFind.call(nodeList,
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(_elm2) ? null : _elm2;
3867
+ return isUndefined(_elm) ? null : _elm;
3899
3868
  }
3900
3869
  }
3901
- function getFilteredArrayOfNodes(context, unfilteredNodes, shadowDomSemantic) {
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
- // context is manually inserted without lwc:dom-manual and ShadowDomSemantics is off, return everything
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 || shadowDomSemantic === 1 /* ShadowDomSemantic.Enabled */) {
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
- if (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3968
- var filteredResults = getFilteredArrayOfNodes(this, nodeList, 0 /* ShadowDomSemantic.Disabled */);
3969
- return createStaticNodeList(filteredResults);
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
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
3986
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
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
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
3999
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
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
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
4012
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
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
- if (!lwcRuntimeFlags.ENABLE_INNER_OUTER_TEXT_PATCH) {
4700
- return innerTextGetter.call(this);
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
- if (!lwcRuntimeFlags.ENABLE_INNER_OUTER_TEXT_PATCH) {
4729
- return outerTextGetter.call(this);
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 _i2 = 0, _len = addedNodes.length; _i2 < _len; _i2 += 1) {
4881
- var _node = addedNodes[_i2];
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.32.0 */
4693
+ /** version: 2.32.1 */
4954
4694
 
4955
4695
  }));