Auto labels use white text over default GUI background until configured
Categories
(Thunderbird :: Message Reader UI, defect)
Tracking
(thunderbird_esr91+ verified, thunderbird96+ verified, thunderbird97 affected)
People
(Reporter: lea.gris, Assigned: Paenglab)
References
Details
Attachments
(3 files)
2.76 KB,
image/png
|
Details | |
1.16 KB,
patch
|
mkmelin
:
review+
wsmwk
:
approval-comm-beta+
wsmwk
:
approval-comm-esr91+
|
Details | Diff | Splinter Review |
2.10 KB,
image/png
|
lea.gris
:
feedback+
|
Details |
User Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:95.0) Gecko/20100101 Firefox/95.0
Steps to reproduce:
When X-Mozilla-Keys: key words are displayed in message header bar, these renders white text over light grey background in Linux default system colour theme.
To reproduce:
In Thunderbird Linux Ubuntu default theme using system colours:
- Subscribe to RSS feed https://stackoverflow.com/feeds/tag?tagnames=bash&sort=newest
When viewing RSS entries/posts, the labels in header like:
X-Mozilla-Keys: linux bash oracle
Keywords: linux, bash, oracle
these are displayed as unreadable white text over light grey background.
Actual results:
Keywords/Keys displayed as unreadable white text over light grey background.
See attached screenshot portion.
Expected results:
Use readable contract like the default text colour.
When a label has not been configured with a colour, the rendering of the text is considered with the background is RGB #000000 black and use a white colour for the text, but the background of the label is rendered the default GUI background tint which is usually light grey.
This is indeed a bug affecting all automatically created labels without a user configured colour.
This makes automatically created labels, totally illegible. (IMAPv4 or ATOM XML RSS tags or labels).
Generated HTML code for an automatically-generated label
<label xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
value="database"
class="tagvalue"
style="color: white; background-color: ;"
aria-label="Étiquettes: database"
/>
Generated inline style-sheet
color: white;
background-color: ;
As can be seen, newly generated labels without a specifically configured colour, defines no background-color
, but still programmatically sets a white text colour.
Could be fixed with:
A proper behaviour change would be to not set the CSS color
when background-color
is not set either.
So that when label colour is not defined, it renders with the default GUI's text and background colours.
Assignee | ||
Comment 3•3 years ago
|
||
This fixes the issue by checking in isColorContrastEnough()
if there is a background colour set. If not the default text colour (black) is used.
Assignee | ||
Updated•3 years ago
|
Comment 4•3 years ago
|
||
Assignee | ||
Comment 5•3 years ago
|
||
But all caller of isColorContrastEnough()
seems to check for boolean, or not? See https://searchfox.org/comm-central/search?q=isColorContrastEnough&case=false®exp=false&path=
(In reply to Richard Marti (:Paenglab) from comment #5)
But all caller of
isColorContrastEnough()
seems to check for boolean, or not? See https://searchfox.org/comm-central/search?q=isColorContrastEnough&case=false®exp=false&path=
The function is not funny at all, it always returns a boolean.
The other return point is this:
return new Color(cR, cG, cB).isContrastRatioAcceptable(
new Color(0, 0, 0),
"AAA"
);
It creates a new Color
object instance from the R,G,B components of the label colour (which due to the 0 padding, makes it black when the background-color
is not defined).
From this Color
object instance, it calls the isContrastRatioAcceptable()
method with a black Color
object. The methods returns a boolean, so does the isColorContrastEnough
method as well.
Comment 7•3 years ago
|
||
Assignee | ||
Updated•3 years ago
|
Updated•3 years ago
|
Pushed by mkmelin@iki.fi:
https://hg.mozilla.org/comm-central/rev/b221272a0b63
Use in Tags black text when no background color is set. r=mkmelin
Assignee | ||
Comment 9•3 years ago
|
||
Comment on attachment 9257172 [details] [diff] [review]
1747909-tag-black-text.patch
[Approval Request Comment]
User impact if declined: unreadable RSS auto tags
Testing completed (on c-c, etc.): on c-c
Risk to taking this patch (and alternatives if risky): low
Comment 10•3 years ago
|
||
Comment on attachment 9257172 [details] [diff] [review]
1747909-tag-black-text.patch
[Triage Comment]
Approved for beta
Approved for esr91
Comment 11•3 years ago
|
||
bugherder uplift |
Thunderbird 96.0b4:
https://hg.mozilla.org/releases/comm-beta/rev/06340a7526cd
Reporter | ||
Comment 12•3 years ago
|
||
This screenshot from Thunderbird Daily 97.0a1 (2022-01-04) (64-bit) just confirms the issue has been resolved with the intended result.
Comment 13•3 years ago
|
||
bugherder uplift |
Thunderbird 91.5.0:
https://hg.mozilla.org/releases/comm-esr91/rev/5746d3089492
Updated•3 years ago
|
Description
•