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

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 UTC