Closed Bug 249882 Opened 20 years ago Closed 20 years ago

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

Categories

(MailNews Core :: Composition, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.8alpha2

People

(Reporter: sspitzer, Assigned: sspitzer)

References

Details

(Keywords: fixed-aviary1.0, regression)

Attachments

(3 files, 2 obsolete files)

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.

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"
Attachment #152355 - Flags: superreview?(daniel)
Attachment #152355 - Flags: review?(neil.parkwaycc.co.uk)
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.
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.
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 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-
Attachment #152559 - Flags: review+
spun off code cleanup issue to bug #250278
Blocks: 250278
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
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
Closed: 20 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.8alpha2
*** 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.

Attachment

General

Created:
Updated:
Size: