lwc 2.5.10 → 2.6.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/engine-dom/esm/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/iife/es5/engine-dom.js +737 -433
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +704 -408
- package/dist/engine-dom/umd/es2017/engine-dom.js +674 -471
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +647 -446
- package/dist/engine-dom/umd/es5/engine-dom.js +737 -433
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +704 -408
- package/dist/engine-server/commonjs/es2017/engine-server.js +754 -549
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +754 -549
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +146 -137
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +135 -140
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +135 -140
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +146 -137
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +146 -137
- package/dist/wire-service/esm/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service.js +2 -2
- package/dist/wire-service/iife/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/iife/es5/wire-service.js +11 -11
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +11 -11
- package/dist/wire-service/umd/es2017/wire-service.js +2 -2
- package/dist/wire-service/umd/es2017/wire-service_debug.js +2 -2
- package/dist/wire-service/umd/es5/wire-service.js +11 -11
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +11 -11
- package/package.json +8 -8
|
@@ -5,9 +5,13 @@
|
|
|
5
5
|
|
|
6
6
|
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; }
|
|
7
7
|
|
|
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); } }
|
|
9
|
+
|
|
10
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
11
|
+
|
|
8
12
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
9
13
|
|
|
10
|
-
function _typeof(obj) { "@babel/helpers - typeof";
|
|
14
|
+
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); }
|
|
11
15
|
/*
|
|
12
16
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
13
17
|
* All rights reserved.
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
var KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
118
122
|
var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
119
123
|
var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
120
|
-
/** version: 2.
|
|
124
|
+
/** version: 2.6.3 */
|
|
121
125
|
|
|
122
126
|
/*
|
|
123
127
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -216,6 +220,9 @@
|
|
|
216
220
|
var shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : function () {
|
|
217
221
|
return null;
|
|
218
222
|
};
|
|
223
|
+
var assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : function () {
|
|
224
|
+
return null;
|
|
225
|
+
};
|
|
219
226
|
/*
|
|
220
227
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
221
228
|
* All rights reserved.
|
|
@@ -348,9 +355,9 @@
|
|
|
348
355
|
function apply$4() {
|
|
349
356
|
// IE11 does not have this element definition
|
|
350
357
|
// we don't care much about the construction phase, just the prototype
|
|
351
|
-
var HTMLSlotElement = function HTMLSlotElement() {
|
|
358
|
+
var HTMLSlotElement = /*#__PURE__*/_createClass(function HTMLSlotElement() {
|
|
352
359
|
_classCallCheck(this, HTMLSlotElement);
|
|
353
|
-
}; // prototype inheritance dance
|
|
360
|
+
}); // prototype inheritance dance
|
|
354
361
|
|
|
355
362
|
|
|
356
363
|
setPrototypeOf(HTMLSlotElement, HTMLElement.constructor);
|
|
@@ -436,20 +443,6 @@
|
|
|
436
443
|
|
|
437
444
|
return cloned;
|
|
438
445
|
}
|
|
439
|
-
/**
|
|
440
|
-
* Copyright (C) 2018 salesforce.com, inc.
|
|
441
|
-
*/
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
if (!_globalThis.lwcRuntimeFlags) {
|
|
445
|
-
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
446
|
-
value: create(null)
|
|
447
|
-
});
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
451
|
-
/** version: 2.5.10 */
|
|
452
|
-
|
|
453
446
|
/*
|
|
454
447
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
455
448
|
* All rights reserved.
|
|
@@ -457,6 +450,7 @@
|
|
|
457
450
|
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
458
451
|
*/
|
|
459
452
|
|
|
453
|
+
|
|
460
454
|
var eventTargetPrototype = typeof EventTarget !== 'undefined' ? EventTarget.prototype : _Node.prototype;
|
|
461
455
|
var addEventListener = eventTargetPrototype.addEventListener,
|
|
462
456
|
dispatchEvent = eventTargetPrototype.dispatchEvent,
|
|
@@ -505,17 +499,9 @@
|
|
|
505
499
|
// This function is invoked from an event listener and currentTarget is always defined.
|
|
506
500
|
var currentTarget = eventCurrentTargetGetter.call(event);
|
|
507
501
|
|
|
508
|
-
var
|
|
509
|
-
var shouldInvoke;
|
|
510
|
-
|
|
511
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
512
|
-
shouldInvoke = !(eventToShadowRootMap.has(event) && isFalse(composed));
|
|
513
|
-
} else {
|
|
514
|
-
var actualTarget = getActualTarget(event);
|
|
515
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
516
|
-
}
|
|
502
|
+
var actualTarget = getActualTarget(event);
|
|
517
503
|
|
|
518
|
-
if (!
|
|
504
|
+
if (!shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
519
505
|
return;
|
|
520
506
|
}
|
|
521
507
|
|
|
@@ -536,25 +522,6 @@
|
|
|
536
522
|
|
|
537
523
|
|
|
538
524
|
var eventToContextMap = new WeakMap();
|
|
539
|
-
|
|
540
|
-
function isChildNode(root, node) {
|
|
541
|
-
return !!(compareDocumentPosition.call(root, node) & DOCUMENT_POSITION_CONTAINED_BY);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
|
-
var GET_ROOT_NODE_CONFIG_FALSE = {
|
|
545
|
-
composed: false
|
|
546
|
-
};
|
|
547
|
-
|
|
548
|
-
function getRootNodeHost(node, options) {
|
|
549
|
-
var rootNode = node.getRootNode(options);
|
|
550
|
-
|
|
551
|
-
if (isSyntheticShadowRoot(rootNode)) {
|
|
552
|
-
rootNode = getHost(rootNode);
|
|
553
|
-
}
|
|
554
|
-
|
|
555
|
-
return rootNode;
|
|
556
|
-
}
|
|
557
|
-
|
|
558
525
|
var customElementToWrappedListeners = new WeakMap();
|
|
559
526
|
|
|
560
527
|
function getEventMap(elm) {
|
|
@@ -599,16 +566,9 @@
|
|
|
599
566
|
currentTarget = getShadowRoot(currentTarget);
|
|
600
567
|
}
|
|
601
568
|
|
|
602
|
-
var
|
|
603
|
-
|
|
604
|
-
if (runtimeFlags.ENABLE_NON_COMPOSED_EVENTS_LEAKAGE) {
|
|
605
|
-
shouldInvoke = shouldInvokeShadowRootListener(event);
|
|
606
|
-
} else {
|
|
607
|
-
var actualTarget = getActualTarget(event);
|
|
608
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
609
|
-
}
|
|
569
|
+
var actualTarget = getActualTarget(event);
|
|
610
570
|
|
|
611
|
-
if (
|
|
571
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
612
572
|
listener.call(currentTarget, event);
|
|
613
573
|
}
|
|
614
574
|
};
|
|
@@ -635,16 +595,9 @@
|
|
|
635
595
|
customElementWrappedListener = function customElementWrappedListener(event) {
|
|
636
596
|
// currentTarget is always defined inside an event listener
|
|
637
597
|
var currentTarget = eventCurrentTargetGetter.call(event);
|
|
638
|
-
var
|
|
598
|
+
var actualTarget = getActualTarget(event);
|
|
639
599
|
|
|
640
|
-
if (
|
|
641
|
-
shouldInvoke = shouldInvokeCustomElementListener(event);
|
|
642
|
-
} else {
|
|
643
|
-
var actualTarget = getActualTarget(event);
|
|
644
|
-
shouldInvoke = shouldInvokeListener(event, actualTarget, currentTarget);
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
if (shouldInvoke) {
|
|
600
|
+
if (shouldInvokeListener(event, actualTarget, currentTarget)) {
|
|
648
601
|
listener.call(currentTarget, event);
|
|
649
602
|
}
|
|
650
603
|
};
|
|
@@ -761,66 +714,6 @@
|
|
|
761
714
|
}
|
|
762
715
|
}
|
|
763
716
|
|
|
764
|
-
function shouldInvokeCustomElementListener(event) {
|
|
765
|
-
var composed = event.composed;
|
|
766
|
-
|
|
767
|
-
if (isTrue(composed)) {
|
|
768
|
-
// Listeners on host elements should always be invoked for {composed: true} events.
|
|
769
|
-
return true;
|
|
770
|
-
} // If this {composed: false} event was dispatched on any root.
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
if (eventToShadowRootMap.has(event)) {
|
|
774
|
-
return false;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
var target = eventTargetGetter.call(event);
|
|
778
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If this {composed: false} event was dispatched on the current target host.
|
|
779
|
-
|
|
780
|
-
if (target === currentTarget) {
|
|
781
|
-
return true;
|
|
782
|
-
} // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
783
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
784
|
-
// host was assigned to a slot in the composed subtree of the current target host.
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
788
|
-
var currentTargetHost = currentTarget;
|
|
789
|
-
return isChildNode(targetHost, currentTargetHost);
|
|
790
|
-
}
|
|
791
|
-
|
|
792
|
-
function shouldInvokeShadowRootListener(event) {
|
|
793
|
-
var composed = event.composed;
|
|
794
|
-
var target = eventTargetGetter.call(event);
|
|
795
|
-
var currentTarget = eventCurrentTargetGetter.call(event); // If the event was dispatched on the host or its root.
|
|
796
|
-
|
|
797
|
-
if (target === currentTarget) {
|
|
798
|
-
// Invoke the listener if the event was dispatched directly on the root.
|
|
799
|
-
return eventToShadowRootMap.get(event) === getShadowRoot(target);
|
|
800
|
-
} // At this point the event is {bubbles: true} and was dispatched from a shadow-including descendant node.
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
if (isTrue(composed)) {
|
|
804
|
-
// Invoke the listener if the event is {composed: true}.
|
|
805
|
-
return true;
|
|
806
|
-
} // At this point the event must be {bubbles: true, composed: false}.
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
if (isTrue(eventToShadowRootMap.has(event))) {
|
|
810
|
-
// Don't invoke the listener because the event was dispatched on a descendant root.
|
|
811
|
-
return false;
|
|
812
|
-
}
|
|
813
|
-
|
|
814
|
-
var targetHost = getRootNodeHost(target, GET_ROOT_NODE_CONFIG_FALSE);
|
|
815
|
-
var currentTargetHost = currentTarget;
|
|
816
|
-
var isCurrentTargetSlotted = isChildNode(targetHost, currentTargetHost); // At this point the event must be {bubbles: true, composed: false} and was dispatched from a
|
|
817
|
-
// shadow-excluding descendant node. In this case, we only invoke the listener if the target
|
|
818
|
-
// host was assigned to a slot in the composed subtree of the current target host, or the
|
|
819
|
-
// descendant node is in the shadow tree of the current root.
|
|
820
|
-
|
|
821
|
-
return isCurrentTargetSlotted || targetHost === currentTargetHost;
|
|
822
|
-
}
|
|
823
|
-
|
|
824
717
|
function addCustomElementEventListener(type, listener, _options) {
|
|
825
718
|
|
|
826
719
|
|
|
@@ -922,6 +815,15 @@
|
|
|
922
815
|
function isNodeShadowed(node) {
|
|
923
816
|
return !isUndefined(getNodeOwnerKey(node));
|
|
924
817
|
}
|
|
818
|
+
/**
|
|
819
|
+
* Returns true if this node is a shadow host, is in a shadow host, or contains a shadow host
|
|
820
|
+
* anywhere in its tree.
|
|
821
|
+
*/
|
|
822
|
+
|
|
823
|
+
|
|
824
|
+
function isNodeOrDescendantsShadowed(node) {
|
|
825
|
+
return isNodeShadowed(node) || isSyntheticShadowHost(node) || containsHost(node);
|
|
826
|
+
}
|
|
925
827
|
/*
|
|
926
828
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
927
829
|
* All rights reserved.
|
|
@@ -1513,6 +1415,20 @@
|
|
|
1513
1415
|
}
|
|
1514
1416
|
}
|
|
1515
1417
|
}
|
|
1418
|
+
/**
|
|
1419
|
+
* Copyright (C) 2018 salesforce.com, inc.
|
|
1420
|
+
*/
|
|
1421
|
+
|
|
1422
|
+
|
|
1423
|
+
if (!_globalThis.lwcRuntimeFlags) {
|
|
1424
|
+
Object.defineProperty(_globalThis, 'lwcRuntimeFlags', {
|
|
1425
|
+
value: create(null)
|
|
1426
|
+
});
|
|
1427
|
+
}
|
|
1428
|
+
|
|
1429
|
+
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1430
|
+
/** version: 2.6.3 */
|
|
1431
|
+
|
|
1516
1432
|
/*
|
|
1517
1433
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
1518
1434
|
* All rights reserved.
|
|
@@ -1527,7 +1443,6 @@
|
|
|
1527
1443
|
* because we don't want to patch the children getters for those elements.
|
|
1528
1444
|
*/
|
|
1529
1445
|
|
|
1530
|
-
|
|
1531
1446
|
function hasMountedChildren(node) {
|
|
1532
1447
|
return isSyntheticSlotElement(node) || isSyntheticShadowHost(node);
|
|
1533
1448
|
}
|
|
@@ -1606,7 +1521,9 @@
|
|
|
1606
1521
|
}
|
|
1607
1522
|
|
|
1608
1523
|
function compareDocumentPositionPatched(otherNode) {
|
|
1609
|
-
if (this
|
|
1524
|
+
if (this === otherNode) {
|
|
1525
|
+
return 0;
|
|
1526
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1610
1527
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1611
1528
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1612
1529
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -1652,7 +1569,7 @@
|
|
|
1652
1569
|
function childNodesGetterPatched() {
|
|
1653
1570
|
if (isSyntheticShadowHost(this)) {
|
|
1654
1571
|
var owner = getNodeOwner(this);
|
|
1655
|
-
var childNodes = isNull(owner) ?
|
|
1572
|
+
var childNodes = isNull(owner) ? getFilteredChildNodes(this) : getAllMatches(owner, getFilteredChildNodes(this));
|
|
1656
1573
|
|
|
1657
1574
|
return createStaticNodeList(childNodes);
|
|
1658
1575
|
} // nothing to do here since this does not have a synthetic shadow attached to it
|
|
@@ -1753,7 +1670,8 @@
|
|
|
1753
1670
|
textContent: {
|
|
1754
1671
|
get: function get() {
|
|
1755
1672
|
if (!runtimeFlags.ENABLE_NODE_PATCH) {
|
|
1756
|
-
|
|
1673
|
+
// See note on get innerHTML in faux-shadow/element.ts
|
|
1674
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
1757
1675
|
return textContentGetterPatched.call(this);
|
|
1758
1676
|
}
|
|
1759
1677
|
|
|
@@ -1947,7 +1865,22 @@
|
|
|
1947
1865
|
}
|
|
1948
1866
|
|
|
1949
1867
|
return rootNodes;
|
|
1950
|
-
}
|
|
1868
|
+
} // Keep searching up the host tree until we find an element that is within the immediate shadow root
|
|
1869
|
+
|
|
1870
|
+
|
|
1871
|
+
var findAncestorHostInImmediateShadowRoot = function findAncestorHostInImmediateShadowRoot(rootNode, targetRootNode) {
|
|
1872
|
+
var host;
|
|
1873
|
+
|
|
1874
|
+
while (!isUndefined(host = rootNode.host)) {
|
|
1875
|
+
var thisRootNode = host.getRootNode();
|
|
1876
|
+
|
|
1877
|
+
if (thisRootNode === targetRootNode) {
|
|
1878
|
+
return host;
|
|
1879
|
+
}
|
|
1880
|
+
|
|
1881
|
+
rootNode = thisRootNode;
|
|
1882
|
+
}
|
|
1883
|
+
};
|
|
1951
1884
|
|
|
1952
1885
|
function fauxElementsFromPoint(context, doc, left, top) {
|
|
1953
1886
|
var elements = elementsFromPoint.call(doc, left, top);
|
|
@@ -1961,8 +1894,28 @@
|
|
|
1961
1894
|
for (var i = 0; i < elements.length; i++) {
|
|
1962
1895
|
var element = elements[i];
|
|
1963
1896
|
|
|
1964
|
-
if (
|
|
1965
|
-
|
|
1897
|
+
if (isSyntheticSlotElement(element)) {
|
|
1898
|
+
continue;
|
|
1899
|
+
}
|
|
1900
|
+
|
|
1901
|
+
var elementRootNode = element.getRootNode();
|
|
1902
|
+
|
|
1903
|
+
if (ArrayIndexOf.call(rootNodes, elementRootNode) !== -1) {
|
|
1904
|
+
ArrayPush.call(result, element);
|
|
1905
|
+
continue;
|
|
1906
|
+
} // In cases where the host element is not visible but its shadow descendants are, then
|
|
1907
|
+
// we may get the shadow descendant instead of the host element here. (The
|
|
1908
|
+
// browser doesn't know the difference in synthetic shadow DOM.)
|
|
1909
|
+
// In native shadow DOM, however, elementsFromPoint would return the host but not
|
|
1910
|
+
// the child. So we need to detect if this shadow element's host is accessible from
|
|
1911
|
+
// the context's shadow root. Note we also need to be careful not to add the host
|
|
1912
|
+
// multiple times.
|
|
1913
|
+
|
|
1914
|
+
|
|
1915
|
+
var ancestorHost = findAncestorHostInImmediateShadowRoot(elementRootNode, rootNodes[0]);
|
|
1916
|
+
|
|
1917
|
+
if (!isUndefined(ancestorHost) && ArrayIndexOf.call(elements, ancestorHost) === -1 && ArrayIndexOf.call(result, ancestorHost) === -1) {
|
|
1918
|
+
ArrayPush.call(result, ancestorHost);
|
|
1966
1919
|
}
|
|
1967
1920
|
}
|
|
1968
1921
|
}
|
|
@@ -2042,6 +1995,29 @@
|
|
|
2042
1995
|
function isSyntheticShadowRoot(node) {
|
|
2043
1996
|
var shadowRootRecord = InternalSlot.get(node);
|
|
2044
1997
|
return !isUndefined(shadowRootRecord) && node === shadowRootRecord.shadowRoot;
|
|
1998
|
+
} // Return true if any descendant is a host element
|
|
1999
|
+
|
|
2000
|
+
|
|
2001
|
+
function containsHost(node) {
|
|
2002
|
+
// IE11 complains with "Unexpected call to method or property access." when calling walker.nextNode().
|
|
2003
|
+
// The fix for this is to only walk trees for nodes that are Node.ELEMENT_NODE.
|
|
2004
|
+
if (node.nodeType !== _Node.ELEMENT_NODE) {
|
|
2005
|
+
return false;
|
|
2006
|
+
} // IE requires all four arguments, even though the fourth is deprecated
|
|
2007
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker#browser_compatibility
|
|
2008
|
+
// @ts-ignore
|
|
2009
|
+
|
|
2010
|
+
|
|
2011
|
+
var walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, null, false);
|
|
2012
|
+
var descendant;
|
|
2013
|
+
|
|
2014
|
+
while (!isNull(descendant = walker.nextNode())) {
|
|
2015
|
+
if (isSyntheticShadowHost(descendant)) {
|
|
2016
|
+
return true;
|
|
2017
|
+
}
|
|
2018
|
+
}
|
|
2019
|
+
|
|
2020
|
+
return false;
|
|
2045
2021
|
}
|
|
2046
2022
|
|
|
2047
2023
|
var uid = 0;
|
|
@@ -2090,6 +2066,12 @@
|
|
|
2090
2066
|
value: function value() {
|
|
2091
2067
|
return "[object ShadowRoot]";
|
|
2092
2068
|
}
|
|
2069
|
+
},
|
|
2070
|
+
synthetic: {
|
|
2071
|
+
writable: false,
|
|
2072
|
+
enumerable: false,
|
|
2073
|
+
configurable: false,
|
|
2074
|
+
value: true
|
|
2093
2075
|
}
|
|
2094
2076
|
};
|
|
2095
2077
|
var ShadowRootDescriptors = {
|
|
@@ -3782,6 +3764,16 @@
|
|
|
3782
3764
|
*/
|
|
3783
3765
|
|
|
3784
3766
|
retargetRelatedTarget(MouseEvent);
|
|
3767
|
+
/*
|
|
3768
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
3769
|
+
* All rights reserved.
|
|
3770
|
+
* SPDX-License-Identifier: MIT
|
|
3771
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
3772
|
+
*/
|
|
3773
|
+
|
|
3774
|
+
var assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get : function () {
|
|
3775
|
+
return null;
|
|
3776
|
+
};
|
|
3785
3777
|
/*
|
|
3786
3778
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3787
3779
|
* All rights reserved.
|
|
@@ -3830,10 +3822,22 @@
|
|
|
3830
3822
|
}
|
|
3831
3823
|
|
|
3832
3824
|
function assignedSlotGetterPatched() {
|
|
3833
|
-
var parentNode = parentNodeGetter.call(this);
|
|
3825
|
+
var parentNode = parentNodeGetter.call(this); // use original assignedSlot if parent has a native shdow root
|
|
3826
|
+
|
|
3827
|
+
if (parentNode instanceof Element) {
|
|
3828
|
+
var sr = shadowRootGetter.call(parentNode);
|
|
3829
|
+
|
|
3830
|
+
if (isInstanceOfNativeShadowRoot(sr)) {
|
|
3831
|
+
if (this instanceof Text) {
|
|
3832
|
+
return assignedSlotGetter.call(this);
|
|
3833
|
+
}
|
|
3834
|
+
|
|
3835
|
+
return assignedSlotGetter$1.call(this);
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3834
3838
|
/**
|
|
3835
3839
|
* The node is assigned to a slot if:
|
|
3836
|
-
* - it has a parent and
|
|
3840
|
+
* - it has a parent and its parent is a slot element
|
|
3837
3841
|
* - and if the slot owner key is different than the node owner key.
|
|
3838
3842
|
*
|
|
3839
3843
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -3842,6 +3846,7 @@
|
|
|
3842
3846
|
* different than the node owner key (always `undefined`).
|
|
3843
3847
|
*/
|
|
3844
3848
|
|
|
3849
|
+
|
|
3845
3850
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
3846
3851
|
return parentNode;
|
|
3847
3852
|
}
|
|
@@ -4058,7 +4063,10 @@
|
|
|
4058
4063
|
innerHTML: {
|
|
4059
4064
|
get: function get() {
|
|
4060
4065
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4061
|
-
|
|
4066
|
+
// If this element is in synthetic shadow, if it's a synthetic shadow host,
|
|
4067
|
+
// or if any of its descendants are synthetic shadow hosts, then we can't
|
|
4068
|
+
// use the native innerHTML because it would expose private node internals.
|
|
4069
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4062
4070
|
return innerHTMLGetterPatched.call(this);
|
|
4063
4071
|
}
|
|
4064
4072
|
|
|
@@ -4081,7 +4089,8 @@
|
|
|
4081
4089
|
outerHTML: {
|
|
4082
4090
|
get: function get() {
|
|
4083
4091
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4084
|
-
|
|
4092
|
+
// See notes above on get innerHTML
|
|
4093
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4085
4094
|
return outerHTMLGetterPatched.call(this);
|
|
4086
4095
|
}
|
|
4087
4096
|
|
|
@@ -5435,6 +5444,6 @@
|
|
|
5435
5444
|
},
|
|
5436
5445
|
configurable: true
|
|
5437
5446
|
});
|
|
5438
|
-
/** version: 2.
|
|
5447
|
+
/** version: 2.6.3 */
|
|
5439
5448
|
|
|
5440
5449
|
})();
|