Bug 1448200 - Handle the creation of the spellchecker more gracefully. r=Felipe
If the user right-clicks on an input field and that click causes us to create
a spellchecker, then it won't be initialized in time to show the context menu.
Handle that case more gracefully by passing that state up to the parent.
MozReview-Commit-ID: 1hjxloq2OLp
--- a/toolkit/modules/InlineSpellCheckerContent.jsm
+++ b/toolkit/modules/InlineSpellCheckerContent.jsm
@@ -44,16 +44,22 @@ var InlineSpellCheckerContent = {
}
if (!spellChecker.mInlineSpellChecker.enableRealTimeSpell) {
return { canSpellCheck: true,
initialSpellCheckPending: spellChecker.initialSpellCheckPending,
enableRealTimeSpell: false };
}
+ if (spellChecker.initialSpellCheckPending) {
+ return { canSpellCheck: true,
+ initialSpellCheckPending: true,
+ enableRealTimeSpell: true };
+ }
+
let dictionaryList = {};
let realSpellChecker = spellChecker.mInlineSpellChecker.spellChecker;
realSpellChecker.GetDictionaryList(dictionaryList, {});
// The original list we get is in random order. We need our list to be
// sorted by display names.
dictionaryList = spellChecker.sortDictionaryList(dictionaryList.value).map((obj) => {
return obj.id;