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
@@ -4,9 +4,11 @@
4
4
  })((function () { 'use strict';
5
5
 
6
6
  var _create, _create2;
7
- 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; }
8
- 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); } }
7
+ 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; }
8
+ 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); } }
9
9
  function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
10
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
11
+ 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); }
10
12
  function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
11
13
  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); }
12
14
 
@@ -110,7 +112,7 @@
110
112
  var KEY__SHADOW_TOKEN = '$shadowToken$';
111
113
  var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
112
114
  var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
113
- /** version: 2.32.0 */
115
+ /** version: 2.33.0 */
114
116
 
115
117
  /*
116
118
  * Copyright (c) 2018, salesforce.com, inc.
@@ -272,9 +274,7 @@
272
274
  */
273
275
  var _window = window,
274
276
  windowAddEventListener = _window.addEventListener,
275
- windowRemoveEventListener = _window.removeEventListener,
276
- windowGetComputedStyle = _window.getComputedStyle,
277
- windowGetSelection = _window.getSelection;
277
+ windowRemoveEventListener = _window.removeEventListener;
278
278
 
279
279
  /*
280
280
  * Copyright (c) 2018, salesforce.com, inc.
@@ -384,7 +384,8 @@
384
384
  return win;
385
385
  }
386
386
  var skipGlobalPatching;
387
- // TODO [#1222]: remove global bypass
387
+ // Note: we deviate from native shadow here, but are not fixing
388
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
388
389
  function isGlobalPatchingSkipped(node) {
389
390
  // we lazily compute this value instead of doing it during evaluation, this helps
390
391
  // for apps that are setting this after the engine code is evaluated.
@@ -425,7 +426,7 @@
425
426
  });
426
427
  }
427
428
  var lwcRuntimeFlags = _globalThis.lwcRuntimeFlags;
428
- /** version: 2.32.0 */
429
+ /** version: 2.33.0 */
429
430
 
430
431
  /*
431
432
  * Copyright (c) 2018, salesforce.com, inc.
@@ -1268,17 +1269,12 @@
1268
1269
  },
1269
1270
  textContent: {
1270
1271
  get: function get() {
1271
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1272
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1273
- return textContentGetterPatched.call(this);
1274
- }
1275
- return textContentGetter.call(this);
1276
- }
1277
- // TODO [#1222]: remove global bypass
1278
- if (isGlobalPatchingSkipped(this)) {
1279
- return textContentGetter.call(this);
1272
+ // Note: we deviate from native shadow here, but are not fixing
1273
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
1274
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1275
+ return textContentGetterPatched.call(this);
1280
1276
  }
1281
- return textContentGetterPatched.call(this);
1277
+ return textContentGetter.call(this);
1282
1278
  },
1283
1279
  set: textContentSetterPatched,
1284
1280
  enumerable: true,
@@ -1339,7 +1335,8 @@
1339
1335
  },
1340
1336
  compareDocumentPosition: {
1341
1337
  value: function value(otherNode) {
1342
- // TODO [#1222]: remove global bypass
1338
+ // Note: we deviate from native shadow here, but are not fixing
1339
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
1343
1340
  if (isGlobalPatchingSkipped(this)) {
1344
1341
  return compareDocumentPosition.call(this, otherNode);
1345
1342
  }
@@ -1358,20 +1355,15 @@
1358
1355
  if (this === otherNode) {
1359
1356
  return true;
1360
1357
  }
1361
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1362
- if (otherNode == null) {
1363
- return false;
1364
- }
1365
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1366
- return containsPatched.call(this, otherNode);
1367
- }
1368
- return contains.call(this, otherNode);
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 (otherNode == null) {
1361
+ return false;
1369
1362
  }
1370
- // TODO [#1222]: remove global bypass
1371
- if (isGlobalPatchingSkipped(this)) {
1372
- return contains.call(this, otherNode);
1363
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1364
+ return containsPatched.call(this, otherNode);
1373
1365
  }
1374
- return containsPatched.call(this, otherNode);
1366
+ return contains.call(this, otherNode);
1375
1367
  },
1376
1368
  enumerable: true,
1377
1369
  writable: true,
@@ -1379,17 +1371,9 @@
1379
1371
  },
1380
1372
  cloneNode: {
1381
1373
  value: function value(deep) {
1382
- if (!lwcRuntimeFlags.ENABLE_NODE_PATCH) {
1383
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1384
- return cloneNodePatched.call(this, deep);
1385
- }
1386
- return cloneNode.call(this, deep);
1387
- }
1388
- if (isTrue(deep)) {
1389
- // TODO [#1222]: remove global bypass
1390
- if (isGlobalPatchingSkipped(this)) {
1391
- return cloneNode.call(this, deep);
1392
- }
1374
+ // Note: we deviate from native shadow here, but are not fixing
1375
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
1376
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
1393
1377
  return cloneNodePatched.call(this, deep);
1394
1378
  }
1395
1379
  return cloneNode.call(this, deep);
@@ -2326,7 +2310,8 @@
2326
2310
  if (isNull(elm)) {
2327
2311
  return null;
2328
2312
  }
2329
- // TODO [#1222]: remove global bypass
2313
+ // Note: we deviate from native shadow here, but are not fixing
2314
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2330
2315
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm) ? elm : null;
2331
2316
  },
2332
2317
  writable: true,
@@ -2337,7 +2322,8 @@
2337
2322
  value: function value() {
2338
2323
  var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
2339
2324
  var filtered = ArrayFind.call(elements,
2340
- // TODO [#1222]: remove global bypass
2325
+ // Note: we deviate from native shadow here, but are not fixing
2326
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2341
2327
  function (elm) {
2342
2328
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2343
2329
  });
@@ -2351,7 +2337,8 @@
2351
2337
  value: function value() {
2352
2338
  var elements = arrayFromCollection(querySelectorAll.apply(this, ArraySlice.call(arguments)));
2353
2339
  var filtered = ArrayFilter.call(elements,
2354
- // TODO [#1222]: remove global bypass
2340
+ // Note: we deviate from native shadow here, but are not fixing
2341
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2355
2342
  function (elm) {
2356
2343
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2357
2344
  });
@@ -2365,7 +2352,8 @@
2365
2352
  value: function value() {
2366
2353
  var elements = arrayFromCollection(getElementsByClassName.apply(this, ArraySlice.call(arguments)));
2367
2354
  var filtered = ArrayFilter.call(elements,
2368
- // TODO [#1222]: remove global bypass
2355
+ // Note: we deviate from native shadow here, but are not fixing
2356
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2369
2357
  function (elm) {
2370
2358
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2371
2359
  });
@@ -2379,7 +2367,8 @@
2379
2367
  value: function value() {
2380
2368
  var elements = arrayFromCollection(getElementsByTagName.apply(this, ArraySlice.call(arguments)));
2381
2369
  var filtered = ArrayFilter.call(elements,
2382
- // TODO [#1222]: remove global bypass
2370
+ // Note: we deviate from native shadow here, but are not fixing
2371
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2383
2372
  function (elm) {
2384
2373
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2385
2374
  });
@@ -2393,7 +2382,8 @@
2393
2382
  value: function value() {
2394
2383
  var elements = arrayFromCollection(getElementsByTagNameNS.apply(this, ArraySlice.call(arguments)));
2395
2384
  var filtered = ArrayFilter.call(elements,
2396
- // TODO [#1222]: remove global bypass
2385
+ // Note: we deviate from native shadow here, but are not fixing
2386
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2397
2387
  function (elm) {
2398
2388
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2399
2389
  });
@@ -2409,7 +2399,8 @@
2409
2399
  value: function value() {
2410
2400
  var elements = arrayFromCollection(getElementsByName.apply(this, ArraySlice.call(arguments)));
2411
2401
  var filtered = ArrayFilter.call(elements,
2412
- // TODO [#1222]: remove global bypass
2402
+ // Note: we deviate from native shadow here, but are not fixing
2403
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
2413
2404
  function (elm) {
2414
2405
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(elm);
2415
2406
  });
@@ -3504,7 +3495,8 @@
3504
3495
  } else if (context instanceof HTMLBodyElement) {
3505
3496
  // `context` is document.body which is already patched.
3506
3497
  filtered = ArrayFilter.call(unfilteredNodes,
3507
- // TODO [#1222]: remove global bypass
3498
+ // Note: we deviate from native shadow here, but are not fixing
3499
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3508
3500
  function (elm) {
3509
3501
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
3510
3502
  });
@@ -3570,17 +3562,12 @@
3570
3562
  defineProperties(Element.prototype, {
3571
3563
  innerHTML: {
3572
3564
  get: function get() {
3573
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
3574
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3575
- return innerHTMLGetterPatched.call(this);
3576
- }
3577
- return innerHTMLGetter.call(this);
3565
+ // Note: we deviate from native shadow here, but are not fixing
3566
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3567
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3568
+ return innerHTMLGetterPatched.call(this);
3578
3569
  }
3579
- // TODO [#1222]: remove global bypass
3580
- if (isGlobalPatchingSkipped(this)) {
3581
- return innerHTMLGetter.call(this);
3582
- }
3583
- return innerHTMLGetterPatched.call(this);
3570
+ return innerHTMLGetter.call(this);
3584
3571
  },
3585
3572
  set: function set(v) {
3586
3573
  innerHTMLSetter.call(this, v);
@@ -3590,17 +3577,12 @@
3590
3577
  },
3591
3578
  outerHTML: {
3592
3579
  get: function get() {
3593
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
3594
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3595
- return outerHTMLGetterPatched.call(this);
3596
- }
3597
- return outerHTMLGetter.call(this);
3598
- }
3599
- // TODO [#1222]: remove global bypass
3600
- if (isGlobalPatchingSkipped(this)) {
3601
- return outerHTMLGetter.call(this);
3580
+ // Note: we deviate from native shadow here, but are not fixing
3581
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3582
+ if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
3583
+ return outerHTMLGetterPatched.call(this);
3602
3584
  }
3603
- return outerHTMLGetterPatched.call(this);
3585
+ return outerHTMLGetter.call(this);
3604
3586
  },
3605
3587
  set: function set(v) {
3606
3588
  outerHTMLSetter.call(this, v);
@@ -3702,35 +3684,24 @@
3702
3684
  });
3703
3685
  return isUndefined(elm) ? null : elm;
3704
3686
  } else {
3705
- if (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3706
- // `this` is a manually inserted element inside a shadowRoot, return the first element.
3707
- return nodeList.length === 0 ? null : nodeList[0];
3708
- }
3709
- // Element is inside a shadow but we dont know which one. Use the
3710
- // "nearest" owner key to filter by ownership.
3711
- var contextNearestOwnerKey = getNodeNearestOwnerKey(this);
3712
- var _elm = ArrayFind.call(nodeList, function (elm) {
3713
- return getNodeNearestOwnerKey(elm) === contextNearestOwnerKey;
3714
- });
3715
- return isUndefined(_elm) ? null : _elm;
3687
+ // Note: we deviate from native shadow here, but are not fixing
3688
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3689
+ // `this` is a manually inserted element inside a shadowRoot, return the first element.
3690
+ return nodeList.length === 0 ? null : nodeList[0];
3716
3691
  }
3717
3692
  } else {
3718
- if (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3719
- if (!(this instanceof HTMLBodyElement)) {
3720
- var _elm3 = nodeList[0];
3721
- return isUndefined(_elm3) ? null : _elm3;
3722
- }
3693
+ if (!(this instanceof HTMLBodyElement)) {
3694
+ var _elm2 = nodeList[0];
3695
+ return isUndefined(_elm2) ? null : _elm2;
3723
3696
  }
3724
3697
  // element belonging to the document
3725
- var _elm2 = ArrayFind.call(nodeList,
3726
- // TODO [#1222]: remove global bypass
3727
- function (elm) {
3698
+ var _elm = ArrayFind.call(nodeList, function (elm) {
3728
3699
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(_this3);
3729
3700
  });
3730
- return isUndefined(_elm2) ? null : _elm2;
3701
+ return isUndefined(_elm) ? null : _elm;
3731
3702
  }
3732
3703
  }
3733
- function getFilteredArrayOfNodes(context, unfilteredNodes, shadowDomSemantic) {
3704
+ function getFilteredArrayOfNodes(context, unfilteredNodes) {
3734
3705
  var filtered;
3735
3706
  if (isSyntheticShadowHost(context)) {
3736
3707
  // element with shadowRoot attached
@@ -3752,22 +3723,16 @@
3752
3723
  filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
3753
3724
  return getNodeNearestOwnerKey(elm) === ownerKey;
3754
3725
  });
3755
- } else if (shadowDomSemantic === 1 /* ShadowDomSemantic.Enabled */) {
3756
- // context is inside a shadow, we dont know which one.
3757
- var contextNearestOwnerKey = getNodeNearestOwnerKey(context);
3758
- filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
3759
- return getNodeNearestOwnerKey(elm) === contextNearestOwnerKey;
3760
- });
3761
3726
  } else {
3762
- // context is manually inserted without lwc:dom-manual and ShadowDomSemantics is off, return everything
3727
+ // Note: we deviate from native shadow here, but are not fixing
3728
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3729
+ // context is manually inserted without lwc:dom-manual, return everything
3763
3730
  filtered = ArraySlice.call(unfilteredNodes);
3764
3731
  }
3765
3732
  } else {
3766
- if (context instanceof HTMLBodyElement || shadowDomSemantic === 1 /* ShadowDomSemantic.Enabled */) {
3733
+ if (context instanceof HTMLBodyElement) {
3767
3734
  // `context` is document.body or element belonging to the document with the patch enabled
3768
- filtered = ArrayFilter.call(unfilteredNodes,
3769
- // TODO [#1222]: remove global bypass
3770
- function (elm) {
3735
+ filtered = ArrayFilter.call(unfilteredNodes, function (elm) {
3771
3736
  return isUndefined(getNodeOwnerKey(elm)) || isGlobalPatchingSkipped(context);
3772
3737
  });
3773
3738
  } else {
@@ -3796,13 +3761,11 @@
3796
3761
  querySelectorAll: {
3797
3762
  value: function value() {
3798
3763
  var nodeList = arrayFromCollection(querySelectorAll$1.apply(this, ArraySlice.call(arguments)));
3799
- if (!lwcRuntimeFlags.ENABLE_NODE_LIST_PATCH) {
3800
- var filteredResults = getFilteredArrayOfNodes(this, nodeList, 0 /* ShadowDomSemantic.Disabled */);
3801
- return createStaticNodeList(filteredResults);
3802
- }
3803
- return createStaticNodeList(getFilteredArrayOfNodes(this, nodeList, 1 /* ShadowDomSemantic.Enabled */));
3764
+ // Note: we deviate from native shadow here, but are not fixing
3765
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3766
+ var filteredResults = getFilteredArrayOfNodes(this, nodeList);
3767
+ return createStaticNodeList(filteredResults);
3804
3768
  },
3805
-
3806
3769
  writable: true,
3807
3770
  enumerable: true,
3808
3771
  configurable: true
@@ -3814,11 +3777,9 @@
3814
3777
  getElementsByClassName: {
3815
3778
  value: function value() {
3816
3779
  var elements = arrayFromCollection(getElementsByClassName$1.apply(this, ArraySlice.call(arguments)));
3817
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
3818
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3819
- }
3820
- var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
3821
- return createStaticHTMLCollection(filteredResults);
3780
+ // Note: we deviate from native shadow here, but are not fixing
3781
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3782
+ return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3822
3783
  },
3823
3784
  writable: true,
3824
3785
  enumerable: true,
@@ -3827,11 +3788,9 @@
3827
3788
  getElementsByTagName: {
3828
3789
  value: function value() {
3829
3790
  var elements = arrayFromCollection(getElementsByTagName$1.apply(this, ArraySlice.call(arguments)));
3830
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
3831
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3832
- }
3833
- var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
3834
- return createStaticHTMLCollection(filteredResults);
3791
+ // Note: we deviate from native shadow here, but are not fixing
3792
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3793
+ return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3835
3794
  },
3836
3795
  writable: true,
3837
3796
  enumerable: true,
@@ -3840,11 +3799,9 @@
3840
3799
  getElementsByTagNameNS: {
3841
3800
  value: function value() {
3842
3801
  var elements = arrayFromCollection(getElementsByTagNameNS$1.apply(this, ArraySlice.call(arguments)));
3843
- if (!lwcRuntimeFlags.ENABLE_HTML_COLLECTIONS_PATCH) {
3844
- return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3845
- }
3846
- var filteredResults = getFilteredArrayOfNodes(this, elements, 1 /* ShadowDomSemantic.Enabled */);
3847
- return createStaticHTMLCollection(filteredResults);
3802
+ // Note: we deviate from native shadow here, but are not fixing
3803
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
3804
+ return createStaticHTMLCollection(getNonPatchedFilteredArrayOfNodes(this, elements));
3848
3805
  },
3849
3806
  writable: true,
3850
3807
  enumerable: true,
@@ -3857,199 +3814,6 @@
3857
3814
  defineProperty(HTMLElement.prototype, 'getElementsByClassName', getOwnPropertyDescriptor(Element.prototype, 'getElementsByClassName'));
3858
3815
  }
3859
3816
 
3860
- /*
3861
- * Copyright (c) 2018, salesforce.com, inc.
3862
- * All rights reserved.
3863
- * SPDX-License-Identifier: MIT
3864
- * For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
3865
- */
3866
- function getElementComputedStyle(element) {
3867
- var win = getOwnerWindow(element);
3868
- return windowGetComputedStyle.call(win, element);
3869
- }
3870
- function getWindowSelection(node) {
3871
- var win = getOwnerWindow(node);
3872
- return windowGetSelection.call(win);
3873
- }
3874
- function nodeIsBeingRendered(nodeComputedStyle) {
3875
- return nodeComputedStyle.visibility === 'visible' && nodeComputedStyle.display !== 'none';
3876
- }
3877
- function getSelectionState(element) {
3878
- var win = getOwnerWindow(element);
3879
- var selection = getWindowSelection(element);
3880
- if (selection === null) {
3881
- return null;
3882
- }
3883
- var ranges = [];
3884
- for (var i = 0; i < selection.rangeCount; i++) {
3885
- ranges.push(selection.getRangeAt(i));
3886
- }
3887
- var state = {
3888
- element: element,
3889
- onselect: win.onselect,
3890
- onselectstart: win.onselectstart,
3891
- onselectionchange: win.onselectionchange,
3892
- ranges: ranges
3893
- };
3894
- win.onselect = null;
3895
- win.onselectstart = null;
3896
- win.onselectionchange = null;
3897
- return state;
3898
- }
3899
- function restoreSelectionState(state) {
3900
- if (state === null) {
3901
- return;
3902
- }
3903
- var element = state.element,
3904
- onselect = state.onselect,
3905
- onselectstart = state.onselectstart,
3906
- onselectionchange = state.onselectionchange,
3907
- ranges = state.ranges;
3908
- var win = getOwnerWindow(element);
3909
- var selection = getWindowSelection(element);
3910
- selection.removeAllRanges();
3911
- for (var i = 0; i < ranges.length; i++) {
3912
- selection.addRange(ranges[i]);
3913
- }
3914
- win.onselect = onselect;
3915
- win.onselectstart = onselectstart;
3916
- win.onselectionchange = onselectionchange;
3917
- }
3918
- /**
3919
- * Gets the "innerText" of a text node using the Selection API
3920
- *
3921
- * NOTE: For performance reasons, since this function will be called multiple times while calculating the innerText of
3922
- * an element, it does not restore the current selection.
3923
- */
3924
- function getTextNodeInnerText(textNode) {
3925
- var selection = getWindowSelection(textNode);
3926
- if (selection === null) {
3927
- return textNode.textContent || '';
3928
- }
3929
- var range = document.createRange();
3930
- range.selectNodeContents(textNode);
3931
- var domRect = range.getBoundingClientRect();
3932
- if (domRect.height <= 0 || domRect.width <= 0) {
3933
- // the text node is not rendered
3934
- return '';
3935
- }
3936
- // Needed to remove non rendered characters from the text node.
3937
- selection.removeAllRanges();
3938
- selection.addRange(range);
3939
- var selectionText = selection.toString();
3940
- // The textNode is visible, but it may not be selectable. When the text is not selectable,
3941
- // textContent is the nearest approximation to innerText.
3942
- return selectionText ? selectionText : textNode.textContent || '';
3943
- }
3944
- var nodeIsElement = function nodeIsElement(node) {
3945
- return node.nodeType === ELEMENT_NODE;
3946
- };
3947
- var nodeIsText = function nodeIsText(node) {
3948
- return node.nodeType === TEXT_NODE;
3949
- };
3950
- /**
3951
- * Spec: https://html.spec.whatwg.org/multipage/dom.html#inner-text-collection-steps
3952
- * One spec implementation: https://github.com/servo/servo/blob/721271dcd3c20db5ca8cf146e2b5907647afb4d6/components/layout/query.rs#L1132
3953
- */
3954
- function innerTextCollectionSteps(node) {
3955
- var items = [];
3956
- if (nodeIsElement(node)) {
3957
- var tagName = node.tagName;
3958
- var computedStyle = getElementComputedStyle(node);
3959
- if (tagName === 'OPTION') {
3960
- // For options, is hard to get the "rendered" text, let's use the original getter.
3961
- return [1, innerTextGetter.call(node), 1];
3962
- } else if (tagName === 'TEXTAREA') {
3963
- return [];
3964
- } else {
3965
- var childNodes = node.childNodes;
3966
- for (var i = 0, n = childNodes.length; i < n; i++) {
3967
- ArrayPush.apply(items, innerTextCollectionSteps(childNodes[i]));
3968
- }
3969
- }
3970
- if (!nodeIsBeingRendered(computedStyle)) {
3971
- if (tagName === 'SELECT' || tagName === 'DATALIST') {
3972
- // the select is either: .visibility != 'visible' or .display === hidden, therefore this select should
3973
- // not display any value.
3974
- return [];
3975
- }
3976
- return items;
3977
- }
3978
- if (tagName === 'BR') {
3979
- items.push("\n" /* line feed */);
3980
- }
3981
-
3982
- var display = computedStyle.display;
3983
- if (display === 'table-cell') {
3984
- // omitting case: and node's CSS box is not the last 'table-cell' box of its enclosing 'table-row' box
3985
- items.push("\t" /* tab */);
3986
- }
3987
-
3988
- if (display === 'table-row') {
3989
- // omitting case: and node's CSS box is not the last 'table-row' box of the nearest ancestor 'table' box
3990
- items.push("\n" /* line feed */);
3991
- }
3992
-
3993
- if (tagName === 'P') {
3994
- items.unshift(2);
3995
- items.push(2);
3996
- }
3997
- if (display === 'block' || display === 'table-caption' || display === 'flex' || display === 'table') {
3998
- items.unshift(1);
3999
- items.push(1);
4000
- }
4001
- } else if (nodeIsText(node)) {
4002
- items.push(getTextNodeInnerText(node));
4003
- }
4004
- return items;
4005
- }
4006
- /**
4007
- * InnerText getter spec: https://html.spec.whatwg.org/multipage/dom.html#the-innertext-idl-attribute
4008
- *
4009
- * One spec implementation: https://github.com/servo/servo/blob/721271dcd3c20db5ca8cf146e2b5907647afb4d6/components/layout/query.rs#L1087
4010
- */
4011
- function getInnerText(element) {
4012
- var thisComputedStyle = getElementComputedStyle(element);
4013
- if (!nodeIsBeingRendered(thisComputedStyle)) {
4014
- return getTextContent(element) || '';
4015
- }
4016
- var selectionState = getSelectionState(element);
4017
- var results = [];
4018
- var childNodes = element.childNodes;
4019
- for (var i = 0, n = childNodes.length; i < n; i++) {
4020
- ArrayPush.apply(results, innerTextCollectionSteps(childNodes[i]));
4021
- }
4022
- restoreSelectionState(selectionState);
4023
- var elementInnerText = '';
4024
- var maxReqLineBreakCount = 0;
4025
- for (var _i = 0, _n = results.length; _i < _n; _i++) {
4026
- var item = results[_i];
4027
- if (typeof item === 'string') {
4028
- if (maxReqLineBreakCount > 0) {
4029
- for (var j = 0; j < maxReqLineBreakCount; j++) {
4030
- elementInnerText += "\n";
4031
- }
4032
- maxReqLineBreakCount = 0;
4033
- }
4034
- if (item.length > 0) {
4035
- elementInnerText += item;
4036
- }
4037
- } else {
4038
- if (elementInnerText.length == 0) {
4039
- // Remove required line break count at the start.
4040
- continue;
4041
- }
4042
- // Store the count if it's the max of this run,
4043
- // but it may be ignored if no text item is found afterwards,
4044
- // which means that these are consecutive line breaks at the end.
4045
- if (item > maxReqLineBreakCount) {
4046
- maxReqLineBreakCount = item;
4047
- }
4048
- }
4049
- }
4050
- return elementInnerText;
4051
- }
4052
-
4053
3817
  /*
4054
3818
  * Copyright (c) 2018, salesforce.com, inc.
4055
3819
  * All rights reserved.
@@ -4519,20 +4283,9 @@
4519
4283
  if (innerTextGetter !== null && innerTextSetter !== null) {
4520
4284
  defineProperty(HTMLElement.prototype, 'innerText', {
4521
4285
  get: function get() {
4522
- if (!lwcRuntimeFlags.ENABLE_INNER_OUTER_TEXT_PATCH) {
4523
- return innerTextGetter.call(this);
4524
- }
4525
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
4526
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
4527
- return getInnerText(this);
4528
- }
4529
- return innerTextGetter.call(this);
4530
- }
4531
- // TODO [#1222]: remove global bypass
4532
- if (isGlobalPatchingSkipped(this)) {
4533
- return innerTextGetter.call(this);
4534
- }
4535
- return getInnerText(this);
4286
+ // Note: we deviate from native shadow here, but are not fixing
4287
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
4288
+ return innerTextGetter.call(this);
4536
4289
  },
4537
4290
  set: function set(v) {
4538
4291
  innerTextSetter.call(this, v);
@@ -4548,20 +4301,9 @@
4548
4301
  // As a setter, it removes the current node and replaces it with the given text.
4549
4302
  defineProperty(HTMLElement.prototype, 'outerText', {
4550
4303
  get: function get() {
4551
- if (!lwcRuntimeFlags.ENABLE_INNER_OUTER_TEXT_PATCH) {
4552
- return outerTextGetter.call(this);
4553
- }
4554
- if (!lwcRuntimeFlags.ENABLE_ELEMENT_PATCH) {
4555
- if (isNodeShadowed(this) || isSyntheticShadowHost(this)) {
4556
- return getInnerText(this);
4557
- }
4558
- return outerTextGetter.call(this);
4559
- }
4560
- // TODO [#1222]: remove global bypass
4561
- if (isGlobalPatchingSkipped(this)) {
4562
- return outerTextGetter.call(this);
4563
- }
4564
- return getInnerText(this);
4304
+ // Note: we deviate from native shadow here, but are not fixing
4305
+ // due to backwards compat: https://github.com/salesforce/lwc/pull/3103
4306
+ return outerTextGetter.call(this);
4565
4307
  },
4566
4308
  set: function set(v) {
4567
4309
  // Invoking the `outerText` setter on a host element should trigger its disconnection, but until we merge node reactions, it will not work.
@@ -4700,8 +4442,8 @@
4700
4442
  adoptChildNode(node, DocumentResolverFn, undefined);
4701
4443
  }
4702
4444
  }
4703
- for (var _i2 = 0, _len = addedNodes.length; _i2 < _len; _i2 += 1) {
4704
- var _node = addedNodes[_i2];
4445
+ for (var _i = 0, _len = addedNodes.length; _i < _len; _i += 1) {
4446
+ var _node = addedNodes[_i];
4705
4447
  if (compareDocumentPosition.call(elm, _node) & _Node.DOCUMENT_POSITION_CONTAINED_BY) {
4706
4448
  adoptChildNode(_node, fn, shadowToken);
4707
4449
  }
@@ -4750,6 +4492,6 @@
4750
4492
  },
4751
4493
  configurable: true
4752
4494
  });
4753
- /** version: 2.32.0 */
4495
+ /** version: 2.33.0 */
4754
4496
 
4755
4497
  }));