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

Daniel Glazman wrote:
> Le 18/05/10 07:37, Alan Gresley a écrit :
> 
>> I would
>> suggest that ::selection is worked on quickly and also consider in the
>> process why we have ::selection instead of :selection?
> 
> 
> Because of section 7 of Selectors:
> 
>   http://www.w3.org/TR/css3-selectors/#pseudo-elements
> 
> </Daniel>


And this is what I am questioning. A pseudo element is a manipulation 
of the DOM by CSS. ::first-letter creates a pseudo line box (much like 
span) and ::first-line changes the formatting of a series of line 
boxes. ::before or ::after generates pseudo element.

To select (highlight) content of any part of a web document is a user 
action. I can either select, hover, click or bring into focus various 
elements via a mouse, keyboard or other device that acts with a UA.

With the default selection of UA (using Windows), the background 
becomes a opaque or transparent blue (seen with images) and black text 
is changed to white. Why is this considered so different from :hover, 
:active, :focus?


In painting order 9.9.1 [1] we have:

7. Otherwise: first for the element, then for all its in-flow, 
non-positioned, block-level descendants in tree order:

   1. If the element is a block-level replaced element, then: the 
replaced content, atomically.
   2. Otherwise, for each line box of that element:
     1. For each box that is a child of that element, in that line 
box, in tree order:
       1. background color of element.
       2. background image of element.
       3. border of element.
       4.For inline elements:
         1. For all the element's in-flow, non-positioned, 
inline-level children that are in this line box, and all runs of text 
inside the element that is on this line box, in tree order:
         1. If this is a run of text, then:
           1. any underlining affecting the text of the element, in 
tree order of the elements applying the underlining (such that the 
deepest element's underlining, if any, is painted topmost and the root 
element's underlining, if any, is drawn bottommost).
           2. any overlining affecting the text of the element, in 
tree order of the elements applying the overlining (such that the 
deepest element's overlining, if any, is painted topmost and the root 
element's overlining, if any, is drawn bottommost).
           3. the text.


_Selection happens here for FF 3.6.3, Safari 4.0.5 or Opera 10.5_


           4. any line-through affecting the text of the element, in 
tree order of the elements applying the line-through (such that the 
deepest element's line-through, if any, is painted topmost and the 
root element's line-through, if any, is drawn bottommost).


_Selection happens here for IE8_


Note that the final layer 'line-through' doesn't change color on 
selection in FF 3.6.3, Safari 4.0.5 or Opera 10.50 but does change in IE8.


1. <http://www.w3.org/TR/CSS21/zindex.html#painting-order>


-- 
Alan http://css-class.com/

Armies Cannot Stop An Idea Whose Time Has Come. - Victor Hugo

Received on Tuesday, 18 May 2010 08:11:49 UTC