Bug 117805 - context menus don't work in XML documents

Patch by caillon@returnzero.com, r=heikki, sr=jag
This commit is contained in:
bbaetz%student.usyd.edu.au 2006-07-29 05:39:14 +00:00
Родитель c93dd0a2f0
Коммит 7fadd4238e
1 изменённых файлов: 9 добавлений и 1 удалений

Просмотреть файл

@ -633,7 +633,15 @@ nsContextMenu.prototype = {
},
searchSelected : function() {
var searchStr = this.target.ownerDocument.getSelection();
var searchStr;
// workaround for bug 117805 to enable context menus in XML documents
// until bug 116523 is fixed.
if ("getSelection" in this.target.ownerDocument)
searchStr = this.target.ownerDocument.getSelection();
else
searchStr = _content.getSelection();
searchStr = searchStr.toString();
searchStr = searchStr.replace( /^\s+/, "" );
searchStr = searchStr.replace(/(\n|\r|\t)+/g, " ");