// ignore the recent blurNode eventif(dijit._clearActiveWidgetsTimer){
clearTimeout(dijit._clearActiveWidgetsTimer);
delete dijit._clearActiveWidgetsTimer;
}// compute stack of active widgets (ex: ComboButton --> Menu --> MenuItem)var newStack=[];
try{while(node){if(node.dijitPopupParent){
node=dijit.byId(node.dijitPopupParent).domNode;
}elseif(node.tagName&& node.tagName.toLowerCase()=="body"){// is this the root of the document or just the root of an iframe?if(node===dojo.body()){// node is the root of the main documentbreak;
}// otherwise, find the iframe this node refers to (can't access it via parentNode,// need to do this trick instead). window.frameElement is supported in IE/FF/Webkit
node=dijit.getDocumentWindow(node.ownerDocument).frameElement;
}else{var id = node.getAttribute&& node.getAttribute("widgetId");
if(id){
newStack.unshift(id);
}
node=node.parentNode;
}}}catch(e){/* squelch */}dijit._setStack(newStack);