Open
Bug 585466
Opened 15 years ago
Updated 3 years ago
Use better strategy for ensuring visible text selection colors
Categories
(Core :: Layout: Text and Fonts, defect)
Tracking
()
NEW
People
(Reporter: stanio, Unassigned)
References
()
Details
Attachments
(2 files)
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.11) Gecko/20100701 SeaMonkey/2.0.6
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0b4pre) Gecko/20100808 Minefield/4.0b4pre
Although I'm using a latest Minefield nightly this has always been a case, even with Gecko 1.8.*.
To ensure visible text selection, Mozilla distinguishes the normal text background and foreground colors and renders a selection either with the straight configured values or using their inverted combination, as could be seen with:
<p>
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam...</p>
<p style="background: Highlight; color: HighlightText;">
Aliquam quam risus, lacinia at fermentum ac, molestie rhoncus...</p>
<p style="background: white; color: black;">
Integer vel libero non lorem fermentum elementum quis in leo...</p>
<p style="background: black; color: white;">
Nullam metus magna, tempus at sodales ut, gravida a metus. In vitae...</p>
I very often hit sites where the text selection doesn't appear to work or is hardly distinguishable, like <http://blog.mozilla.com/about_mozilla>:
http://imgur.com/2I7CK.png
Can you tell what I've selected? Comparing the selection with other browsers like IE 6, Opera 10.60, Safari 5 (all on Windows XP) - they render the selection o.k. (using my normal configured selection colors):
http://imgur.com/MMERV.png
Reproducible: Always
Steps to Reproduce:
1. Use a color scheme specifying selection colors of darker background and white foreground (most standard themes);
2. Go to <http://blog.mozilla.com/about_mozilla> and select some of the text.
Actual Results:
The text color of the selection changes almost not noticeably making it very hard to distinguish.
Expected Results:
The selection should contrast with the normal text much better.
Looking into the page source I see following related elements:
<body>
<div id="rap">
<div id="top">
...
And these related CSS rules applied:
body {
background: #333 url(img/bodybg.png) repeat-x fixed top center;
}
#top {
background: url(img/contentbg.gif) repeat-y top center;
}
Removing the background image (using Firebug, DOM Inspector, a bookmarklet) from the div#top makes this clearer:
http://imgur.com/b32u2.png
http://imgur.com/V6ODK.png
Seems Mozilla is picking the selection colors based on the guessed background color which doesn't seem as reliable (background images could not easily be taken into account). I think Mozilla should just be using the color of the text when determining the selection colors, as the other browsers appear to do.
Comment 1•15 years ago
|
||
Masayuki, what do you think of doing this?
Note that at least on Mac the default selection behavior seems to be to not change the color at all; only the background is used to indicate the selection...
Status: UNCONFIRMED → NEW
Ever confirmed: true
Updated•15 years ago
|
Component: Layout → Layout: Text
QA Contact: layout → layout.fonts-and-text
| Reporter | ||
Comment 2•15 years ago
|
||
Actually only IE 6 renders the selection o.k. Safari and Opera seems to use just the straight highlight colors. Sorry for the misinformation.
Using the text foreground color as base for the strategy of determining straight/inverted highlight colors would be better in more of the cases, as I've already mentioned the background is "computed" harder while the foreground color always has a specified value other than 'transparent', and if this value makes the normal text contrast against the whatever background shines through o.k. then selection colors based on it would be o.k. too.
It is interesting to define what colors the selection should be in the following case:
<p style="background: white url(black.png); color: white;">
Integer vel libero non lorem fermentum elementum quis in leo...</p>
where "black.png" is 1 pixel black image. IE 6 seems to detect the effective black background and renders a selection with inverted colors.
| Reporter | ||
Comment 3•15 years ago
|
||
| Reporter | ||
Comment 4•15 years ago
|
||
The top frame shows Minefield with normal (non-selected) text from attachment 463936 [details]. The rest show the results of having all of the text selected in the different browsers - Firefox, IE 6, Opera 10.60, Safari 5 (on Windows XP).
Summary: Use better strategy for insuring visible text selection colors → Use better strategy for ensuring visible text selection colors
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•