lwc 2.32.0 → 2.33.0

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 (41) hide show
  1. package/dist/engine-dom/esm/es2017/engine-dom.js +898 -802
  2. package/dist/engine-dom/iife/es2017/engine-dom.js +898 -802
  3. package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -1
  4. package/dist/engine-dom/iife/es2017/engine-dom_debug.js +683 -608
  5. package/dist/engine-dom/iife/es5/engine-dom.js +324 -313
  6. package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -1
  7. package/dist/engine-dom/iife/es5/engine-dom_debug.js +234 -270
  8. package/dist/engine-dom/umd/es2017/engine-dom.js +898 -802
  9. package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -1
  10. package/dist/engine-dom/umd/es2017/engine-dom_debug.js +683 -608
  11. package/dist/engine-dom/umd/es5/engine-dom.js +324 -313
  12. package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -1
  13. package/dist/engine-dom/umd/es5/engine-dom_debug.js +234 -270
  14. package/dist/engine-server/commonjs/es2017/engine-server.js +871 -696
  15. package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -1
  16. package/dist/engine-server/esm/es2017/engine-server.js +871 -696
  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 +89 -347
  22. package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
  23. package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +89 -347
  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 +89 -347
  28. package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
  29. package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +89 -347
  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 +5 -3
  34. package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
  35. package/dist/wire-service/iife/es5/wire-service_debug.js +5 -3
  36. package/dist/wire-service/umd/es2017/wire-service.js +2 -2
  37. package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
  38. package/dist/wire-service/umd/es5/wire-service.js +5 -3
  39. package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
  40. package/dist/wire-service/umd/es5/wire-service_debug.js +5 -3
  41. package/package.json +7 -7
@@ -2,9 +2,11 @@
2
2
  'use strict';
3
3
 
4
4
  var _create, _create2;
5
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
7
7
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
8
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
9
+ function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
8
10
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
9
11
  function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
10
12
  /* proxy-compat-disable */
@@ -174,7 +176,7 @@
174
176
  var hasNativeSymbolSupport = /*@__PURE__*/function () {
175
177
  return Symbol('x').toString() === 'Symbol(x)';
176
178
  }();
177
- /** version: 2.32.0 */
179
+ /** version: 2.33.0 */
178
180
 
179
181
  /*
180
182
  * Copyright (c) 2018, salesforce.com, inc.
@@ -338,9 +340,7 @@
338
340
  */
339
341
  var _window = window,
340
342
  windowAddEventListener = _window.addEventListener,
341
- windowRemoveEventListener = _window.removeEventListener,
342
- windowGetComputedStyle = _window.getComputedStyle,
343
- windowGetSelection = _window.getSelection;
343
+ windowRemoveEventListener = _window.removeEventListener;
344
344
 
345
345
  /*
346
346
  * Copyright (c) 2018, salesforce.com, inc.
@@ -450,7 +450,8 @@
450
450
  return win;
451
451
  }
452
452
  var skipGlobalPatching;
453
- // 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
454
455
  function isGlobalPatchingSkipped(node) {
455
456
  // we lazily compute this value instead of doing it during evaluation, this helps
456
457
  // for apps that are setting this after the engine code is evaluated.
@@ -491,7 +492,7 @@
491
492
  });
492
493
  }
493
494
  var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
494
- /** version: 2.32.0 */
495
+ /** version: 2.33.0 */
495
496
 
496
497
  /*
497
498
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1354,17 +1355,12 @@
1354
1355
  },
1355
1356
  textContent: {
1356
1357
  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);
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);
1366
1362
  }
1367
- return textContentGetterPatched.call(this);
1363
+ return textContentGetter.call(this);
1368
1364
  },
1369
1365
  set: textContentSetterPatched,
1370
1366
  enumerable: true,
@@ -1425,7 +1421,8 @@
1425
1421
  },
1426
1422
  compareDocumentPosition: {
1427
1423
  value: function value(otherNode) {
1428
- // 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
1429
1426
  if (isGlobalPatchingSkipped(this)) {
1430
1427
  return compareDocumentPosition.call(this, otherNode);
1431
1428
  }
@@ -1444,20 +1441,15 @@
1444
1441
  if (this === otherNode) {
1445
1442
  return true;
1446
1443
  }
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);
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;
1455
1448
  }
1456
- // TODO [#1222]: remove global bypass
1457
- if (isGlobalPatchingSkipped(this)) {
1458
- return contains.call(this, otherNode);
1449
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1450
+ return containsPatched.call(this, otherNode);
1459
1451
  }
1460
- return containsPatched.call(this, otherNode);
1452
+ return contains.call(this, otherNode);
1461
1453
  },
1462
1454
  enumerable: true,
1463
1455
  writable: true,
@@ -1465,17 +1457,9 @@
1465
1457
  },
1466
1458
  cloneNode: {
1467
1459
  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
- }
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)) {
1479
1463
  return cloneNodePatched.call(this, deep);
1480
1464
  }
1481
1465
  return cloneNode.call(this, deep);
@@ -2489,7 +2473,8 @@
2489
2473
  if (isNull(elm)) {
2490
2474
  return null;
2491
2475
  }
2492
- // 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
2493
2478
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm) ? elm : null;
2494
2479
  },
2495
2480
  writable: true,
@@ -2500,7 +2485,8 @@
2500
2485
  value: function value() {
2501
2486
  var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
2502
2487
  var filtered = ArrayFind.call(elements,
2503
- // 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
2504
2490
  function (elm) {
2505
2491
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2506
2492
  });
@@ -2514,7 +2500,8 @@
2514
2500
  value: function value() {
2515
2501
  var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
2516
2502
  var filtered = ArrayFilter.call(elements,
2517
- // 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
2518
2505
  function (elm) {
2519
2506
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2520
2507
  });
@@ -2528,7 +2515,8 @@
2528
2515
  value: function value() {
2529
2516
  var elements = arrayFromCollection(getElementsByClassName.apply(this, ArraySlice.call(arguments)));
2530
2517
  var filtered = ArrayFilter.call(elements,
2531
- // 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
2532
2520
  function (elm) {
2533
2521
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2534
2522
  });
@@ -2542,7 +2530,8 @@
2542
2530
  value: function value() {
2543
2531
  var elements = arrayFromCollection(getElementsByTagName.apply(this, ArraySlice.call(arguments)));
2544
2532
  var filtered = ArrayFilter.call(elements,
2545
- // 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
2546
2535
  function (elm) {
2547
2536
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2548
2537
  });
@@ -2556,7 +2545,8 @@
2556
2545
  value: function value() {
2557
2546
  var elements = arrayFromCollection(getElementsByTagNameNS.apply(this, ArraySlice.call(arguments)));
2558
2547
  var filtered = ArrayFilter.call(elements,
2559
- // 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
2560
2550
  function (elm) {
2561
2551
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2562
2552
  });
@@ -2572,7 +2562,8 @@
2572
2562
  value: function value() {
2573
2563
  var elements = arrayFromCollection(getElementsByName.apply(this, ArraySlice.call(arguments)));
2574
2564
  var filtered = ArrayFilter.call(elements,
2575
- // 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
2576
2567
  function (elm) {
2577
2568
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2578
2569
  });
@@ -3670,7 +3661,8 @@
3670
3661
  } else if (context instanceof HTMLBodyElement) {
3671
3662
  // `context` is document.body which is already patched.
3672
3663
  filtered = ArrayFilter.call(unfilteredNodes,
3673
- // 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
3674
3666
  function (elm) {
3675
3667
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
3676
3668
  });
@@ -3736,17 +3728,12 @@
3736
3728
  defineProperties(Element.prototype, {
3737
3729
  innerHTML: {
3738
3730
  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);
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);
3744
3735
  }
3745
- // TODO [#1222]: remove global bypass
3746
- if (isGlobalPatchingSkipped(this)) {
3747
- return innerHTMLGetter.call(this);
3748
- }
3749
- return innerHTMLGetterPatched.call(this);
3736
+ return innerHTMLGetter.call(this);
3750
3737
  },
3751
3738
  set: function set(v) {
3752
3739
  innerHTMLSetter.call(this, v);
@@ -3756,17 +3743,12 @@
3756
3743
  },
3757
3744
  outerHTML: {
3758
3745
  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);
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);
3768
3750
  }
3769
- return outerHTMLGetterPatched.call(this);
3751
+ return outerHTMLGetter.call(this);
3770
3752
  },
3771
3753
  set: function set(v) {
3772
3754
  outerHTMLSetter.call(this, v);
@@ -3868,35 +3850,24 @@
3868
3850
  });
3869
3851
  return isUndefined(elm) ? null : elm;
3870
3852
  } 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;
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];
3882
3857
  }
3883
3858
  } 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
- }
3859
+ if (!(this instanceof HTMLBodyElement)) {
3860
+ var _elm2 = nodeList[0];
3861
+ return isUndefined(_elm2) ? null : _elm2;
3889
3862
  }
3890
3863
  // element belonging to the document
3891
- var _elm2 = ArrayFind.call(nodeList,
3892
- // TODO [#1222]: remove global bypass
3893
- function (elm) {
3864
+ var _elm = ArrayFind.call(nodeList, function (elm) {
3894
3865
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(_this3);
3895
3866
  });
3896
- return isUndefined(_elm2) ? null : _elm2;
3867
+ return isUndefined(_elm) ? null : _elm;
3897
3868
  }
3898
3869
  }
3899
- function getFilteredArrayOfNodes(context, unfilteredNodes, shadowDomSemantic) {
3870
+ function getFilteredArrayOfNodes(context, unfilteredNodes) {
3900
3871
  var filtered;
3901
3872
  if (isSyntheticShadowHost(context)) {
3902
3873
  // element with shadowRoot attached
@@ -3918,22 +3889,16 @@
3918
3889
  filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
3919
3890
  return getNodeNearestOwnerKey(elm) === ownerKey;
3920
3891
  });
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
3892
  } else {
3928
- // 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
3929
3896
  filtered = ArraySlice.call(unfilteredNodes);
3930
3897
  }
3931
3898
  } else {
3932
- if (context instanceof HTMLBodyElement || shadowDomSemantic === 1 /* ShadowDomSemantic.Enabled */) {
3899
+ if (context instanceof HTMLBodyElement) {
3933
3900
  // `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) {
3901
+ filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
3937
3902
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
3938
3903
  });
3939
3904
  } else {
@@ -3962,13 +3927,11 @@
3962
3927
  querySelectorAll: {
3963
3928
  value: function value() {
3964
3929
  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 */));
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);
3970
3934
  },
3971
-
3972
3935
  writable: true,
3973
3936
  enumerable: true,
3974
3937
  configurable: true
@@ -3980,11 +3943,9 @@
3980
3943
  getElementsByClassName: {
3981
3944
  value: function value() {
3982
3945
  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);
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));
3988
3949
  },
3989
3950
  writable: true,
3990
3951
  enumerable: true,
@@ -3993,11 +3954,9 @@
3993
3954
  getElementsByTagName: {
3994
3955
  value: function value() {
3995
3956
  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);
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));
4001
3960
  },
4002
3961
  writable: true,
4003
3962
  enumerable: true,
@@ -4006,11 +3965,9 @@
4006
3965
  getElementsByTagNameNS: {
4007
3966
  value: function value() {
4008
3967
  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);
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));
4014
3971
  },
4015
3972
  writable: true,
4016
3973
  enumerable: true,
@@ -4023,199 +3980,6 @@
4023
3980
  defineProperty(HTMLElement.prototype, 'getElementsByClassName', getOwnPropertyDescriptor(Element.prototype, 'getElementsByClassName'));
4024
3981
  }
4025
3982
 
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
3983
  /*
4220
3984
  * Copyright (c) 2018, salesforce.com, inc.
4221
3985
  * All rights reserved.
@@ -4694,20 +4458,9 @@
4694
4458
  if (innerTextGetter !== null && innerTextSetter !== null) {
4695
4459
  defineProperty(HTMLElement.prototype, 'innerText', {
4696
4460
  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);
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);
4711
4464
  },
4712
4465
  set: function set(v) {
4713
4466
  innerTextSetter.call(this, v);
@@ -4723,20 +4476,9 @@
4723
4476
  // As a setter, it removes the current node and replaces it with the given text.
4724
4477
  defineProperty(HTMLElement.prototype, 'outerText', {
4725
4478
  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);
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);
4740
4482
  },
4741
4483
  set: function set(v) {
4742
4484
  // Invoking the `outerText` setter on a host element should trigger its disconnection, but until we merge node reactions, it will not work.
@@ -4875,8 +4617,8 @@
4875
4617
  adoptChildNode(node, DocumentResolverFn, undefined);
4876
4618
  }
4877
4619
  }
4878
- for (var _i2 = 0, _len = addedNodes.length; _i2 < _len; _i2 += 1) {
4879
- var _node = addedNodes[_i2];
4620
+ for (var _i = 0, _len = addedNodes.length; _i < _len; _i += 1) {
4621
+ var _node = addedNodes[_i];
4880
4622
  if (compareDocumentPosition.call(elm, _node) & _Node.DOCUMENT_POSITION_CONTAINED_BY) {
4881
4623
  adoptChildNode(_node, fn, shadowToken);
4882
4624
  }
@@ -4948,6 +4690,6 @@
4948
4690
  }));
4949
4691
  });
4950
4692
  }
4951
- /** version: 2.32.0 */
4693
+ /** version: 2.33.0 */
4952
4694
 
4953
4695
  })();