Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix dijit.hasDefaultTabStop() to detect that Editor on webkit is focu…

…sable. Editor on webkit has contentEditable on a <div> inside of <body> inside of the <iframe>. Fixes #12109.
  • Loading branch information...
commit a7e5ecd73f967fc7dda2f24a3a020f56288dfc71 1 parent f7ea158
@wkeese wkeese authored
Showing with 11 additions and 15 deletions.
  1. +11 −15 _base/manager.js
View
26 _base/manager.js
@@ -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';
}
Please sign in to comment.
Something went wrong with that request. Please try again.