Closed Bug 1069787 Opened 9 years ago Closed 4 months ago

Don't check subject if spellchecker is not ready

Categories

(SeaMonkey :: MailNews: Composition, defect)

SeaMonkey 2.29 Branch
defect
Not set
normal

Tracking

(seamonkey2.53? affected)

RESOLVED FIXED
Tracking Status
seamonkey2.53 ? affected

People

(Reporter: philip.chee, Assigned: frg)

References

()

Details

(Whiteboard: SM2.53.15)

Attachments

(1 file, 1 obsolete file)

STR:
Compose a new message or reply to one.
Change spellcheck language
See error in Error Console

Fri Sep 19 2014 14:52:38
Error: NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIInlineSpellChecker.spellCheckRange]
Source file: chrome://messenger/content/messengercompose/MsgComposeCommands.js
Line: 1829

I can reproduce this when I do not select the subject first. Seems the spellchecker is not initialized then.

Reply->Spell->change dictionary->error
Reply->select subject->select message text->Spell->change dictionary->ok

Initially the subject seems to be never checked unless you select it at least once.

The code from TB Bug 1277658 with the null check works around it. Needs spellcheck=ture set for the subject filed so that the editor in the textfield has a spellchecker.

Assignee: nobody → frgrahl
Status: NEW → ASSIGNED

[Approval Request Comment]
Regression caused by (bug #): n.n.
User impact if declined: error in the log.
Testing completed (on m-c, etc.): 2.53.15b1 pre.
Risk to taking this patch (and alternatives if risky): Behaviour matches the TB in our tree.
String changes made by this patch: --

Initially the subject is still not checked until selected but same with or without the patch and matches TB behaviour build from our tree.

Attachment #9296128 - Flags: review?(iannbugzilla)
Attachment #9296128 - Flags: approval-comm-release?
Attachment #9296128 - Flags: approval-comm-esr60?
Comment on attachment 9296128 [details] [diff] [review]
1069787-spellchecker-subject-25315.patch

>+++ b/suite/mailnews/components/compose/content/MsgComposeCommands.js

>     // now check the document and the subject over again with the new dictionary
>-    if (InlineSpellCheckerUI.enabled)
>-    {
>+    if (InlineSpellCheckerUI.enabled) {
>       InlineSpellCheckerUI.mInlineSpellChecker.spellCheckRange(null);
>-      GetMsgSubjectElement().inputField.parentNode.spellCheckerUI.mInlineSpellChecker.spellCheckRange(null);
>+
>+      // Also force a recheck of the subject. The spell checker
>+      // for the subject isn't always resdy yet. Usually throws unless you
Nit: ready rather than resdy, also can the comment be formatted to 80 characters.
>+      // selected the subject at least once. So don't auto-create it, hence
>+      // pass 'false'.
>+      let inlineSpellChecker =
>+        GetMsgSubjectElement().editor.getInlineSpellChecker(false);
>+      if (inlineSpellChecker) {
>+        inlineSpellChecker.spellCheckRange(null);
>+      }

Also can the first line of the file be changed to something like:
/* -*- Mode: javascript; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */

r/a=me with those addressed / fixed.
Attachment #9296128 - Flags: review?(iannbugzilla)
Attachment #9296128 - Flags: review+
Attachment #9296128 - Flags: approval-comm-release?
Attachment #9296128 - Flags: approval-comm-release+
Attachment #9296128 - Flags: approval-comm-esr60?
Attachment #9296128 - Flags: approval-comm-esr60+

Review comments addressed. r/a+ from IanN retained. I will fix the header in a follow-up.

Attachment #9296128 - Attachment is obsolete: true
Attachment #9297717 - Flags: review+
Attachment #9297717 - Flags: approval-comm-release+
Attachment #9297717 - Flags: approval-comm-esr60+

Pushed by frgrahl@gmx.net:
https://hg.mozilla.org/comm-central/rev/5c73e160fd85
Don't check subject if spellchecker is not ready. r=IanN

Status: ASSIGNED → RESOLVED
Closed: 4 months ago
Resolution: --- → FIXED
Summary: NS_ERROR_NOT_INITIALIZED: Component returned failure code: 0xc1f30001 (NS_ERROR_NOT_INITIALIZED) [nsIInlineSpellChecker.spellCheckRange] → Don't check subject if spellchecker is not ready
Whiteboard: SM2.53.15
You need to log in before you can comment on or make changes to this bug.