1 import { jQuery } from "../core.js";
2 import { documentElement } from "../var/documentElement.js";
4 var isAttached = function( elem ) {
5 return jQuery.contains( elem.ownerDocument, elem ) ||
6 elem.getRootNode( composed ) === elem.ownerDocument;
8 composed = { composed: true };
10 // Support: IE 9 - 11+
11 // Check attachment across shadow DOM boundaries when possible (gh-3504).
12 // Provide a fallback for browsers without Shadow DOM v1 support.
13 if ( !documentElement.getRootNode ) {
14 isAttached = function( elem ) {
15 return jQuery.contains( elem.ownerDocument, elem );
19 export { isAttached };