let textarea = document.getElementById("editor"); textarea.focus();
onSpellCheck(textarea, async () => {
let isc = SpecialPowers.wrap(textarea).editor.getInlineSpellChecker(true);
ok(isc, "Inline spell checker should exist after focus and spell check");
let spellchecker = isc.spellChecker;
// Setting the language to the language of the texteditor should not set the
// content preference.
await spellchecker.setCurrentDictionaries(["en-US"]);
let dictionaryContentPref = await getDictionaryContentPref();
is(dictionaryContentPref, "", "Content pref should be empty");
await spellchecker.setCurrentDictionaries(["en-US", "de-DE"]);
dictionaryContentPref = await getDictionaryContentPref();
is(dictionaryContentPref, "en-US,de-DE,", "Content pref should be en-US,de-DE,");
await spellchecker.setCurrentDictionaries(["de-DE"]);
dictionaryContentPref = await getDictionaryContentPref();
is(dictionaryContentPref, "de-DE,", "Content pref should be de-DE,");
// Remove the fake de_DE dictionary again.
await script.sendQuery("destroy");
// This will clear the content preferences and reset "spellchecker.dictionary".
await spellchecker.setCurrentDictionaries([]);
dictionaryContentPref = await getDictionaryContentPref();
is(dictionaryContentPref, "", "Content pref should be empty");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.