HTML message content rendering affected/hidden by messageBody.css styles: Rename our .main-header class to .moz-main-header, use custom attribute, or encapsulate
Categories
(Thunderbird :: Message Reader UI, defect, P2)
Tracking
(thunderbird_esr91 fixed)
Tracking | Status | |
---|---|---|
thunderbird_esr91 | --- | fixed |
People
(Reporter: veremia, Assigned: darktrojan)
References
(Regression)
Details
(Keywords: regression)
Attachments
(1 file)
48 bytes,
text/x-phabricator-request
|
wsmwk
:
approval-comm-esr91+
|
Details | Review |
User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:93.0) Gecko/20100101 Firefox/93.0
Steps to reproduce:
I receive a newsletter as an HTML-formatted message with inline CSS styles, particularly some elements have the .main-header
CSS class.
Actual results:
All HMTL elements bearing the CSS class .main-header
are not rendered because Thunderbird's messageBody.css stylesheet sets display: none;
for this class (it uses this class for hiding the message header).
Expected results:
All HTML content inside a message should be rendered according to the stylesheets defined in that message, not subject to Thunderbird's UI stylesheets.
This was not a problem until a recent update.
Comment 1•3 years ago
•
|
||
Thanks veremia for analysing and reporting this!
Confirming exactly as described: Message reader hides random message content if it has .main-header
class.
91.2.0 (64-bit) & 95.0a1 (2021-10-13) (64-bit), Win10.
Regressed by bug 1715726 where the .main-header
class was introduced.
- Geoff, can you fix this by renaming .main-header class to something less generic (hence less likely to be used in user HTML content) like
.moz-main-header
? That would significantly reduce the likelihood of interference with user content. - OR maybe we should use a custom attribute for this, similar to
<a moz-do-not-send="true" href="...">linktext</a>
? That might reduce the likelihood for leaking (this bug) even more. - How hard would it be to totally encapsulate user content, so that our style sheets can never leak into user content?
Ideally, we should prepend moz-
to all of our internal classes (as we used to do: .moz-attached-image-container
, .moz-vcard-table
etc.) to make them more unique, less error-prone and more easy to recognize.
.print-only
looks like another candidate which is generic enough to fail, and I'm not sure if that's working because it's under @media screen
, and should probably be a plain style (without class name) under @media print
which was recently removed.
Classes which should have moz-
prepended for consistency:
.print-only
.header-part1/2/3
.headerdisplayname
.mimeAttachment*
Remember that every OS has its own messageBody.css (is that still needed?), so currently there's at least 3 files to touch:
https://searchfox.org/comm-central/search?q=&path=messageBody.css
Comment 2•3 years ago
|
||
Anje, Wayne, Walt, for support and bug triage: Random message content in message reader might get hidden if it happens to have class="... main-header ..."
, which is used by Thunderbird to hide stuff.
Assignee | ||
Updated•3 years ago
|
Assignee | ||
Comment 3•3 years ago
|
||
Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/c7b41831845d
Add a moz- prefix to classes used in messageBody.css. r=mkmelin
Assignee | ||
Updated•3 years ago
|
Comment 5•3 years ago
|
||
Awesome, thanks Geoff for fixing this thoroughly!
Assignee | ||
Comment 6•3 years ago
|
||
Comment on attachment 9246963 [details]
Bug 1736244 - Add a moz- prefix to classes used in messageBody.css. r=mkmelin
[Approval Request Comment]
Regression caused by (bug #): bug 1715726
User impact if declined: potential for some parts of mail to be hidden by CSS
Testing completed (on c-c, etc.): in 95
Risk to taking this patch (and alternatives if risky): low
Comment 7•3 years ago
|
||
Comment on attachment 9246963 [details]
Bug 1736244 - Add a moz- prefix to classes used in messageBody.css. r=mkmelin
[Triage Comment]
Approved for ers91
Comment 8•3 years ago
|
||
(I haven't checked code-wise if this is possible) Do we know that this regression fix doesn't regress Bug 1721232 ? [macOS+Windows] With Display Attachments Inline
, attached email message shows no message headers in inline preview
Comment 9•3 years ago
|
||
bugherder uplift |
Thunderbird 91.3.2:
https://hg.mozilla.org/releases/comm-esr91/rev/1e0c23d3c10d
Assignee | ||
Comment 10•3 years ago
|
||
Do we know that this regression fix doesn't regress Bug 1721232 ? [
Well, I did remember to change all three stylesheets this time.
Description
•