Re: Rendering order without positioning

liorean wrote:
> Something I feel missing from CSS is that there is no way to swap
> the positions of content without using positioning, and
> positioning is limited in that it removes the elements from their
> natural places in the normal document flow. I would like to
> propose a property that allows for changing the rendering order
> within the normal document flow.
> 
> 'rendering-order'
>     Value:  	<integer> | <integer> [relative | absolute] | auto
>     Initial:  	auto
>     Applies to:  	all elements
>     Inherited:  	no
>     Percentages:  	N/A
>     Media:  	all
>     Computed value:  	<positiveinteger> absolute
> 
> The property would change the rendering order for the flow within
> a given containing block.

Why to limit to just containing block? If I had markup like

<a>
   <b>
     <c1/>
     <c2/>
   </b>
   <d>
   </d>
</a>

And I want to display c2 as the last element of a, why I shouldn't 
be allowed to do that with this reordering mechanism? And "because 
it would be hard to implement" doesn't cut - yet! Add a 
'rendering-order-relative-to' and allow XPath there? One could use 
id(), but that would require the correct id to be in the markup.

Another interesting thing is, should anonymous elements count while 
computing rendering order value? Probably not, but then one could 
move an element off from its original position but couldn't put it 
back there - so to speak. And if anonymous elements do count, the 
relative positioning is far from "intuitive".

> If the specified order of several elements is the same, any
> element with !important will take precedence when calculating the
> computed value. For other cases source order in the document will
> set the computed order.

I think the ordering algorithm should take "'rendering-order' value" 
as the primary key and source order as secondary. So elements with 
the same value will end up in source order relative to each other. 
The !imporant can just fine work the way it does for any other property.

Perhaps allow floating point numbers so one can easily insert an 
element between two already known indexes (for example, 2 and 3)?

-- 
Mikko

Received on Monday, 24 May 2004 11:02:47 UTC