Backed out changeset 6b3dc1102513 (bug 908570)
authorSebastian Hengst <archaeopteryx@coole-files.de>
Thu, 20 Oct 2016 20:03:15 +0200
changeset 427692 69974770e8a63a412561f0490622c6717f749194
parent 427691 92d09cb049f594de283a06e111a2faaf74fbeb21
child 427693 a7281f6c576a8980975037278f51b11f5eaba15a
push id33099
push userdholbert@mozilla.com
push dateThu, 20 Oct 2016 20:25:54 +0000
bugs908570
milestone52.0a1
backs out6b3dc11025136983d14bff43dc3b483fc25832d9
Backed out changeset 6b3dc1102513 (bug 908570)
browser/base/content/nsContextMenu.js
browser/base/content/test/general/browser_contextmenu.js
--- a/browser/base/content/nsContextMenu.js
+++ b/browser/base/content/nsContextMenu.js
@@ -363,21 +363,20 @@ nsContextMenu.prototype = {
     this.showItem("context-sharevideo", shareEnabled && this.onVideo);
     this.setItemAttr("context-sharevideo", "disabled", !this.mediaURL || this.mediaURL.startsWith("blob:"));
   },
 
   initSpellingItems: function() {
     var canSpell = InlineSpellCheckerUI.canSpellCheck &&
                    !InlineSpellCheckerUI.initialSpellCheckPending &&
                    this.canSpellCheck;
-    let showDictionaries = canSpell && InlineSpellCheckerUI.enabled;
     var onMisspelling = InlineSpellCheckerUI.overMisspelling;
     var showUndo = canSpell && InlineSpellCheckerUI.canUndo();
     this.showItem("spell-check-enabled", canSpell);
-    this.showItem("spell-separator", canSpell);
+    this.showItem("spell-separator", canSpell || this.onEditableArea);
     document.getElementById("spell-check-enabled")
             .setAttribute("checked", canSpell && InlineSpellCheckerUI.enabled);
 
     this.showItem("spell-add-to-dictionary", onMisspelling);
     this.showItem("spell-undo-add-to-dictionary", showUndo);
 
     // suggestion list
     this.showItem("spell-suggestions-separator", onMisspelling || showUndo);
@@ -388,30 +387,29 @@ nsContextMenu.prototype = {
         InlineSpellCheckerUI.addSuggestionsToMenu(suggestionsSeparator.parentNode,
                                                   suggestionsSeparator, 5);
       this.showItem("spell-no-suggestions", numsug == 0);
     }
     else
       this.showItem("spell-no-suggestions", false);
 
     // dictionary list
-    this.showItem("spell-dictionaries", showDictionaries);
+    this.showItem("spell-dictionaries", canSpell && InlineSpellCheckerUI.enabled);
     if (canSpell) {
       var dictMenu = document.getElementById("spell-dictionaries-menu");
       var dictSep = document.getElementById("spell-language-separator");
       let count = InlineSpellCheckerUI.addDictionaryListToMenu(dictMenu, dictSep);
       this.showItem(dictSep, count > 0);
       this.showItem("spell-add-dictionaries-main", false);
     }
     else if (this.onEditableArea) {
       // when there is no spellchecker but we might be able to spellcheck
       // add the add to dictionaries item. This will ensure that people
       // with no dictionaries will be able to download them
-      this.showItem("spell-language-separator", showDictionaries);
-      this.showItem("spell-add-dictionaries-main", showDictionaries);
+      this.showItem("spell-add-dictionaries-main", true);
     }
     else
       this.showItem("spell-add-dictionaries-main", false);
   },
 
   initClipboardItems: function() {
     // Copy depends on whether there is selected text.
     // Enabling this context menu item is now done through the global
--- a/browser/base/content/test/general/browser_contextmenu.js
+++ b/browser/base/content/test/general/browser_contextmenu.js
@@ -844,16 +844,18 @@ add_task(function* test_input_spell_fals
     ["context-undo",        false,
      "---",                 null,
      "context-cut",         true,
      "context-copy",        true,
      "context-paste",       null, // ignore clipboard state
      "context-delete",      false,
      "---",                 null,
      "context-selectall",   true,
+     "---",                 null,
+     "spell-add-dictionaries-main",  true,
     ],
     {
       waitForSpellCheck: true
     }
   );
 });
 
 const remoteClientsFixture = [ { id: 1, name: "Foo"}, { id: 2, name: "Bar"} ];