We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 345e3ab commit d2344feCopy full SHA for d2344fe
src/util/dom.js
@@ -36,24 +36,12 @@ export function query (el) {
36
* @return {Boolean}
37
*/
38
39
-export function inDoc (node, win) {
40
- win = win || window
41
- var doc = win.document.documentElement
+export function inDoc (node) {
+ var doc = node.ownerDocument.documentElement
42
var parent = node && node.parentNode
43
- var isInDoc = doc === node ||
+ return doc === node ||
44
doc === parent ||
45
!!(parent && parent.nodeType === 1 && (doc.contains(parent)))
46
- if (!isInDoc) {
47
- var frames = win.frames
48
- if (frames) {
49
- for (var i = 0; i < frames.length; i++) {
50
- if (inDoc(node, frames[i])) {
51
- return true
52
- }
53
54
55
56
- return isInDoc
57
}
58
59
/**
0 commit comments