Closed Bug 234354 Opened 20 years ago Closed 18 years ago

Background and text colors lost when using a template

Categories

(MailNews Core :: Composition, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: hadmut, Assigned: mcsmurf)

References

Details

(Keywords: regression)

User-Agent:       
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6) Gecko/20040122 Debian/1.6-1

When writing a mail from a template, the template's background
color get's lost.

Reproducible: Always
Steps to Reproduce:
1. Compose a HTML e-mail and set any other background color than white
2. Save as template
3. Open new message by doubleclicking on the template 
   -> template is used but bg color is white



Expected Results:  
Should have used the same background color as selected in the 
template
WFM on Thunderbird (20040214)/W32
Confirming bug, trunk CVS, Linux.
Earlyer instances of same: bug 40546, bug 220708 (Windows)

Weird: I can not see any backgound color on the page of the template i save, but
the source contains the correct color, for instance bgcolor="#3333ff"

When i edit the template as new and send a mail based on it, the source of the
mail in the Sent folder has another color: bgcolog="#ffffff"
Status: UNCONFIRMED → NEW
Ever confirmed: true
Keywords: regression
(In reply to comment #2)
> bgcolog="#ffffff"

Misspelling actually happen?  Or is that just a typo?

I checked lxr, and can't find the string bgcolog
Re. comment 3: yes, typo
See also bug 147645 -- anything stored in the <body>'s inline 'style' attribute 
is also overridden by the current HTML Compose Mail style -- altho, when you set 
the Inline Style for a message, that tweaks the current HTML Compose Mail style 
from what was set in the Composition preferences.
It isn't just the bgcolor; the text color is also overridden.

I have a template set up so:
  <body text="#33ff33" bgcolor="#666666" link="#ffcc66" vlink="#ffffcc"
   alink="#00cccc">

When I compose a message based on this template, the text and background colors 
change; the message as sent contains:
  <body alink="#00cccc" vlink="#ffffcc" link="#ffcc66" bgcolor="#ccffff"
   text="#440000">

The new settings for 'bgcolor' and 'text' are the same ones that are specified 
in Preferences|Mail|Composition|Defaults for HTML.


R.K.Aa:
> Weird: I can not see any backgound color on the page of the template i save,
> but the source contains the correct color, for instance bgcolor="#3333ff"

Are you viewing "as Simple"?  That will override any colors or styling.

Also: you marked this bug as a regression.  Do you know what version might have 
behaved properly in the past?  Note that the fix for bug 220708, as it turns 
out, did not address this particular problem, but a side problem that happened 
to be reported elsewhere within that bug.


Updating platform to All/All (I don't see any reason to expect this problem 
doesn't occur everywhere), and updating summary.
OS: Linux → All
Hardware: PC → All
Summary: Background color lost when using a template → Background and text colors lost when using a template
Hi,

btw, is there any way to set attributes leftmargin, topmargin, marginwidth, 
marginheight in the body tag?

regards
Hadmut
I am running 1.7RC2 on OS 10.3.4. I am confirming and providing addtional
details to the bug.

First, when I double click my template, the template does not open as an
editable message. It opens in a new viewing window like an ordinary message in
the inbox would be. I have to right-click and choose "edit as new" from the
context menu in order to get a new message composition window based on the template.

Second, when a message composition windows is opened, the background color AND
the text coloring scheme (i.e., text color, link color, visited link color,
etc.) for the html template are lost. 

So, there is lots of html formatting that is not passed on from the template to
the new message composition window.

Payam

(In reply to comment #0)
> User-Agent:       
> Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.6)
Gecko/20040122 Debian/1.6-1
> 
> When writing a mail from a template, the template's background
> color get's lost.
> 
> Reproducible: Always
> Steps to Reproduce:
> 1. Compose a HTML e-mail and set any other background color than white
> 2. Save as template
> 3. Open new message by doubleclicking on the template 
>    -> template is used but bg color is white
> 
> 
> 
> Expected Results:  
> Should have used the same background color as selected in the 
> template

> Background and text colors lost when using a template

I confirm the same behaviour for "sent as new".

1. create and send HTML mail with background colour.
2. "sent as new"
3. Background color is lost (set to default).

The mail editor always uses the "defaults for HTML messages" from the general
preferences / Mail/News / composition i.e. <body bgcolor="#ffffff"
text="#000000">. It can be reproduced by changing the default background colour.

The same can be confirmed for the text colour.

Just confirmed it again with:
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8a2) Gecko/20040606

It is no regression. I can not remember it to work right since at least 1.6.
Is it an "editor core" bug?

I recommend to change the summary:
old: Background and text colors lost when using a template
new: Background + text colors are lost (set to default) when using a template or
"sent as new"
Again confirmed comment 9 in 1.7rc3
For QA 1.7 flagged it "1.7?"
Flags: blocking1.7?
without a tested patch in hand, it's too late for 1.7.
Flags: blocking1.7? → blocking1.7-
I bet this is happening because of the code to allow a user to set a default
background color / font color in prefs. When we load the compose window for a
draft or template, I see the intended background color briefly on the screen
then the editor reloads as we set default attributes for body color & font. 
(In reply to comment #12)
> then the editor reloads as we set default attributes for body color & font. 
confirmed. I forgot to mention that in comment 9.
Product: MailNews → Core
*** Bug 275210 has been marked as a duplicate of this bug. ***
This bug is filed under Core, but I'm not seeing the behavior in TB 1.0.7, nor in TB 1.5b2 or TB 1.6a1.  Both Drafts and Templates have the background color preserved when opened.
*** Bug 313852 has been marked as a duplicate of this bug. ***
So it's a composition initialization problem, with color settings and maybe others over-ridden by defaults instead of defaults being over-ridden by settings from the template or draft.

In #313852 (current Seamonkey 1.1 and 1.0), the font and size settings were preserved, but background color was not, and text color wasn't preserved in 1.1 as I recall. Discussion there about changes shown in the format bar resulting from cursor keystrokes at the "home" of a composition window were intended to highlight the problem of initializing the composition window.


On testing with Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060103 SeaMonkey/1.5a, background color was lost. Text color, size and font selections were ok.
Loss of background color happens in Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060104 SeaMonkey/1.5a, in loading a template or draft, or doing a reply or a forward.
Background color isn't preserved in this Mozilla 1.7 nightly and it's release candidate time.
Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.7.13) Gecko/20060321
I should add that on loading a saved test msg from Drafts, the original background color appeared momentarily and was replaced by the default color. The order in which those colors are applied needs to be reversed. First apply the default and then apply document color.
On checking Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060321 SeaMonkey/1.5a for this problem using the same test msg, there's a new result. The four lines of colored text show on white background, and below them is the colored background that should apply to the whole message.
Somehow, I thought Neil was already aware of this bug, but he's not been on the CC list.  He's fixed similar problems to this before.

(In reply to comment #22)
> On checking Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.9a1) Gecko/20060321
> SeaMonkey/1.5a for this problem using the same test msg, there's a new
> result. The four lines of colored text show on white background, and below
> them is the colored background that should apply to the whole message.

I just tried 1.5a-0925 and didn't see the partial coloration, but I have seen that before.  As far as I could tell, the problem still exists as described in Seamonkey trunk.  Again, it doesn't occur in Thunderbird.
This is actually the SeaMonkey version of bug 246414.
Depends on: 358247
Assignee: sspitzer → bugzilla
Should be fixed in tomorrow's SeaMonkey nightlies.
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
No specific bug / patch referenced as the fix.

-> WORKSFORME
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Sorry - my bad.

This bug was fixed by the fix for bug 358247.
Status: REOPENED → RESOLVED
Closed: 18 years ago18 years ago
Resolution: --- → FIXED
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.