Skip to content

Commit

Permalink
Fix dijit.hasDefaultTabStop() to detect that Editor on webkit is focu…
Browse files Browse the repository at this point in the history
…sable. Editor on webkit has contentEditable on a <div> inside of <body> inside of the <iframe>. Fixes #12109.
  • Loading branch information
wkeese committed Dec 27, 2010
1 parent f7ea158 commit a7e5ecd
Showing 1 changed file with 11 additions and 15 deletions.
26 changes: 11 additions & 15 deletions _base/manager.js
Expand Up @@ -348,29 +348,25 @@ dojo.declare("dijit.WidgetSet", null, {
return true;
case "iframe":
// If it's an editor <iframe> then it's tab navigable.
//TODO: feature detect "designMode" in elem.contentDocument?
if(dojo.isMoz){
try{
return elem.contentDocument.designMode == "on";
}catch(err){
return false;
var body;
try{
// non-IE
var contentDocument = elem.contentDocument;
if("designMode" in contentDocument && contentDocument.designMode == "on"){
return true;
}
}else if(dojo.isWebKit){
var doc = elem.contentDocument,
body = doc && doc.body;
return body && body.contentEditable == 'true';
}else{
body = contentDocument.body;
}catch(e1){
// contentWindow.document isn't accessible within IE7/8
// if the iframe.src points to a foreign url and this
// page contains an element, that could get focus
try{
doc = elem.contentWindow.document;
body = doc && doc.body;
return body && body.firstChild && body.firstChild.contentEditable == 'true';
}catch(e){
body = elem.contentWindow.document.body;
}catch(e2){
return false;
}
}
return body.contentEditable == 'true' || (body.firstChild && body.firstChild.contentEditable == 'true');
default:
return elem.contentEditable == 'true';
}
Expand Down

0 comments on commit a7e5ecd

Please sign in to comment.