Bug 216899 (for pkasting@google.com) r+a=mconnor middle-clicking functions ContentLoadURL and autoscroll conflict

This commit is contained in:
brettw%gmail.com 2006-06-02 19:52:30 +00:00
Родитель 31049c2e1a
Коммит 50f5a46050
1 изменённых файлов: 7 добавлений и 5 удалений

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

@ -4226,7 +4226,8 @@ nsContextMenu.prototype = {
this.menu = popup;
// Get contextual info.
this.setTarget( document.popupNode, document.popupEvent );
this.setTarget( document.popupNode, document.popupRangeParent,
document.popupRangeOffset );
this.isTextSelected = this.isTextSelection();
this.isContentSelected = this.isContentSelection();
@ -4425,7 +4426,7 @@ nsContextMenu.prototype = {
this.showItem( "context-metadata", this.onMetaDataItem );
},
// Set various context menu attributes based on the state of the world.
setTarget : function ( node, event ) {
setTarget : function ( node, rangeParent, rangeOffset ) {
const xulNS = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul";
if ( node.namespaceURI == xulNS ) {
this.shouldDisplay = false;
@ -4485,14 +4486,14 @@ nsContextMenu.prototype = {
// allow spellchecking UI on all writable text boxes except passwords
if (this.onTextInput && ! this.target.readOnly && this.target.type != "password") {
InlineSpellCheckerUI.init(this.target);
InlineSpellCheckerUI.initFromEvent(event);
InlineSpellCheckerUI.initFromEvent(rangeParent, rangeOffset);
}
this.onKeywordField = this.isTargetAKeywordField(this.target);
} else if ( this.target instanceof HTMLTextAreaElement ) {
this.onTextInput = true;
if (! this.target.readOnly) {
InlineSpellCheckerUI.init(this.target);
InlineSpellCheckerUI.initFromEvent(event);
InlineSpellCheckerUI.initFromEvent(rangeParent, rangeOffset);
}
} else if ( this.target instanceof HTMLHtmlElement ) {
// pages with multiple <body>s are lame. we'll teach them a lesson.
@ -5341,7 +5342,8 @@ function asyncOpenWebPanel(event)
}
if (event.button == 1 &&
!event.getPreventDefault() &&
gPrefService.getBoolPref("middlemouse.contentLoadURL")) {
gPrefService.getBoolPref("middlemouse.contentLoadURL") &&
!gPrefService.getBoolPref("general.autoScroll")) {
middleMousePaste(event);
}
return true;