TODO: comp-op should create a new stacking context.
- To avoid reloading of external resources when visually reordering content (moving nodes in the DOM tree temporarily removes them from the document, causing a reload). bogus usecase?
- e.g. jwatt's coverflow demo where the "cover's" contained iframes
- Planets around sun, moons around planets
- Performance. It's cheaper to change z-index than to move the node in the DOM. If the node is complex, the performance difference may be significant.
- Positioning labels logically next to the item they label in the DOM, but bringing all labels to the top graphically. Useful for maps and other things.
- Reordering without script support (CSS :hover for example).
- Moving an element above everything else in the document without moving it's node - not something that z-index generally supports given the concept of 'stacking contexts'. Perhaps a 'stacking-context' property could be added, allowing you to specify the ID of an ancestor element to use as the stacking context when you need more control?
One of the issues with z-index is that it requires manual tracking of actual index values. For example, in the coverflow example, what should the indexes of the "covers" be? What about when new items are interleaved between the existing covers? Probably the index of existing covers needs to be recalculated.