rem: var htmlEditor = gEditor.QueryInterface(Components.interfaces.nsIHTMLEditor); if (!htmlEditor) return false; var anchorCell = htmlEditor.getElementOrParentByTagName("td", selection.anchorNode); var focusCell = htmlEditor.getElementOrParentByTagName("td", selection.focusNode); 
add: var anchorCell = gEditor.getElementOrParentByTagName("td", selection.anchorNode); var focusCell = gEditor.getElementOrParentByTagName("td", selection.focusNode); 
context: function IsSelectionInOneCell(){  var selection = gEditor.selection;  if (selection && selection.rangeCount == 1)  {    // We have a "normal" single-range selection    if (!selection.isCollapsed &&       selection.anchorNode != selection.focusNode)    {      // Check if both nodes are within the same cell      var htmlEditor = gEditor.QueryInterface(Components.interfaces.nsIHTMLEditor);      if (!htmlEditor)        return false;      var anchorCell = htmlEditor.getElementOrParentByTagName("td", selection.anchorNode);      var focusCell = htmlEditor.getElementOrParentByTagName("td", selection.focusNode);      return (focusCell != null && anchorCell != null && (focusCell == anchorCell));    }    // Collapsed selection or anchor == focus (thus must be in 1 cell)    return true;  }  return false;}
meta: 10234	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/10234/160100a09b4b930d5b308fda04a1e21843697414/editor.js/buggy/editor/ui/composer/content/editor.js