Manipulation: Support $el.html(selfRemovingScript) (#5378)
[jquery.git] / src / core / isAttached.js
blob12a60ee92f52de1ddb2a13acdb12356cbec6c9e8
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;
7         },
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 );
16         };
19 export { isAttached };