Bug 1176671 - Change lang attribute when dictionary is changed; r=neil, a=rkent
authorJorg K <mozilla@jorgk.com>
Tue, 30 Jun 2015 10:52:33 -0700
changeset 26174 f9a9f3cfcdaa66193066fc2d218ea8774255f883
parent 26173 5c3c2307548bd5ad19e167bb39076def12e84b1d
child 26175 8245f250a03fe9ff81bbd5a2ba01c56be42b3050
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, rkent
bugs1176671
Bug 1176671 - Change lang attribute when dictionary is changed; r=neil, a=rkent
editor/ui/dialogs/content/EdSpellCheck.js
--- a/editor/ui/dialogs/content/EdSpellCheck.js
+++ b/editor/ui/dialogs/content/EdSpellCheck.js
@@ -415,16 +415,21 @@ function EditDictionary()
   window.openDialog("chrome://editor/content/EdDictionary.xul", "_blank", "chrome,close,titlebar,modal", "", gMisspelledWord);
 }
 
 function SelectLanguage()
 {
   var item = gDialog.LanguageMenulist.selectedItem;
   if (item.value != "more-cmd") {
     gSpellChecker.SetCurrentDictionary(item.value);
+    // For compose windows we need to set the "lang" attribute so the
+    // core editor uses the correct dictionary for the inline spell check.
+    if (window.arguments[1]) {
+      window.opener.document.documentElement.setAttribute("lang", item.value);
+    }
     gLastSelectedLang = item;
   }
   else {
     openDictionaryList();
 
     if (gLastSelectedLang)
       gDialog.LanguageMenulist.selectedItem = gLastSelectedLang;
   }