W3C home > Mailing lists > Public > www-style@w3.org > October 2003

Re: [CSS3] Generated and Replaced Content - Grouping (long, examples)

From: Dylan Schiemann <dylans@yahoo.com>
Date: Fri, 31 Oct 2003 11:32:38 -0800
Message-ID: <3FA2B8D6.2080500@yahoo.com>
To: www-style@w3.org

Ian Hickson wrote:
> On Fri, 31 Oct 2003, Stanimir Stamenkov wrote:
> 
>>Maybe a better syntax would be:
>>
>>dt::before
>>
>>or even
>>
>>dt::outside {
>>   /* specify that the ::before or ::outside would group the DT and
>>    * some elements after, in some way (using some syntax) */
>>}
>>
>>I'm still maiking myself familiar with the spec and I'm not sure if
>>this approach is even "interesting"... ?
> 
> 
> It's a possibility, it depends on exactly what the syntax would be.
> 
> I'm not sure that we really want to have ::outside overloaded like that
> though. ::outside and ::before are currently well defined.

A few ideas that would cover a number of cases:

::group(startSelector,endSelector,index,offset)

dl::group(dt,dd,0,0) /* selects between the first dt and first dd */
dl::group(dt,dd,0,n) /* selects between the first dt and ending with the 
dd immediately following each dt */
dl::group(dt,dd,0,2n) /* selects every other group between the first dt 
and ending with the dd immediately following each dt */
dl::group(dt,dd,0,n+1) /* selects every group starting with the first dt 
and ending with the 2nd dd immediately following each dt */

startSelector is the selector to start with, defined in the descendant 
context of the element specified before it... might be better defined on 
the same context at the parent?

endSelector is the selector to end with, defined in the descendant 
context of the element specified before it... might be better defined on 
the same context at the parent?

index is the numerical index of the first element matching the 
startSelector in the context (basically the equivalent of count() in 
xslt/xpath).  Allowed values: integer 0 or greater

offset is the numerical offset of the first element matching the 
endSelector in the context (basically the equivalent of count() in 
xslt/xpath).  Allowed values: integer 0 or greater for selecting only 
one group.  xn + y (x,y integers greater than 0) to specify that every 
xnth group is selected with offset y.

Or maybe it would work just with nth-of-type instead:

dl::group(dt:nth-of-type(0),dd:nth-of-type(0))
dl::group(dt:nth-of-type(n),dd:nth-of-type(n))
dl::group(dt:nth-of-type(2n),dd:nth-of-type(2n))
dl::group(dt:nth-of-type(n),dd:nth-of-type(n+1))

The problem I see with this is that it could easily result in 
overlapping groups.

So maybe instead you'd want:

dl::group(dt,dd:nth-of-type(0)):nth-of-type(0)
dl::group(dt,dd:nth-of-type(n)):nth-of-type(n)
dl::group(dt,dd:nth-of-type(2n)):nth-of-type(2n)
dl::group(dt,dd:nth-of-type(n+1)):nth-of-type(n)

-Dylan

--
Dylan Schiemann
http://www.dylanschiemann.com/
http://www.sitepen.com/
Received on Friday, 31 October 2003 14:33:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:24 GMT