rem: gSourceContentWindow.focus(); 
add: gSourceContentWindow.contentWindow.focus(); 
context: function SetDisplayMode(mode){  if (!IsHTMLEditor())    return false;  // Already in requested mode:  //  return false to indicate we didn't switch  if (mode == gEditorDisplayMode)    return false;  var previousMode = gEditorDisplayMode;  gEditorDisplayMode = mode;  ResetStructToolbar();  if (mode == kDisplayModeSource)  {    // Switch to the sourceWindow (second in the deck)    gContentWindowDeck.selectedIndex = 1;    //Hide the formatting toolbar if not already hidden    gFormatToolbarHidden = gFormatToolbar.hidden;    gFormatToolbar.hidden = true;    gViewFormatToolbar.hidden = true;    gSourceContentWindow.focus();  }  else  {    // Save the last non-source mode so we can cancel source editing easily    gPreviousNonSourceDisplayMode = mode;    // Load/unload appropriate override style sheet    try {      var editor = GetCurrentEditor();      editor.QueryInterface(nsIEditorStyleSheets);      editor instanceof Components.interfaces.nsIHTMLObjectResizer;      switch (mode)      {        case kDisplayModePreview:          // Disable all extra "edit mode" style sheets           editor.enableStyleSheet(kNormalStyleSheet, false);          editor.enableStyleSheet(kAllTagsStyleSheet, false);          editor.isImageResizingEnabled = true;          break;        case kDisplayModeNormal:          editor.addOverrideStyleSheet(kNormalStyleSheet);          // Disable ShowAllTags mode          editor.enableStyleSheet(kAllTagsStyleSheet, false);          editor.isImageResizingEnabled = true;          break;        case kDisplayModeAllTags:          editor.addOverrideStyleSheet(kNormalStyleSheet);          editor.addOverrideStyleSheet(kAllTagsStyleSheet);          // don't allow resizing in AllTags mode because the visible tags          // change the computed size of images and tables...          if (editor.resizedObject) {            editor.hideResizers();          }          editor.isImageResizingEnabled = false;          break;      }    } catch(e) {}    // Switch to the normal editor (first in the deck)    gContentWindowDeck.selectedIndex = 0;    // Restore menus and toolbars    gFormatToolbar.hidden = gFormatToolbarHidden;    gViewFormatToolbar.hidden = false;    gContentWindow.focus();  }  // update commands to disable or re-enable stuff  window.updateCommands("mode_switch");  // Set the selected tab at bottom of window:  // (Note: Setting "selectedIndex = mode" won't redraw tabs when menu is used.)  document.getElementById("EditModeTabs").selectedItem = document.getElementById(kDisplayModeTabIDS[mode]);  // Uncheck previous menuitem and set new check since toolbar may have been used  if (previousMode >= 0)    document.getElementById(kDisplayModeMenuIDs[previousMode]).setAttribute("checked","false");  document.getElementById(kDisplayModeMenuIDs[mode]).setAttribute("checked","true");    return true;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/da612cac58dcb7e9f3602cece16f98855cac775c/editor.js/buggy/editor/ui/composer/content/editor.js