Re: SVG z-index

Yes, there are plans for z-index in SVG.  It has been included in the SVG 2
specifications.

https://svgwg.org/svg2-draft/render.html#ZIndexProperty

Unfortunately, last time I checked none of the browsers had implemented
support.

Regarding Gavin's suggestion that you can replace z-index by DOM
modifications:

If all you care about is the final appearance of a static image, yes, this
is an option.  WYSIWYG graphics editors have been using this approach for
SVG for 15 years.

However, for structured or interactive web graphics, the inability to
separate painting order from document order is quite problematic.  Instead
of using semantic groups (such as a shape plus its label in a chart or
diagram) that can be moved together or respond to user events together, you
need to sort elements into painting order groups (e.g., all the shapes in
one group, then all the labels in another).

Equally important, screen readers read an SVG document in DOM order unless
ARIA attributes (aria-owns or aria-flowto) direct them otherwise.
Copy&paste functionality uses DOM order regardless of ARIA.  If you want to
overlap text for graphical effect, you can end up completely jumbling its
meaning.  Adding sensible, structured alternative text becomes much more
difficult.

And finally, as Curtis noted, it is a hassle when converting back and forth
from other graphics formats that do have native support for layering
control.

~ Amelia BR

Received on Monday, 7 September 2015 16:03:06 UTC