lwc 2.6.2 → 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 +578 -384
- package/dist/engine-dom/iife/es2017/engine-dom.js +578 -384
- package/dist/engine-dom/iife/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es2017/engine-dom_debug.js +552 -360
- package/dist/engine-dom/iife/es5/engine-dom.js +630 -335
- package/dist/engine-dom/iife/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/iife/es5/engine-dom_debug.js +598 -311
- package/dist/engine-dom/umd/es2017/engine-dom.js +578 -384
- package/dist/engine-dom/umd/es2017/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es2017/engine-dom_debug.js +552 -360
- package/dist/engine-dom/umd/es5/engine-dom.js +630 -335
- package/dist/engine-dom/umd/es5/engine-dom.min.js +1 -9
- package/dist/engine-dom/umd/es5/engine-dom_debug.js +598 -311
- package/dist/engine-server/commonjs/es2017/engine-server.js +647 -454
- package/dist/engine-server/commonjs/es2017/engine-server.min.js +1 -9
- package/dist/engine-server/esm/es2017/engine-server.js +647 -454
- package/dist/synthetic-shadow/esm/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es2017/synthetic-shadow_debug.js +115 -13
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.js +119 -13
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/iife/es5/synthetic-shadow_debug.js +119 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.js +115 -13
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es2017/synthetic-shadow_debug.js +115 -13
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.js +119 -13
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow.min.js +2 -2
- package/dist/synthetic-shadow/umd/es5/synthetic-shadow_debug.js +119 -13
- 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 +3 -3
- package/dist/wire-service/iife/es5/wire-service.min.js +1 -1
- package/dist/wire-service/iife/es5/wire-service_debug.js +3 -3
- 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 +3 -3
- package/dist/wire-service/umd/es5/wire-service.min.js +1 -1
- package/dist/wire-service/umd/es5/wire-service_debug.js +3 -3
- package/package.json +8 -8
|
@@ -121,7 +121,7 @@
|
|
|
121
121
|
var KEY__SHADOW_TOKEN = '$shadowToken$';
|
|
122
122
|
var KEY__SHADOW_TOKEN_PRIVATE = '$$ShadowTokenKey$$';
|
|
123
123
|
var KEY__SYNTHETIC_MODE = '$$lwc-synthetic-mode';
|
|
124
|
-
/** version: 2.6.
|
|
124
|
+
/** version: 2.6.3 */
|
|
125
125
|
|
|
126
126
|
/*
|
|
127
127
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -220,6 +220,9 @@
|
|
|
220
220
|
var shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : function () {
|
|
221
221
|
return null;
|
|
222
222
|
};
|
|
223
|
+
var assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : function () {
|
|
224
|
+
return null;
|
|
225
|
+
};
|
|
223
226
|
/*
|
|
224
227
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
225
228
|
* All rights reserved.
|
|
@@ -812,6 +815,15 @@
|
|
|
812
815
|
function isNodeShadowed(node) {
|
|
813
816
|
return !isUndefined(getNodeOwnerKey(node));
|
|
814
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
|
+
}
|
|
815
827
|
/*
|
|
816
828
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
817
829
|
* All rights reserved.
|
|
@@ -1415,7 +1427,7 @@
|
|
|
1415
1427
|
}
|
|
1416
1428
|
|
|
1417
1429
|
var runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1418
|
-
/** version: 2.6.
|
|
1430
|
+
/** version: 2.6.3 */
|
|
1419
1431
|
|
|
1420
1432
|
/*
|
|
1421
1433
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1509,7 +1521,9 @@
|
|
|
1509
1521
|
}
|
|
1510
1522
|
|
|
1511
1523
|
function compareDocumentPositionPatched(otherNode) {
|
|
1512
|
-
if (this
|
|
1524
|
+
if (this === otherNode) {
|
|
1525
|
+
return 0;
|
|
1526
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1513
1527
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1514
1528
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1515
1529
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -1555,7 +1569,7 @@
|
|
|
1555
1569
|
function childNodesGetterPatched() {
|
|
1556
1570
|
if (isSyntheticShadowHost(this)) {
|
|
1557
1571
|
var owner = getNodeOwner(this);
|
|
1558
|
-
var childNodes = isNull(owner) ?
|
|
1572
|
+
var childNodes = isNull(owner) ? getFilteredChildNodes(this) : getAllMatches(owner, getFilteredChildNodes(this));
|
|
1559
1573
|
|
|
1560
1574
|
return createStaticNodeList(childNodes);
|
|
1561
1575
|
} // nothing to do here since this does not have a synthetic shadow attached to it
|
|
@@ -1656,7 +1670,8 @@
|
|
|
1656
1670
|
textContent: {
|
|
1657
1671
|
get: function get() {
|
|
1658
1672
|
if (!runtimeFlags.ENABLE_NODE_PATCH) {
|
|
1659
|
-
|
|
1673
|
+
// See note on get innerHTML in faux-shadow/element.ts
|
|
1674
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
1660
1675
|
return textContentGetterPatched.call(this);
|
|
1661
1676
|
}
|
|
1662
1677
|
|
|
@@ -1850,7 +1865,22 @@
|
|
|
1850
1865
|
}
|
|
1851
1866
|
|
|
1852
1867
|
return rootNodes;
|
|
1853
|
-
}
|
|
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
|
+
};
|
|
1854
1884
|
|
|
1855
1885
|
function fauxElementsFromPoint(context, doc, left, top) {
|
|
1856
1886
|
var elements = elementsFromPoint.call(doc, left, top);
|
|
@@ -1864,8 +1894,28 @@
|
|
|
1864
1894
|
for (var i = 0; i < elements.length; i++) {
|
|
1865
1895
|
var element = elements[i];
|
|
1866
1896
|
|
|
1867
|
-
if (
|
|
1868
|
-
|
|
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);
|
|
1869
1919
|
}
|
|
1870
1920
|
}
|
|
1871
1921
|
}
|
|
@@ -1945,6 +1995,29 @@
|
|
|
1945
1995
|
function isSyntheticShadowRoot(node) {
|
|
1946
1996
|
var shadowRootRecord = InternalSlot.get(node);
|
|
1947
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;
|
|
1948
2021
|
}
|
|
1949
2022
|
|
|
1950
2023
|
var uid = 0;
|
|
@@ -1993,6 +2066,12 @@
|
|
|
1993
2066
|
value: function value() {
|
|
1994
2067
|
return "[object ShadowRoot]";
|
|
1995
2068
|
}
|
|
2069
|
+
},
|
|
2070
|
+
synthetic: {
|
|
2071
|
+
writable: false,
|
|
2072
|
+
enumerable: false,
|
|
2073
|
+
configurable: false,
|
|
2074
|
+
value: true
|
|
1996
2075
|
}
|
|
1997
2076
|
};
|
|
1998
2077
|
var ShadowRootDescriptors = {
|
|
@@ -3685,6 +3764,16 @@
|
|
|
3685
3764
|
*/
|
|
3686
3765
|
|
|
3687
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
|
+
};
|
|
3688
3777
|
/*
|
|
3689
3778
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
3690
3779
|
* All rights reserved.
|
|
@@ -3733,10 +3822,22 @@
|
|
|
3733
3822
|
}
|
|
3734
3823
|
|
|
3735
3824
|
function assignedSlotGetterPatched() {
|
|
3736
|
-
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
|
+
}
|
|
3737
3838
|
/**
|
|
3738
3839
|
* The node is assigned to a slot if:
|
|
3739
|
-
* - it has a parent and
|
|
3840
|
+
* - it has a parent and its parent is a slot element
|
|
3740
3841
|
* - and if the slot owner key is different than the node owner key.
|
|
3741
3842
|
*
|
|
3742
3843
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -3745,6 +3846,7 @@
|
|
|
3745
3846
|
* different than the node owner key (always `undefined`).
|
|
3746
3847
|
*/
|
|
3747
3848
|
|
|
3849
|
+
|
|
3748
3850
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
3749
3851
|
return parentNode;
|
|
3750
3852
|
}
|
|
@@ -3961,7 +4063,10 @@
|
|
|
3961
4063
|
innerHTML: {
|
|
3962
4064
|
get: function get() {
|
|
3963
4065
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
3964
|
-
|
|
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)) {
|
|
3965
4070
|
return innerHTMLGetterPatched.call(this);
|
|
3966
4071
|
}
|
|
3967
4072
|
|
|
@@ -3984,7 +4089,8 @@
|
|
|
3984
4089
|
outerHTML: {
|
|
3985
4090
|
get: function get() {
|
|
3986
4091
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
3987
|
-
|
|
4092
|
+
// See notes above on get innerHTML
|
|
4093
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
3988
4094
|
return outerHTMLGetterPatched.call(this);
|
|
3989
4095
|
}
|
|
3990
4096
|
|
|
@@ -5338,6 +5444,6 @@
|
|
|
5338
5444
|
},
|
|
5339
5445
|
configurable: true
|
|
5340
5446
|
});
|
|
5341
|
-
/** version: 2.6.
|
|
5447
|
+
/** version: 2.6.3 */
|
|
5342
5448
|
|
|
5343
5449
|
})();
|
|
@@ -199,7 +199,7 @@
|
|
|
199
199
|
// we can't use typeof since it will fail when transpiling.
|
|
200
200
|
|
|
201
201
|
const hasNativeSymbolSupport = /*@__PURE__*/(() => Symbol('x').toString() === 'Symbol(x)')();
|
|
202
|
-
/** version: 2.6.
|
|
202
|
+
/** version: 2.6.3 */
|
|
203
203
|
|
|
204
204
|
/*
|
|
205
205
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -307,6 +307,7 @@
|
|
|
307
307
|
getElementsByClassName: getElementsByClassName$1
|
|
308
308
|
} = HTMLElement.prototype;
|
|
309
309
|
const shadowRootGetter = hasOwnProperty.call(Element.prototype, 'shadowRoot') ? getOwnPropertyDescriptor(Element.prototype, 'shadowRoot').get : () => null;
|
|
310
|
+
const assignedSlotGetter$1 = hasOwnProperty.call(Element.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Element.prototype, 'assignedSlot').get : () => null;
|
|
310
311
|
/*
|
|
311
312
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
312
313
|
* All rights reserved.
|
|
@@ -923,6 +924,15 @@
|
|
|
923
924
|
function isNodeShadowed(node) {
|
|
924
925
|
return !isUndefined(getNodeOwnerKey(node));
|
|
925
926
|
}
|
|
927
|
+
/**
|
|
928
|
+
* Returns true if this node is a shadow host, is in a shadow host, or contains a shadow host
|
|
929
|
+
* anywhere in its tree.
|
|
930
|
+
*/
|
|
931
|
+
|
|
932
|
+
|
|
933
|
+
function isNodeOrDescendantsShadowed(node) {
|
|
934
|
+
return isNodeShadowed(node) || isSyntheticShadowHost(node) || containsHost(node);
|
|
935
|
+
}
|
|
926
936
|
/*
|
|
927
937
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
928
938
|
* All rights reserved.
|
|
@@ -1566,7 +1576,7 @@
|
|
|
1566
1576
|
}
|
|
1567
1577
|
|
|
1568
1578
|
const runtimeFlags = _globalThis.lwcRuntimeFlags;
|
|
1569
|
-
/** version: 2.6.
|
|
1579
|
+
/** version: 2.6.3 */
|
|
1570
1580
|
|
|
1571
1581
|
/*
|
|
1572
1582
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
@@ -1660,7 +1670,9 @@
|
|
|
1660
1670
|
}
|
|
1661
1671
|
|
|
1662
1672
|
function compareDocumentPositionPatched(otherNode) {
|
|
1663
|
-
if (this
|
|
1673
|
+
if (this === otherNode) {
|
|
1674
|
+
return 0;
|
|
1675
|
+
} else if (this.getRootNode() === otherNode) {
|
|
1664
1676
|
// "this" is in a shadow tree where the shadow root is the "otherNode".
|
|
1665
1677
|
return 10; // Node.DOCUMENT_POSITION_CONTAINS | Node.DOCUMENT_POSITION_PRECEDING
|
|
1666
1678
|
} else if (getNodeOwnerKey(this) !== getNodeOwnerKey(otherNode)) {
|
|
@@ -1706,7 +1718,7 @@
|
|
|
1706
1718
|
function childNodesGetterPatched() {
|
|
1707
1719
|
if (isSyntheticShadowHost(this)) {
|
|
1708
1720
|
const owner = getNodeOwner(this);
|
|
1709
|
-
const childNodes = isNull(owner) ?
|
|
1721
|
+
const childNodes = isNull(owner) ? getFilteredChildNodes(this) : getAllMatches(owner, getFilteredChildNodes(this));
|
|
1710
1722
|
|
|
1711
1723
|
if (process.env.NODE_ENV !== 'production' && isFalse(hasNativeSymbolSupport) && isExternalChildNodeAccessorFlagOn()) {
|
|
1712
1724
|
// inserting a comment node as the first childNode to trick the IE11
|
|
@@ -1817,7 +1829,8 @@
|
|
|
1817
1829
|
textContent: {
|
|
1818
1830
|
get() {
|
|
1819
1831
|
if (!runtimeFlags.ENABLE_NODE_PATCH) {
|
|
1820
|
-
|
|
1832
|
+
// See note on get innerHTML in faux-shadow/element.ts
|
|
1833
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
1821
1834
|
return textContentGetterPatched.call(this);
|
|
1822
1835
|
}
|
|
1823
1836
|
|
|
@@ -2052,7 +2065,22 @@
|
|
|
2052
2065
|
}
|
|
2053
2066
|
|
|
2054
2067
|
return rootNodes;
|
|
2055
|
-
}
|
|
2068
|
+
} // Keep searching up the host tree until we find an element that is within the immediate shadow root
|
|
2069
|
+
|
|
2070
|
+
|
|
2071
|
+
const findAncestorHostInImmediateShadowRoot = (rootNode, targetRootNode) => {
|
|
2072
|
+
let host;
|
|
2073
|
+
|
|
2074
|
+
while (!isUndefined(host = rootNode.host)) {
|
|
2075
|
+
const thisRootNode = host.getRootNode();
|
|
2076
|
+
|
|
2077
|
+
if (thisRootNode === targetRootNode) {
|
|
2078
|
+
return host;
|
|
2079
|
+
}
|
|
2080
|
+
|
|
2081
|
+
rootNode = thisRootNode;
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2056
2084
|
|
|
2057
2085
|
function fauxElementsFromPoint(context, doc, left, top) {
|
|
2058
2086
|
const elements = elementsFromPoint.call(doc, left, top);
|
|
@@ -2066,8 +2094,28 @@
|
|
|
2066
2094
|
for (let i = 0; i < elements.length; i++) {
|
|
2067
2095
|
const element = elements[i];
|
|
2068
2096
|
|
|
2069
|
-
if (
|
|
2070
|
-
|
|
2097
|
+
if (isSyntheticSlotElement(element)) {
|
|
2098
|
+
continue;
|
|
2099
|
+
}
|
|
2100
|
+
|
|
2101
|
+
const elementRootNode = element.getRootNode();
|
|
2102
|
+
|
|
2103
|
+
if (ArrayIndexOf.call(rootNodes, elementRootNode) !== -1) {
|
|
2104
|
+
ArrayPush.call(result, element);
|
|
2105
|
+
continue;
|
|
2106
|
+
} // In cases where the host element is not visible but its shadow descendants are, then
|
|
2107
|
+
// we may get the shadow descendant instead of the host element here. (The
|
|
2108
|
+
// browser doesn't know the difference in synthetic shadow DOM.)
|
|
2109
|
+
// In native shadow DOM, however, elementsFromPoint would return the host but not
|
|
2110
|
+
// the child. So we need to detect if this shadow element's host is accessible from
|
|
2111
|
+
// the context's shadow root. Note we also need to be careful not to add the host
|
|
2112
|
+
// multiple times.
|
|
2113
|
+
|
|
2114
|
+
|
|
2115
|
+
const ancestorHost = findAncestorHostInImmediateShadowRoot(elementRootNode, rootNodes[0]);
|
|
2116
|
+
|
|
2117
|
+
if (!isUndefined(ancestorHost) && ArrayIndexOf.call(elements, ancestorHost) === -1 && ArrayIndexOf.call(result, ancestorHost) === -1) {
|
|
2118
|
+
ArrayPush.call(result, ancestorHost);
|
|
2071
2119
|
}
|
|
2072
2120
|
}
|
|
2073
2121
|
}
|
|
@@ -2150,6 +2198,29 @@
|
|
|
2150
2198
|
function isSyntheticShadowRoot(node) {
|
|
2151
2199
|
const shadowRootRecord = InternalSlot.get(node);
|
|
2152
2200
|
return !isUndefined(shadowRootRecord) && node === shadowRootRecord.shadowRoot;
|
|
2201
|
+
} // Return true if any descendant is a host element
|
|
2202
|
+
|
|
2203
|
+
|
|
2204
|
+
function containsHost(node) {
|
|
2205
|
+
// IE11 complains with "Unexpected call to method or property access." when calling walker.nextNode().
|
|
2206
|
+
// The fix for this is to only walk trees for nodes that are Node.ELEMENT_NODE.
|
|
2207
|
+
if (node.nodeType !== _Node.ELEMENT_NODE) {
|
|
2208
|
+
return false;
|
|
2209
|
+
} // IE requires all four arguments, even though the fourth is deprecated
|
|
2210
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Document/createTreeWalker#browser_compatibility
|
|
2211
|
+
// @ts-ignore
|
|
2212
|
+
|
|
2213
|
+
|
|
2214
|
+
const walker = document.createTreeWalker(node, NodeFilter.SHOW_ELEMENT, null, false);
|
|
2215
|
+
let descendant;
|
|
2216
|
+
|
|
2217
|
+
while (!isNull(descendant = walker.nextNode())) {
|
|
2218
|
+
if (isSyntheticShadowHost(descendant)) {
|
|
2219
|
+
return true;
|
|
2220
|
+
}
|
|
2221
|
+
}
|
|
2222
|
+
|
|
2223
|
+
return false;
|
|
2153
2224
|
}
|
|
2154
2225
|
|
|
2155
2226
|
let uid = 0;
|
|
@@ -2200,6 +2271,12 @@
|
|
|
2200
2271
|
return `[object ShadowRoot]`;
|
|
2201
2272
|
}
|
|
2202
2273
|
|
|
2274
|
+
},
|
|
2275
|
+
synthetic: {
|
|
2276
|
+
writable: false,
|
|
2277
|
+
enumerable: false,
|
|
2278
|
+
configurable: false,
|
|
2279
|
+
value: true
|
|
2203
2280
|
}
|
|
2204
2281
|
};
|
|
2205
2282
|
const ShadowRootDescriptors = {
|
|
@@ -4038,6 +4115,14 @@
|
|
|
4038
4115
|
*/
|
|
4039
4116
|
|
|
4040
4117
|
retargetRelatedTarget(MouseEvent);
|
|
4118
|
+
/*
|
|
4119
|
+
* Copyright (c) 2021, salesforce.com, inc.
|
|
4120
|
+
* All rights reserved.
|
|
4121
|
+
* SPDX-License-Identifier: MIT
|
|
4122
|
+
* For full license text, see the LICENSE file in the repo root or https://opensource.org/licenses/MIT
|
|
4123
|
+
*/
|
|
4124
|
+
|
|
4125
|
+
const assignedSlotGetter = hasOwnProperty.call(Text.prototype, 'assignedSlot') ? getOwnPropertyDescriptor(Text.prototype, 'assignedSlot').get : () => null;
|
|
4041
4126
|
/*
|
|
4042
4127
|
* Copyright (c) 2018, salesforce.com, inc.
|
|
4043
4128
|
* All rights reserved.
|
|
@@ -4091,10 +4176,22 @@
|
|
|
4091
4176
|
}
|
|
4092
4177
|
|
|
4093
4178
|
function assignedSlotGetterPatched() {
|
|
4094
|
-
const parentNode = parentNodeGetter.call(this);
|
|
4179
|
+
const parentNode = parentNodeGetter.call(this); // use original assignedSlot if parent has a native shdow root
|
|
4180
|
+
|
|
4181
|
+
if (parentNode instanceof Element) {
|
|
4182
|
+
const sr = shadowRootGetter.call(parentNode);
|
|
4183
|
+
|
|
4184
|
+
if (isInstanceOfNativeShadowRoot(sr)) {
|
|
4185
|
+
if (this instanceof Text) {
|
|
4186
|
+
return assignedSlotGetter.call(this);
|
|
4187
|
+
}
|
|
4188
|
+
|
|
4189
|
+
return assignedSlotGetter$1.call(this);
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4095
4192
|
/**
|
|
4096
4193
|
* The node is assigned to a slot if:
|
|
4097
|
-
* - it has a parent and
|
|
4194
|
+
* - it has a parent and its parent is a slot element
|
|
4098
4195
|
* - and if the slot owner key is different than the node owner key.
|
|
4099
4196
|
*
|
|
4100
4197
|
* When the slot and the slotted node are 2 different shadow trees, the owner keys will be
|
|
@@ -4103,6 +4200,7 @@
|
|
|
4103
4200
|
* different than the node owner key (always `undefined`).
|
|
4104
4201
|
*/
|
|
4105
4202
|
|
|
4203
|
+
|
|
4106
4204
|
if (!isNull(parentNode) && isSlotElement(parentNode) && getNodeOwnerKey(parentNode) !== getNodeOwnerKey(this)) {
|
|
4107
4205
|
return parentNode;
|
|
4108
4206
|
}
|
|
@@ -4319,7 +4417,10 @@
|
|
|
4319
4417
|
innerHTML: {
|
|
4320
4418
|
get() {
|
|
4321
4419
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4322
|
-
|
|
4420
|
+
// If this element is in synthetic shadow, if it's a synthetic shadow host,
|
|
4421
|
+
// or if any of its descendants are synthetic shadow hosts, then we can't
|
|
4422
|
+
// use the native innerHTML because it would expose private node internals.
|
|
4423
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4323
4424
|
return innerHTMLGetterPatched.call(this);
|
|
4324
4425
|
}
|
|
4325
4426
|
|
|
@@ -4344,7 +4445,8 @@
|
|
|
4344
4445
|
outerHTML: {
|
|
4345
4446
|
get() {
|
|
4346
4447
|
if (!runtimeFlags.ENABLE_ELEMENT_PATCH) {
|
|
4347
|
-
|
|
4448
|
+
// See notes above on get innerHTML
|
|
4449
|
+
if (isNodeOrDescendantsShadowed(this)) {
|
|
4348
4450
|
return outerHTMLGetterPatched.call(this);
|
|
4349
4451
|
}
|
|
4350
4452
|
|
|
@@ -5727,6 +5829,6 @@
|
|
|
5727
5829
|
|
|
5728
5830
|
configurable: true
|
|
5729
5831
|
});
|
|
5730
|
-
/** version: 2.6.
|
|
5832
|
+
/** version: 2.6.3 */
|
|
5731
5833
|
|
|
5732
5834
|
}));
|