diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 9ab0d3f1230..3dcada75f9e 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -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 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;