* Sets document-related variables once based on the current document * @param {Element|Object} [node] An element or document object to use to set the document
( node )
| 1401 | * @param {Element|Object} [node] An element or document object to use to set the document |
| 1402 | */ |
| 1403 | function setDocument( node ) { |
| 1404 | var subWindow, |
| 1405 | doc = node ? node.ownerDocument || node : document$1; |
| 1406 | |
| 1407 | // Return early if doc is invalid or already selected |
| 1408 | // Support: IE 11+ |
| 1409 | // IE sometimes throws a "Permission denied" error when strict-comparing |
| 1410 | // two documents; shallow comparisons work. |
| 1411 | // eslint-disable-next-line eqeqeq |
| 1412 | if ( doc == document || doc.nodeType !== 9 ) { |
| 1413 | return; |
| 1414 | } |
| 1415 | |
| 1416 | // Update global variables |
| 1417 | document = doc; |
| 1418 | documentElement = document.documentElement; |
| 1419 | documentIsHTML = !jQuery.isXMLDoc( document ); |
| 1420 | |
| 1421 | // Support: IE 9 - 11+ |
| 1422 | // Accessing iframe documents after unload throws "permission denied" errors (see trac-13936) |
| 1423 | // Support: IE 11+ |
| 1424 | // IE sometimes throws a "Permission denied" error when strict-comparing |
| 1425 | // two documents; shallow comparisons work. |
| 1426 | // eslint-disable-next-line eqeqeq |
| 1427 | if ( isIE && document$1 != document && |
| 1428 | ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { |
| 1429 | subWindow.addEventListener( "unload", unloadHandler ); |
| 1430 | } |
| 1431 | } |
| 1432 | |
| 1433 | find.matches = function( expr, elements ) { |
| 1434 | return find( expr, null, null, elements ); |
no outgoing calls
no test coverage detected