Spellcheck doesn't check message body any more when started in the subject
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
People
(Reporter: khushil324, Assigned: jorgk-bmo)
References
(Regression)
Details
(Keywords: regression)
Attachments
(2 files, 4 obsolete files)
This error is shown when editor part is not selected and you click on the Spelling button to check the spelling:
JavaScript error: chrome://messenger/content/messengercompose/EdSpellCheck.js, line 210: NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIEditorSpellCheck.GetNextMisspelledWord]
https://bugzilla.mozilla.org/show_bug.cgi?id=1580715#c13
Assignee | ||
Comment 1•4 years ago
|
||
What does "editor part is not selected" mean. Not clicked into the message body? Then the buttons shouldn't be available.
Reporter | ||
Comment 2•4 years ago
|
||
Yes, Not clicked into the message body.
Reporter | ||
Updated•4 years ago
|
Reporter | ||
Comment 3•4 years ago
|
||
Reporter | ||
Updated•4 years ago
|
Is the spell button still enabled if the focus is on the subject field or body is plain text?
Comment 5•4 years ago
|
||
Comment on attachment 9093529 [details] [diff] [review] Bug-1581774_spelling-button-disabled.patch Review of attachment 9093529 [details] [diff] [review]: ----------------------------------------------------------------- You can spell check in plain text mode too
Assignee | ||
Comment 6•4 years ago
|
||
I thought we're removing "observes" in bug 1581305, so why add more?
Comment 7•4 years ago
|
||
That bug only removes the <observes> element, not yet the attributes. We'll get to the attribute too, but it's easier to do one thing at ta time. The attributes are easier to convert since then you know what element you need to do what on, which is not the case with the element.
Reporter | ||
Comment 8•4 years ago
|
||
When selecting the subject field or body is plain text, GetCurrentDictionary is giving null and it is creating the problem: https://searchfox.org/comm-central/source/mail/components/compose/content/dialogs/EdSpellCheck.js#78
Does anyone have any idea how gSpellChecker is working? Do we need to change anything here: https://searchfox.org/comm-central/source/mail/components/compose/content/dialogs/EdSpellCheck.js#50
Assignee | ||
Comment 9•4 years ago
|
||
I know a whole lot about that spellchecking stuff.
In TB 68, when you click the button while in the subject, you get:
NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIEditorSpellCheck.GetNextMisspelledWord]
It works when you start in a plaintext body.
Did moving the files from editor to compose break spellcheck? Like it doesn't spellcheck the subject any more. I have a compile going, so I can't try it.
Reporter | ||
Comment 10•4 years ago
|
||
I checked when I was moving the editor stuff and it was showing the error there also.
When selecting the subject, gSpellChecker.GetCurrentDictionary() is giving null string and it is creating the problem.
Assignee | ||
Comment 11•4 years ago
|
||
You didn't answer the question. Does inline spellchecking in the subject still work? Then gSpellChecker.GetCurrentDictionary() shouldn't fail.
Reporter | ||
Comment 12•4 years ago
|
||
No, inline spellchecking in the subject is not working on the trunk. Showing the same error: NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIEditorSpellCheck.GetNextMisspelledWord]
Assignee | ||
Comment 13•4 years ago
|
||
Inline spellchecking in the subject is working. Type thiss iss aa misspellllling
and you'll see that everything is underlined.
Assignee | ||
Comment 14•4 years ago
|
||
(In reply to Jorg K (GMT+2) from comment #1)
What does "editor part is not selected" mean. Not clicked into the message body? Then the buttons shouldn't be available.
Haha, I was wrong. If you're in the subject, you still want to change the language for the inline spellcheck. That's why I wanted to split the button into "language choice" and "actual spellcheck". But that was knocked back by the conservative crowd back in bug 368915, 258 comments and totally frustrating. Just check attachment 8625069 [details] :-(
So since in the subject and elsewhere, there is no spellchecker initialised, this code in EdSpellCheck.js
try {
curLang = gSpellChecker.GetCurrentDictionary();
} catch (ex) {
curLang = "";
}
InitLanguageMenu(curLang);
So I'd just take the easy way out here: if (!curLang) return;
Or a try/catch around the gSpellChecker.GetNextMisspelledWord();
.
You need to experiment a bit. I think in bug 368915 there was some discussion about not launching the panel at all, but then the user click would just be ignored.
Looking at bug 1580715 comment #13: What happened to the "onClose is not defined" issue. I don't see that one in TB 68.
Reporter | ||
Comment 15•4 years ago
|
||
Assignee | ||
Comment 16•4 years ago
|
||
How about a comment? What about my suggestion from comment #14: if (!curLang) return;
?
Reporter | ||
Comment 17•4 years ago
•
|
||
(In reply to Jorg K (GMT+2) from comment #14)
Looking at bug 1580715 comment #13: What happened to the "onClose is not defined" issue. I don't see that one in TB 68.
This got fixed during the bug 1580715 for the trunk. We no longer need onClose function.
I have implemented try/catch around the gSpellChecker.GetNextMisspelledWord(); as we need this at two places. if (!curLang) return; will resolve the problem in spellCheckStarted function only.
This error will also pop when you click on recheck button. So it needs a try and catch there also.
I also liked the suggestion of two different buttons: "language choice" and "actual spellcheck". Waiting for Magnus's comment on it.
Comment 18•4 years ago
|
||
Comment on attachment 9094552 [details] [diff] [review] Bug-1581774_spelling-check-on-subject.patch Review of attachment 9094552 [details] [diff] [review]: ----------------------------------------------------------------- Let's avoid the try/catch when we can. I'll let Jörg handle the review since he dug around a lot in this area.
Assignee | ||
Comment 19•4 years ago
|
||
That's right, I've dug around this area an awful lot.
How about adding the if (!curLang) and remembering that we weren't really initialised in a global. Than use that instead of try/catch.
Reporter | ||
Comment 20•4 years ago
|
||
(In reply to Jorg K (GMT+2) from comment #19)
That's right, I've dug around this area an awful lot.
How about adding the if (!curLang) and remembering that we weren't really initialised in a global. Than use that instead of try/catch.
Sure.
Reporter | ||
Comment 21•4 years ago
|
||
I think we need to hide stop button when we don't have the current dictionary. What do you think?
Assignee | ||
Comment 22•4 years ago
|
||
Comment on attachment 9094564 [details] [diff] [review] Bug-1581774_spelling-button-disabled.patch > I think we need to hide stop button when we don't have the current dictionary. What do you think? I've never seen the "Stop" button, but yes, if you start the spelling on the body, it shows up briefly. I assume you can "stop" the spellcheck on larger e-mails? The patch works somewhat, but if you click "Check Word", "Replace", "Replace All" or "Add Word", you still get the error. At least your check needs to go into NextWord() where you had your try/catch before. I also noticed that clicking "Edit" shows "undefined" as word to add, that's not pretty. Maybe we can fix this while we're here.
Reporter | ||
Comment 23•4 years ago
|
||
(In reply to Jorg K (GMT+2) from comment #22)
I've never seen the "Stop" button, but yes, if you start the spelling on the
body, it shows up briefly. I assume you can "stop" the spellcheck on larger
e-mails?
I am asking about when we don't have the current dictionary and spelling check is not happening because of it. For that case, I guess there should only be cancel button.
Reporter | ||
Comment 24•4 years ago
|
||
Assignee | ||
Comment 25•4 years ago
|
||
Thanks, this looks promising. I'll try it in a few hours (I usually try to take the afternoon off).
Assignee | ||
Comment 26•4 years ago
|
||
OK, I've looked at this now in more detail. Try this without your patch:
Start a new message. Type a misspelled word. Try the spellcheck. Works, English (United States), complains about the error, etc.
Now, click the subject and then start the spellcheck. Dialog comes up, language is empty. That's the first issue. Now select English, then click "Recheck Text". Aha, the misspelled word is now shown, so it knows to spellcheck the body.
Now repeat in TB 60. And you won't believe it, when you start the spell check, the language isn't lost and the first bad word shows up. To TB 68/trunk is just broken :-( - Time to ask Alice to find the regression.
Alice, here are the STR:
Make sure you have at least one dictionary installed. The en-US Daily builds will have am English dictionary.
Start a new message, type a misspelled word into the body. Click onto the subject, then click onto the spelling button:
TB 60.9: Good: The spellcheck dialog comes up, English is selected, and the first misspelled word is shown.
TB 68.1: Bad: The spellcheck dialog comes up, the language selection is empty and the misspelled word isn't shown.
Assignee | ||
Comment 27•4 years ago
|
||
Comment on attachment 9094860 [details] [diff] [review] Bug-1581774_spelling-check-on-subject.patch Thanks for the effort, but we're on the wrong track here, not your fault, I gave plenty of wrong advice :-( - We just need to trigger a spellcheck of the body, like we always did, see previous comment. Alice will tell us when that broke, so it will be easier to fix.
![]() |
||
Comment 28•4 years ago
|
||
Regression window:
https://hg.mozilla.org/comm-central/pushloghtml?fromchange=f275666fb33ca22f5e470c3cad5028ec2d51f513&tochange=7cdd9ac6221e517b841c4cb786f05bad32576e0c
https://hg.mozilla.org/mozilla-central/pushloghtml?fromchange=01d0813d8203d78613fc33a3e8e32627c1300b50&tochange=df64b0b461fd66616049654d4a4b7d136ab770c8
Suspect: 5e2fad03c885961363aa136290e69df9009f4726 Edgar Chen — Bug 1507543 - Spellchecker for contenteditable/design-mode should not run without focus; r=m_kato
Assignee | ||
Comment 29•4 years ago
|
||
Thank you so much, Alice, for you invaluable support!
That gives us something to work with. Khushil, can you try to focus the body element before the spellcheck starts. I don't have time right now, but I can assist you some other day.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 30•4 years ago
|
||
Comment on attachment 9094860 [details] [diff] [review] Bug-1581774_spelling-check-on-subject.patch Sorry, I have to take over here.
Assignee | ||
Comment 31•4 years ago
|
||
We start the spellcheck from various parts of the UI, so we need to restore this line
rootContent = htmlEditor->GetActiveEditingHost();
Assignee | ||
Comment 33•4 years ago
|
||
Patch as in Phab with additional comment added. Carrying over r=m_kato.
Assignee | ||
Comment 34•4 years ago
|
||
Dear sheriff, please land the attached patch the "old fashioned" way. Reviewer is m_kato:
Bug 1581774 - revert part of rev 5e2fad03c885 from bug 1507543 for Thunderbirds since it breaks the spellcheck. r=m_kato
Note that the attached patch has an additional comment.
I can't land it myself using Lando due to bug 1576146.
Comment 35•4 years ago
|
||
Pushed by nerli@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/7b1c8131090e
revert part of rev 5e2fad03c885 from bug 1507543 for Thunderbirds since it breaks the spellcheck. r=m_kato
Assignee | ||
Comment 36•4 years ago
|
||
Makoto-san, can you please let me know which sort of test you had in mind and I'll file a follow-up bug. It could be a test in Thunderbird or maybe even a Gecko reftest where we set the bit on the editor, like here:
https://searchfox.org/mozilla-central/rev/f43ae7e1c43a4a940b658381157a6ea6c5a185c1/editor/libeditor/tests/test_bug1330796.html#89
Updated•4 years ago
|
Comment 37•4 years ago
|
||
bugherder |
Updated•4 years ago
|
Assignee | ||
Comment 38•4 years ago
|
||
Ryan, this only affects Thunderbird, so I'll deal with it on our branch.
Assignee | ||
Comment 39•4 years ago
|
||
https://hg.mozilla.org/releases/mozilla-esr68/rev/7570b77d77bff8413c3a85e2bcd178a79aa19280 on THUNDERBIRD_68_VERBRANCH
Assignee | ||
Comment 40•4 years ago
|
||
Liz, as I said in comment #38, this is only for TB. Just mark FF 70 and FF 68 as WONTFIX. We've got TB 68 covered, see comment #39.
Updated•4 years ago
|
Updated•2 years ago
|
Description
•