1 if(!dojo._hasResource["dijit._base.window"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2 dojo._hasResource["dijit._base.window"] = true;
3 dojo.provide("dijit._base.window");
5 dijit.getDocumentWindow = function(doc){
7 // Get window object associated with document doc
9 // With Safari, there is not way to retrieve the window from the document, so we must fix it.
10 if(dojo.isSafari && !doc._parentWindow){
12 This is a Safari specific function that fix the reference to the parent
13 window from the document object.
14 TODO: #5711: should the use of document below reference dojo.doc instead
15 in case they're not the same?
17 var fix=function(win){
18 win.document._parentWindow=win;
19 for(var i=0; i<win.frames.length; i++){
26 //In some IE versions (at least 6.0), document.parentWindow does not return a
27 //reference to the real window object (maybe a copy), so we must fix it as well
28 //We use IE specific execScript to attach the real window reference to
29 //document._parentWindow for later use
30 //TODO: #5711: should the use of document below reference dojo.doc instead in case they're not the same?
31 if(dojo.isIE && window !== document.parentWindow && !doc._parentWindow){
33 In IE 6, only the variable "window" can be used to connect events (others
36 doc.parentWindow.execScript("document._parentWindow = window;", "Javascript");
37 //to prevent memory leak, unset it after use
38 //another possibility is to add an onUnload handler which seems overkill to me (liucougar)
39 var win = doc._parentWindow;
40 doc._parentWindow = null;
44 return doc._parentWindow || doc.parentWindow || doc.defaultView; // Window