Bug 1578062 - Port Bug 1059219 "show text-related items (clipboard, undo, etc) in context menu for input type=number" to SeaMonkey. r=frg
authorIan Neal <iann_cvs@blueyonder.co.uk>
Sun, 15 Sep 2019 12:43:47 +0200
changeset 27589 19a72d901dcbaae7c8bc8dbdd0e6d6c5992928e8
parent 27588 dbe658106fe71de890c9f5b6735ee024b22e7baa
child 27590 407b577a46ffe6d93aab63e3b9d33a3dae95a564
push id16407
push userfrgrahl@gmx.net
push dateSun, 15 Sep 2019 10:44:46 +0000
treeherdercomm-central@20fdbeecb553 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfrg
bugs1578062, 1059219
Bug 1578062 - Port Bug 1059219 "show text-related items (clipboard, undo, etc) in context menu for input type=number" to SeaMonkey. r=frg
suite/base/content/nsContextMenu.js
--- a/suite/base/content/nsContextMenu.js
+++ b/suite/base/content/nsContextMenu.js
@@ -340,19 +340,19 @@ nsContextMenu.prototype = {
           Cu.reportError(e);
         }
 
     this.showItem("popupwindow-reject", this.popupPrincipal && !blocking);
     this.showItem("popupwindow-allow", this.popupPrincipal && blocking);
     this.showItem("context-sep-popup", this.popupPrincipal);
 
     // BiDi UI
-    this.showItem("context-sep-bidi", gShowBiDi);
+    this.showItem("context-sep-bidi", !this.onNumeric && top.gBidiUI);
     this.showItem("context-bidi-text-direction-toggle",
-                  this.onTextInput && gShowBiDi);
+                  this.onTextInput && !this.onNumeric && top.gBidiUI);
     this.showItem("context-bidi-page-direction-toggle",
                   !this.onTextInput && gShowBiDi);
   },
 
   initSpellingItems: function() {
     var canSpell = InlineSpellCheckerUI.canSpellCheck &&
                    !InlineSpellCheckerUI.initialSpellCheckPending &&
                    this.canSpellCheck;
@@ -550,16 +550,17 @@ nsContextMenu.prototype = {
     this.onLoadedImage         = false;
     this.onCompletedImage      = false;
     this.onStandaloneImage     = false;
     this.onCanvas              = false;
     this.onVideo               = false;
     this.onAudio               = false;
     this.onMetaDataItem        = false;
     this.onTextInput           = false;
+    this.onNumeric             = false;
     this.onKeywordField        = false;
     this.mediaURL              = "";
     this.onLink                = false;
     this.onMailtoLink          = false;
     this.onSaveableLink        = false;
     this.inDirList             = false;
     this.link                  = null;
     this.linkURL               = "";
@@ -629,16 +630,17 @@ nsContextMenu.prototype = {
         this.mediaURL = this.target.currentSrc || this.target.src;
       }
       else if (this.target instanceof HTMLAudioElement) {
         this.onAudio = true;
         this.mediaURL = this.target.currentSrc || this.target.src;
       }
       else if (editFlags & (SpellCheckHelper.INPUT | SpellCheckHelper.TEXTAREA)) {
         this.onTextInput = (editFlags & SpellCheckHelper.TEXTINPUT) !== 0;
+        this.onNumeric = (editFlags & SpellCheckHelper.NUMERIC) !== 0;
         this.onEditableArea = (editFlags & SpellCheckHelper.EDITABLE) !== 0;
         if (this.onEditableArea) {
           InlineSpellCheckerUI.init(this.target.editor);
           InlineSpellCheckerUI.initFromEvent(aRangeParent, aRangeOffset);
         }
         this.onKeywordField = (editFlags & SpellCheckHelper.KEYWORD);
       }
       else if ( this.target instanceof HTMLHtmlElement ) {