CSS color keyword 'Highlight' uses wrong color

RESOLVED INVALID

Status

()

RESOLVED INVALID
11 years ago
11 years ago

People

(Reporter: bugzilla, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

11 years ago
User-Agent:       Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_4; en-us) AppleWebKit/525.18 (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1
Build Identifier: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9) Gecko/2008061004 Firefox/3.0

The CSS color keyword 'Highlight' is supposed to render as the same color the user gets when selecting text manually with the mouse. This color was correct on Firefox 2, but is now a darker shade of whatever the user has set in Firefox 3.

Reproducible: Always

Steps to Reproduce:
1. Assign the 'background: Highlight' style to an element.
Actual Results:  
The color was several shades darker than the expected highlight color.

Expected Results:  
The color should match exactly the user specified system highlight color.
(Reporter)

Comment 1

11 years ago
Created attachment 328938 [details]
HTML Test Case
(Reporter)

Comment 2

11 years ago
Created attachment 328939 [details]
Correct Rendering in FF2

Shows CSS 'background: Highlight' behavior alongside a user initiated selection highlight.
(Reporter)

Comment 3

11 years ago
Created attachment 328940 [details]
Incorrect Rendering in FF3

Same HTML test case rendered in FF3 showing difference in color between user selection and 'background: Highlight' style.
(Reporter)

Comment 4

11 years ago
I rescind my bug report - it appears that FF3 is CORRECTLY implementing the color as the selection color for a CONTROL (eg, as a menu highlight color), not as the text selection color. This behavior changed from FF2 to 3, but it appears that it is now in line with what the W3C says that color should be (http://www.w3.org/TR/css3-iccprof#css-system).
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago
Resolution: --- → INVALID
(Reporter)

Comment 5

11 years ago
I spoke too soon. While it is true that FF is using the correct interpretation of the W3C usage of that color keyword, it is using the wrong value from the system to implement it on Mac OS X.

The keyword results in a darker version of the users' 'Highlight Color' setting as listed in the System Preferences -> Appearance PreferencePane. However, that setting is described as 'For selected text' directly under the color picker. The 'Appearance' setting directly above that is to be used 'For the overall look of buttons, menus and windows'.

Given the intent of this color keyword, it appears that FF3 is not using the system tint color and instead modifying the users' text highlight color and using that as the control highlight color.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(Reporter)

Comment 6

11 years ago
Final note after investigating a similar issue with Safari. It appears that Firefox is setting that color the same way Apple does for their internal applications. In particular, despite the wording in the preference pane saying otherwise, Apple uses variations on the text highlight color to set the following system colors:

[NSColor alternateSelectedControlColor] - a darker version of the text hightlight color.
[NSColor selectedControlColor] - same color as the text highlight color.
[NSColor selectedTextBackgroundColor] - same color as the text highlight color.

All other system defined colors are derived from the 'system tint' color as specified in the Appearance popup menu in the Appearance preference pane. At this point, it looks like Firefox is using user specified colors the same way Apple is even though it may not be clear that this behavior is intended. I'm unsure if this is still a bug.

Comment 7

11 years ago
I'm resolving this as invalid, since it's intentional. "Highlight" (as you say) should be used for "Item(s) selected in a control". And that color is a "darker" variant of the color used for background of selected text. So, I think we match what mac os x users expect here.

Just some info on how those 2 different highlight colors are used:

FF3 is using the apple system color, found in apple's system prefs, for the background color of highlighted text. The color is taken from the system settings by using the Appearance Manager constant "kThemeBrushPrimaryHighlightColor".

The css color "Highlight" is taken from the system settings by using the constant "kThemeBrushAlternatePrimaryHighlightColor".

IIRC, before 10.2 there was no difference between the 2 colors - the same color was used for bg of selected text and bg of selected list items in the Finder. That could be an explanation (just speculating here) to the Safari behavior.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 11 years ago11 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.