W3C home > Mailing lists > Public > www-style@w3.org > April 2009

Re: [selectors3 / 4] Cross element pseudo-elements

From: Giovanni Campagna <scampa.giovanni@gmail.com>
Date: Tue, 14 Apr 2009 16:15:12 +0200
Message-ID: <65307430904140715o3087db0bhc14a07aae0ef6fd5@mail.gmail.com>
To: François REMY <fremycompany_pub@yahoo.fr>
Cc: www-style <www-style@w3.org>
2009/4/14 François REMY <fremycompany_pub@yahoo.fr>:
> From: "Giovanni Campagna" <scampa.giovanni@gmail.com>
>>
>> The 8th of April has passed and the biggest issue with Selectors Level
>> 3 (outside Unicode Normalization) that I found in the group wiki is
>> the handling of ::first-line. So I would like to show my proposal,
>> that tries to generalize the solution. Some of this probably belongs
>> to Selectors Level 4, though.
>> The problem is fundamentally that ::first-line does not select a box,
>> it selects a sequence of text, which may cross box boundaries. This is
>> the same problems we had with ::selection, for example. In fact, this
>> applies to ::first-line, ::last-line, ::nth-line(an+b), ::selection,
>> ::text(regexp,n), ::first-letter, etc.
>>
>> My proposal regards the processing model for "formatting
>> pseudo-elements" (all the above). I included some examples to make it
>> clearer, using ::selection because this is more likely to cross
>> elements, but any pseudo-element in principle can be used. I used
>> selectors to refer to blocks (and I assume that multiple declarations
>> in the same block are early collapsed)
>>
>> [...]
>
> To see if I've understood you :
>
> Imagine the following markup :
>
>   <style><!--
>       .note::before {
>           content: 'Note: ';
>       }
>
>       .note::selection {
>           // ...
>       }
>   --></style>
>     <div class="note">
>       You <strong>should</should> not use this property unless
>       the context makes it necessary.
>   </div>
>
> And imagine I've selected the words 'Note: You should not'
>
> It will result, in the browser as :
>
>   <div class="note">
>         <::before>
>           <::selection>Note: </::selection>
>       </::before>
>         <::selection>You </::selection>
>         <strong>
>           <::selection>should</::selection>
>       </strong
>         <::selection> not</::selection>
>         use this property unless the context makes it necessary.
>     </div>
>
> Or as :
>
>   <div class="note">
>         <::selection>
>             <::before>
>               <::selection>Note: </::selection>
>           </::before>
>                 You
>                 <strong>
>               <::selection>should</::selection>
>           </strong
>                 not
>         </::selection>
>         use this property unless the context makes it necessary.
>     </div>
>
> Regards,
> Fremy
>

I've tried to avoid using "fake elements" (ie tags with double colon
names), but I think the model I thought is probably the first you
posted (all ::selection are siblings and are at the deepest level,
even if they're attached to elements higher up)

Giovanni
Received on Tuesday, 14 April 2009 14:15:47 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:46:58 GMT