Closed Bug 202561 Opened 21 years ago Closed 21 years ago

seeing the HTML Mail Question dialog when I wasn't before

Categories

(MailNews Core :: Composition, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: sspitzer, Assigned: shliang)

Details

(Keywords: regression)

Attachments

(1 file, 2 obsolete files)

seeing the HTML Mail Question dialog when I wasn't before.

cause by bug #107877

by default, even for a simple html message, we can't auto-convert to plain text
(like we used to).  So the user will see the "HTML Mail Question" dialog, where
we ask them to send in text, text & html, or just html.

by simple html message, I mean compose an html message, but do no html.

here's what we are generating:

<body text="#000000" bgcolor="#ffffff">
<font face="">test</font><br>
</body>

before, we wouldn't have the colors or the font.

note, you can't just fix loadHTMLMsgPrefs() to avoid setting the font and colors
when they are the defaults, without fixing editor*.js, because in editor*.js, we
will set the default colors to be the browser appearance defaults.

so you have to fix both of these issues at once.
Well the <font face=""> is wrong anyway, it seems to be caused by
    EditorRemoveTextProperty("font","face");
    EditorSetTextProperty("font", "face", fontFace);
Removing those lines appears to resolve that particular issue...

Could you make the plain text detector ignore text/bgcolor?
nominating for nsbeta1, as getting that dialog is never a fun experience.
Keywords: nsbeta1
if you can fix the font stuff, per neil, here's a suggestion on how to fix the
bgcolor / text color issue.

in nsMsgCompose::TagConvertible()

        if
(NS_SUCCEEDED(domElement->HasAttribute(NS_LITERAL_STRING("background"),
&hasAttribute))
            && hasAttribute)  // There is a background image
          *_retval = nsIMsgCompConvertible::No; 
        else if
(NS_SUCCEEDED(domElement->HasAttribute(NS_LITERAL_STRING("text"), &hasAttribute))
            && hasAttribute)  // There is a text color
          *_retval = nsIMsgCompConvertible::Altering;
        else if
(NS_SUCCEEDED(domElement->HasAttribute(NS_LITERAL_STRING("bgcolor"), &hasAttribute))
            && hasAttribute)  // There is a background color
          *_retval = nsIMsgCompConvertible::Altering;

check that bgcolor != white before setting *_retval to
nsIMsgCompConvertible::Altering

and check that text != black before setting *_retval to
nsIMsgCompConvertible::Altering

that should help avoid the dreaded html mail question dialog, at least as much
as we used to.

I'm sure we have bugs about improving the dialog, making it remember decisions,
or adding a checkbox for "add these domains".  but they are futured.
Attached patch patch (obsolete) — Splinter Review
Attachment #121301 - Flags: superreview?(sspitzer)
Attachment #121301 - Flags: superreview?(sspitzer)
Attached patch patch (obsolete) — Splinter Review
Attachment #121301 - Attachment is obsolete: true
Attachment #121327 - Flags: superreview?(sspitzer)
Comment on attachment 121327 [details] [diff] [review]
patch

should be !bgColor.Equals
Attachment #121327 - Flags: superreview?(sspitzer) → superreview-
Attached patch patchSplinter Review
Attachment #121327 - Attachment is obsolete: true
Comment on attachment 121346 [details] [diff] [review]
patch

r/sr=sspitzer
Attachment #121346 - Flags: superreview+
fixing case where compose msg prefs are default values i.e. black text, white 
background, normal font face, etc

note: one special case, if you have a diff font color selected and then change 
it to black as you are composing a msg, this will not prevent the dialog from 
coming up as default text colors are set in the body tag and manually changing 
it sets colors in font tags
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Using trunk build 20030428 on winxp, macosx and linux this is fixed. 
Verified
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: