Re: Selectors, vendor prefixes (again...) and IE9

On 5/14/10 11:45 AM, L. David Baron wrote:
> That said, I'd like to know how existing implementations handle the
> issues in
> http://lists.w3.org/Archives/Public/www-style/2008Oct/0268.html ,

I should note that I did not test the interesting cases listed here 
(selection spanning multiple differently styled elements, ::selection 
specified on multiple elements on the ancestor chain or on various 
ancestors, background colors with alpha no equal to 1, etc).

The Gecko behavior is, issue by issue:

1)  Since selection coloring and painting is done on per-"text box"
     basis, the only thing that matters is the immediate parent of the
     "text box".
2)  The default styling used by the browser is not really representable
     via CSS, since the default behavior tries to adjust colors
     automatically so as to make the selection visible.  You have to use
     *::selection {} to style all selections.  Using *:root::selection
     will only style text that is a direct child of the root element,
     not any other text.
3)  Author styles override the default styling, but only for focused
     documents.
4)  This requirement is not satisfied at all.  Author styles, if
     present, are used as-is.
5)  It is possible to change the selection style of all text
     within a specific element, but involves selectors like
     "#elt::-moz-selection, #elt *::-moz-selection".

I believe this behavior doesn't match any of your options A, B, C, 
though it really only fails #2 and #4 above for reasons that I think 
would apply to A, B, C as well, unless I'm missing something.  It does 
involve some contortions and careful management of specificity to 
address #5.

-Boris

Received on Friday, 14 May 2010 16:02:53 UTC