Bug 1122906 - First right-click on textarea shows huge contextmenu. r=Neil a=IanN comm-beta comm-release CLOSED TREE SEAMONKEY_2_35_RELEASE_BRANCH
authorPhilip Chee <philip.chee@gmail.com>
Wed, 15 Apr 2015 13:46:14 +0800
branchSEAMONKEY_2_35_RELEASE_BRANCH
changeset 26091 ad744e46a2fc1ee7ababe5af26cb7de85ff3206e
parent 26090 23c3589a4c6c105ad50d4252aa8f01990019997d
child 26094 a8e2df40319ea00aaa6030765bb92166036f3475
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersNeil, IanN
bugs1122906
Bug 1122906 - First right-click on textarea shows huge contextmenu. r=Neil a=IanN comm-beta comm-release CLOSED TREE
suite/common/nsContextMenu.js
--- a/suite/common/nsContextMenu.js
+++ b/suite/common/nsContextMenu.js
@@ -270,17 +270,18 @@ nsContextMenu.prototype = {
     this.showItem("context-sep-bidi", gShowBiDi);
     this.showItem("context-bidi-text-direction-toggle",
                   this.onTextInput && gShowBiDi);
     this.showItem("context-bidi-page-direction-toggle",
                   !this.onTextInput && gShowBiDi);
   },
 
   initSpellingItems: function() {
-    var canSpell = InlineSpellCheckerUI.canSpellCheck;
+    var canSpell = InlineSpellCheckerUI.canSpellCheck &&
+                   !InlineSpellCheckerUI.initialSpellCheckPending;
     var onMisspelling = InlineSpellCheckerUI.overMisspelling;
     var showUndo = InlineSpellCheckerUI.enabled &&
                    InlineSpellCheckerUI.canUndo();
     this.showItem("spell-check-enabled", canSpell);
     this.showItem("spell-separator", canSpell || this.possibleSpellChecking);
     if (canSpell)
       this.setItemAttr("spell-check-enabled", "checked", InlineSpellCheckerUI.enabled);
     this.showItem("spell-add-to-dictionary", onMisspelling);
@@ -466,18 +467,18 @@ nsContextMenu.prototype = {
                            .chromeEventHandler;
       var editingSession = webNav.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
                                  .getInterface(Components.interfaces.nsIEditingSession);
       if (editingSession.windowIsEditable(win) &&
           this.isTargetEditable() && this.target.spellcheck) {
         this.onTextInput           = true;
         this.possibleSpellChecking = true;
         InlineSpellCheckerUI.init(editingSession.getEditorForWindow(win));
+        InlineSpellCheckerUI.initFromEvent(aRangeParent, aRangeOffset);
         var canSpell = InlineSpellCheckerUI.canSpellCheck;
-        InlineSpellCheckerUI.initFromEvent(aRangeParent, aRangeOffset);
         this.showItem("spell-check-enabled", canSpell);
         this.showItem("spell-separator", canSpell);
         return;
       }
     }
 
     // Check if we are in a synthetic document (stand alone image, video, etc.).
     this.inSyntheticDoc = this.target.ownerDocument.mozSyntheticDocument;