rem: Components.interfaces.nsISelectionController.SELECTION_ANCHOR_REGION); 
add: Components.interfaces.nsISelectionController.SELECTION_ANCHOR_REGION, true); 
context: function drawSelection(){  // find the special selection markers that we added earlier, and  // draw the selection between the two...  var findService = null;  try {    // get the find service which stores the global find state    findService = Components.classes["@mozilla.org/find/find_service;1"]                            .getService(Components.interfaces.nsIFindService);  } catch(e) { }  if (!findService)    return;  // cache the current global find state  var matchCase     = findService.matchCase;  var entireWord    = findService.entireWord;  var wrapFind      = findService.wrapFind;  var findBackwards = findService.findBackwards;  var searchString  = findService.searchString;  var replaceString = findService.replaceString;  // setup our find instance  var findInst = getBrowser().webBrowserFind;  findInst.matchCase = true;  findInst.entireWord = false;  findInst.wrapFind = false;  findInst.findBackwards = false;  // ...lookup the start mark  findInst.searchString = MARK_SELECTION_START;  var startLength = MARK_SELECTION_START.length;  findInst.findNext();  var contentWindow = getBrowser().contentDocument.defaultView;  var selection = contentWindow.getSelection();  var range = selection.getRangeAt(0);  var startContainer = range.startContainer;  var startOffset = range.startOffset;  // ...lookup the end mark  findInst.searchString = MARK_SELECTION_END;  var endLength = MARK_SELECTION_END.length;  findInst.findNext();  var endContainer = selection.anchorNode;  var endOffset = selection.anchorOffset;  // reset the selection that find has left  selection.removeAllRanges();  // delete the special markers now...  endContainer.deleteData(endOffset, endLength);  startContainer.deleteData(startOffset, startLength);  if (startContainer == endContainer)    endOffset -= startLength; // has shrunk if on same text node...  range.setEnd(endContainer, endOffset);  // show the selection and scroll it into view  selection.addRange(range);  // the default behavior of the selection is to scroll at the end of  // the selection, whereas in this situation, it is more user-friendly  // to scroll at the beginning. So we override the default behavior here  try {    getBrowser().docShell                .QueryInterface(Components.interfaces.nsIInterfaceRequestor)                .getInterface(Components.interfaces.nsISelectionDisplay)                .QueryInterface(Components.interfaces.nsISelectionController)                .scrollSelectionIntoView(Components.interfaces.nsISelectionController.SELECTION_NORMAL,                                         Components.interfaces.nsISelectionController.SELECTION_ANCHOR_REGION);  }  catch(e) { }  // restore the current find state  findService.matchCase     = matchCase;  findService.entireWord    = entireWord;  findService.wrapFind      = wrapFind;  findService.findBackwards = findBackwards;  findService.searchString  = searchString;  findService.replaceString = replaceString;  findInst.matchCase     = matchCase;  findInst.entireWord    = entireWord;  findInst.wrapFind      = wrapFind;  findInst.findBackwards = findBackwards;  findInst.searchString  = searchString;}
meta: 8395	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/8395/ba4c34dbc058e6f135a061261c1abcb5dd5f7ffd/viewPartialSource.js/buggy/suite/browser/viewPartialSource.js