Open Bug 1287640 Opened 9 years ago Updated 3 years ago

CSS background colour in emails is not limited in scope

Categories

(MailNews Core :: Composition, defect)

x86_64
Linux
defect

Tracking

(Not tracked)

UNCONFIRMED

People

(Reporter: list, Unassigned)

References

Details

Attachments

(1 file)

Attached file css background.eml
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:47.0) Gecko/20100101 Firefox/47.0 Build ID: 20160606114208 Steps to reproduce: When Thunderbird processes an email which uses css for styling, the scope of the css is not properly limited. This is in particular visible when the css sets the background colour for the body. Please see the attached file "css background.eml" for a minimal working example of the issue. The email contains two parts, an html part which has a red background as well as a text only footer (as it is common for mailing lists). Open the email and look at it. Also, craft a reply to this email. Furthermore, I tried to manually change the background colour of the reply (using "Format -> Page Colors and Background" from the manu) Actual results: When viewing the email, the text-only footer was displayed using the same style sheet as the html part, resulting in a white background. When replying to the email, the red background is present for the entire email including the newly written part. Changing the background colour through "Format -> Page Colors and Background" had no effect at all. There seems to be no way to get rid of the red background within Thunderbird. Expected results: When displaying the email, the text-only footer should have a default white background. When replying to the email, the red background should be limited to the quotation of the email we are replying to. When using the "Format -> Page Colors and Background" dialogue, the chosen background colour should be used. It seems to me, that Thunderbird should generally limit the scope of the css. I.e. it should set the "scoped" attribute of the included css (http://www.w3schools.com/tags/att_style_scoped.asp) before passing the content to the rendering engine. Similarly, when crafting a reply, the scope of the css should be limited to the part that is the quotation.
OS: Unspecified → Linux
Hardware: Unspecified → x86_64
Version: 38 Branch → 45 Branch
Attachment #8772212 - Attachment mime type: application/x-extension-eml → text/plain
Please look at the message in the DOM Inspector. You will see that the entire message including the plain text second MIME part is placed into the body element. I suggest to use a div to limit the red. You also mention that setting the background colour has no effect. Sadly TB sets the attribute on the body, like so: <body bgcolor="green" ...>. That conflicts with your CSS. If you want to use CSS, please don't use the other TB formatting which is still at HTML 2.0. Proper CSS support in TB (and in the Mozilla core editor) is sadly missing. We have very few unpaid and overworked resources, so I don't think this bug will receive any attention.
See Also: → 1297653
Component: Untriaged → Composition
Product: Thunderbird → MailNews Core
Version: 45 Branch → 45
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: