Re: UA's implementation of ::selection

On May 14, 2010, at 11:10 PM, Boris Zbarsky wrote:

> On 5/15/10 12:04 AM, David Hyatt wrote:
>> The chosen colors for selection in the absence of any specified pseudo element come from the platform.  We have both active and inactive foreground and background colors (so 4 total possible different colors).  If the pseudo element specifies only a background color and not a foreground color, we'll use the platform foreground color (and vice versa).  Any specified selection colors in the pseudo element will be used in both the active and inactive states.
> 
> That doesn't really explain the behavior I see with "background: none" vs "background: transparent"... (which should give equivalent specified values, note).

The way we handle shorthands is we reset the other values to "initial."  That amounts to being unset so we decide to use the platform selection background color for background-color: initial.  For case 10, the background color is explicitly set to transparent, so we respect it.

Arguably the correct behavior should be to always honor both background and foreground color from the pseudo element even when they are just set to initial values.

dave
(hyatt@apple.com)

Received on Saturday, 15 May 2010 06:39:19 UTC