Bug 908570 - Don't show the 'Add Dictionaries…' menu item for contenteditable elements with spellcheck=false; r=dao

This commit is contained in:
Ehsan Akhgari 2016-10-19 20:43:44 -04:00
Родитель f8d5175299
Коммит 5ab561d95b
2 изменённых файлов: 5 добавлений и 5 удалений

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

@ -368,10 +368,11 @@ nsContextMenu.prototype = {
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.onEditableArea);
this.showItem("spell-separator", canSpell);
document.getElementById("spell-check-enabled")
.setAttribute("checked", canSpell && InlineSpellCheckerUI.enabled);
@ -392,7 +393,7 @@ nsContextMenu.prototype = {
this.showItem("spell-no-suggestions", false);
// dictionary list
this.showItem("spell-dictionaries", canSpell && InlineSpellCheckerUI.enabled);
this.showItem("spell-dictionaries", showDictionaries);
if (canSpell) {
var dictMenu = document.getElementById("spell-dictionaries-menu");
var dictSep = document.getElementById("spell-language-separator");
@ -404,7 +405,8 @@ nsContextMenu.prototype = {
// 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-add-dictionaries-main", true);
this.showItem("spell-language-separator", showDictionaries);
this.showItem("spell-add-dictionaries-main", showDictionaries);
}
else
this.showItem("spell-add-dictionaries-main", false);

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

@ -876,8 +876,6 @@ add_task(function* test_input_spell_false() {
"context-delete", false,
"---", null,
"context-selectall", true,
"---", null,
"spell-add-dictionaries-main", true,
]
);
});