I have recently started tracking CSS3 developments and found the advanced layout draft very interesting. The proposal is rather more complex than my modest needs. Forgive me if a similar idea has been covered before (or, heaven forfend, already exists), but this is all I'm after; simple render order styles.

I do not pretend to have analysed this idea to death, only so far as I could explain the intent to a non-programming friend.

Originally posted on my blog at http://www.libertini.net/libertus/2005/12/14/omnipotence-render-order-styles
On render order styles. I want three new CSS styles; “render-before”, “render-after” and “render-with”. Each style may be applied to any block-level element. Each style takes a list of element ids. An element styled with “render-before” will be rendered before each of the elements in its list. An element styled with “render-after” will be rendered after each of the elements in its list. An element styled with “render-with” will be rendered or not in the same way as each of the elements in its list. Lists given to any of these styles must not contain the id of the element being styled.

The [above] paragraph refers to an idea I have to relax the last remaining restriction on HTML rendering in browsers. Consider the following HTML file…

<head><title>Render order styles test</title></head>
<div id='first'><p>This division is rendered first</p></div>
<div id='second'><p>This division is rendered second</p></div>
<div id='third'><p>This division is rendered third</p></div>

At the moment, all browsers will render the paragraphs sequentially as read from the file. It is possible, using absolute and relative positioning, to control where the divisions will appear on the page but it is not possible to control the order in which the page renders.

Now consider the following stylesheet to be applied to the above HTML…

#third { render-before: “#first” }
#second { render-after: “#third” }

With this style, the HTML paragraphs will be rendered in the order; third, second, first. I appreciate it may not seem like much to laypeople but the effect on the relationship between the browser and the data it renders is profound and could be very useful indeed. HTML files would cease to be ordered lists of rendering blocks and become homogenous sets of block-level elements with weak, default ordering.

Paul Mitchell, Sheffield, UK