Skip to content

Commit d2344fe

Browse files
committed
use ownerDocument for proper indoc check (fix #2852)
1 parent 345e3ab commit d2344fe

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

src/util/dom.js

+3-15
Original file line numberDiff line numberDiff line change
@@ -36,24 +36,12 @@ export function query (el) {
3636
* @return {Boolean}
3737
*/
3838

39-
export function inDoc (node, win) {
40-
win = win || window
41-
var doc = win.document.documentElement
39+
export function inDoc (node) {
40+
var doc = node.ownerDocument.documentElement
4241
var parent = node && node.parentNode
43-
var isInDoc = doc === node ||
42+
return doc === node ||
4443
doc === parent ||
4544
!!(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
5745
}
5846

5947
/**

0 commit comments

Comments
 (0)