Bug 1150572
Summary: | default spellchecker dictionary is not correct for firefox | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | Red Hat Enterprise Linux 7 | Reporter: | Stephen Beal <sbeal> | ||||||
Component: | firefox | Assignee: | Jan Horak <jhorak> | ||||||
Status: | CLOSED ERRATA | QA Contact: | Desktop QE <desktop-qa-list> | ||||||
Severity: | medium | Docs Contact: | |||||||
Priority: | medium | ||||||||
Version: | 7.1 | CC: | agajania, byount, ctubbsii, cww, desktop-qa-list, garrett.mitchener, jhorak, jlyle, jrstoup, jyundt, lnovich, mattdm, rrajaram, stransky, svashisht, tpelka, xwang, yshao | ||||||
Target Milestone: | rc | Keywords: | Reopened | ||||||
Target Release: | --- | ||||||||
Hardware: | All | ||||||||
OS: | Linux | ||||||||
Whiteboard: | |||||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||||
Doc Text: | Story Points: | --- | |||||||
Clone Of: | 643954 | Environment: | |||||||
Last Closed: | 2015-01-13 23:19:18 UTC | Type: | --- | ||||||
Regression: | --- | Mount Type: | --- | ||||||
Documentation: | --- | CRM: | |||||||
Verified Versions: | Category: | --- | |||||||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |||||||
Cloudforms Team: | --- | Target Upstream Version: | |||||||
Embargoed: | |||||||||
Bug Depends On: | 643954 | ||||||||
Bug Blocks: | 1133060 | ||||||||
Attachments: |
|
Comment 3
Jan Horak
2014-11-19 13:53:52 UTC
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://rhn.redhat.com/errata/RHSA-2015-0046.html Created attachment 979989 [details]
video displaying bug
Created attachment 980506 [details]
Latest screencase to show behavior
Hm, please try with the fresh profile (firefox -ProfileManager). Do you also see this on some public pages, like here http://www.html.am/html-codes/textboxes/html-textbox.cfm ? I'm still unable to reproduce customer's issue. Do the customer have some system wide preferences set? These preferences are in /usr/lib64/firefox/defaults or /usr/lib64/firefox/defaults/pref directories. Recorded video resembles behavior of previous Firefox version 31.3. Please could the customer double check that they have firefox 31.4.0-1 installed? Anyway customer can safely remove hunspell-en package by yum remove hunspell-en. Then en_US dictionary still stay installed. There are 2 issues here : 1. 'en_ZW' dictionary is used by default (when you have not explicity set spellchecker dictionary) 2. Default dictionary keeps getting set back to 'en_ZW' I am able to reproduce issue 1. Steps to reproduce : 1. Start with a fresh firefox profile 2. Visit 'http://google.co.in/'. Right click search box and enable spellchecker. 3. Righ click search box and select Languages. 'Engligsh (Zimbabwe)' is selected in the list by default. When spellchecker is enabled, nsEditorSpellCheck::UpdateCurrentDictionary() method is invoked from editor/composer/src/nsEditorSpellCheck.cpp : 696 NS_IMETHODIMP 697 nsEditorSpellCheck::UpdateCurrentDictionary(nsIEditorSpellCheckCallback* aCallback) 698 { 699 nsresult rv; 700 701 nsRefPtr<nsEditorSpellCheck> kungFuDeathGrip = this; 702 703 // Get language with html5 algorithm 704 nsCOMPtr<nsIContent> rootContent; 705 nsCOMPtr<nsIHTMLEditor> htmlEditor = do_QueryInterface(mEditor); 706 if (htmlEditor) { 707 rootContent = htmlEditor->GetActiveEditingHost(); 708 } else { 709 nsCOMPtr<nsIDOMElement> rootElement; 710 rv = mEditor->GetRootElement(getter_AddRefs(rootElement)); 711 NS_ENSURE_SUCCESS(rv, rv); 712 rootContent = do_QueryInterface(rootElement); 713 } 714 NS_ENSURE_TRUE(rootContent, NS_ERROR_FAILURE); 715 716 DictionaryFetcher* fetcher = new DictionaryFetcher(this, aCallback, 717 mDictionaryFetcherGroup); 718 rootContent->GetLang(fetcher->mRootContentLang); 719 nsCOMPtr<nsIDocument> doc = rootContent->GetCurrentDoc(); 720 NS_ENSURE_STATE(doc); 721 doc->GetContentLanguage(fetcher->mRootDocContentLang); 722 723 rv = fetcher->Fetch(mEditor); 724 NS_ENSURE_SUCCESS(rv, rv); 725 726 return NS_OK; 727 } Line 712 will fetch root element of the page and line 718 will set language specified in root item as the dictionary to be used. Google India home page specifies value of lang attribute to "en-IN" : <html itemscope="" itemtype="http://schema.org/SearchResultsPage" lang="en-IN"> but there is no 'en-IN' dictionary on my system, so the search will fallback to editor/composer/src/nsEditorSpellCheck.cpp:822 822 // Otherwise, try any available dictionary aa-XX 823 if (NS_FAILED(rv)) { 824 // loop over avaible dictionaries; if we find one with required 825 // language, use it 826 nsTArray<nsString> dictList; 827 rv = mSpellChecker->GetDictionaryList(&dictList); 828 NS_ENSURE_SUCCESS(rv, rv); 829 int32_t i, count = dictList.Length(); 830 for (i = 0; i < count; i++) { 831 nsAutoString dictStr(dictList.ElementAt(i)); 832 833 if (dictStr.Equals(dictName) || 834 dictStr.Equals(preferedDict) || 835 dictStr.Equals(langCode)) { 836 // We have already tried it 837 continue; 838 } 839 if (nsStyleUtil::DashMatchCompare(GetDictNameWithDash(dictStr), langCode, comparator) && 840 NS_SUCCEEDED(SetCurrentDictionary(dictStr))) { 841 break; 842 } 843 } 844 } 'en_ZW' is the first dictionary which matches condition specified in line 839 and is set as default dictionary. Thanks for the debugging and reproducer. In fact from Mozilla point of view the code is correct. In Mozilla products users install dictionaries by their own. Fallback to first dictionary in list that user actually installed is most likely correct for majority of Firefox/Thunderbird users. This is wrong for Fedora and RHEL however. The hunspell-en package contains various dialects, in fact all of them are symlink to en-GB. This is because we want working dictionaries for some other locales, not just for en_US and en_GB (some applications require language_region to be the same to locale settings to be able to find and use the dictionary). This bug was initially about fallback to French (if you had French dictionary installed) instead of some English dictionary on English pages because the fallback code didn't work correctly for our dictionaries (our dictionaries use underscore as separator, Mozilla use dash). I think issue with en_ZW is another bug so we should fill another one. I have RHEL 6 installed - there is no fallback to French - it is the default, no matter how many times I have tried to change it. I do not speak French and do not reside in a French speaking country so there is no reason why I would have enabled it. Also for whatever reason, Mozilla seems to think I am located in the Netherlands so content that is enabled to track location and to localize presents itself in Dutch. When will these fixes be applied to RHEL 6 CSB? thanks Laura Opened a new bug at https://bugzilla.redhat.com/show_bug.cgi?id=1189018 as requested in comment #24. |