after forward as inline with body style, the next new message gets the body style (cached compose)

RESOLVED FIXED in mozilla1.8alpha2

Status

MailNews Core
Composition
RESOLVED FIXED
14 years ago
10 years ago

People

(Reporter: (not reading, please use seth@sspitzer.org instead), Assigned: (not reading, please use seth@sspitzer.org instead))

Tracking

({fixed-aviary1.0, regression})

Trunk
mozilla1.8alpha2
x86
Windows XP
fixed-aviary1.0, regression
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments, 2 obsolete attachments)

after fwd as line a particular message, the cached compose window gets tainted.

thanks to chris h. and dveditz for figuring this one out.

someone sent chris h. an email, which used a background from some adware from
hotbar.com.

when you use mozilla or tbird to do a fwd-line, the background gets included.

later, when you compose you next new message that uses the same compose window
that you used for the fwd-inline, you get the same background.

it sounds likes some style (or body attribute?) is persisting in the cached
compose window.

investigating...
note, I don't think mozilla 1.4 has this bug so it's a regression.
Status: NEW → ASSIGNED
Keywords: regression
Mozilla mail compose uses a <body> attribute to add background images, the
message in question used CSS. Since there's no way to set styles in mail compose
(AFAIK) maybe we didn't think about needing to clear them.

Glazman has been working on style support in compose, it could well be something
added since 1.4
I think the fix will be to EditorResetFontAndColorAttributes()
the attached patch fixed the problem for me.  

(I'll attach a test case)

I'll ping glazman for a review, and see if he thinks the same fix should be
applied to mozilla/composer/base/content/editor.js as well.

Created attachment 152356 [details]
a local mbox file with the message that demostrates the bug
to reproduce the bug:

1) save http://bugzilla.mozilla.org/attachment.cgi?id=152356&action=view under
"Local Folders" on disk
2) start mozilla or tbird, select that folder in the folder pane
3) select the message, do a fwd inline (see the hotbar image)
4) close the compose window
5) do "new message", the hotbar image and background style persists (I'll screen
shot)

after this fix, you won't see the hotbar image and background style when you do
"new message"
Created attachment 152358 [details]
screen shot of the bug in tbird
Attachment #152355 - Flags: superreview?(daniel)
Attachment #152355 - Flags: review?(neil.parkwaycc.co.uk)

Comment 9

14 years ago
Are there any other attributes we might want to remove, such as dir or title?
Summary: after fwd as line a particular message, the cached compose window gets tainted → after fwd as inline with body style, the next new message gets the body style (cached compose)
> Are there any other attributes we might want to remove, such as dir or title?

good question.  from googling, there are other attributes (like lang?) we might
want to remove.

Comment 11

14 years ago
In that case it may be better to create a dummy element and clone its attributes
(thus deleting any existing attributes) as if you'd gone into Advanced
Properties and removed them all.
Created attachment 152533 [details] [diff] [review]
new patch, based on neil's comments
Attachment #152355 - Attachment is obsolete: true
Attachment #152533 - Flags: review?(neil.parkwaycc.co.uk)
Attachment #152355 - Flags: superreview?(daniel)
Attachment #152355 - Flags: review?(neil.parkwaycc.co.uk)

Comment 13

14 years ago
Comment on attachment 152533 [details] [diff] [review]
new patch, based on neil's comments

I think you ought to use editor.document to create the right sort of body
element (document is a XUL document and will create a XUL element) even though
you're only cloning the attibutes; although it works now the back end code
might change in the future.

As well as link, alink and vlink I would have thought that the text, bgcolor
and background lines can go too.
Attachment #152533 - Flags: review?(neil.parkwaycc.co.uk) → review-
Created attachment 152559 [details] [diff] [review]
updated patch based on comments from neil
Attachment #152533 - Attachment is obsolete: true

Updated

14 years ago
Attachment #152559 - Flags: review+
spun off code cleanup issue to bug #250278
Blocks: 250278

Updated

14 years ago
Attachment #152559 - Flags: superreview+
I'll make sure mscott wants this before landing on the aviary branch.

I was going to land on the trunk, but when testing I noticed that the trunk has
aproblem with forward as inline, something that 1.7.1 and aviary 1.0 doesn't have.

see bug #250291
Depends on: 250291
Summary: after fwd as inline with body style, the next new message gets the body style (cached compose) → after forward as inline with body style, the next new message gets the body style (cached compose)
No longer depends on: 250291
Depends on: 250291
mscott says a= for aviary 1.0, so I've landed the fix there.

I need to figure out bug #250291 before I can land on the trunk.
Keywords: fixed-aviary1.0
> I need to figure out bug #250291 before I can land on the trunk.

thanks to neil for fixing that regression.

I'll land this patch once the trunk smoketest blockers are fixed.
fixed on trunk (1.8a2), too.
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8alpha2

Comment 20

14 years ago
*** Bug 234436 has been marked as a duplicate of this bug. ***
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.