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