[svgwg] stacking context / rendering order requirements are mostly not Web compatible

heycam has just created a new issue for https://github.com/w3c/svgwg:

== stacking context / rendering order requirements are mostly not Web compatible ==
This might be re-hashing some comments from #264.

https://svgwg.org/svg2-draft/render.html#EstablishingStackingContex defines which elements in SVG cause a stacking context to be created, and the order of painting of elements within a stacking context.  These rules are in line with how CSS-rendered HTML content works, but mostly do not reflect what implementations do now.  Since we don't have implementations that support `z-index` yet, we can see this due to the requirement that elements that generate stacking contexts be painted on top of those that do not.

In all these tests, the correct rendering per spec is to show a green rectangle and not a red one:

Passes in Chrome, Edge, Firefox, Safari:
* [outermost `<svg>` element](http://mcc.id.au/temp/stacking-contexts/outermost-svg.html)

Passes in Chrome; Fails in Edge, Firefox, Safari:
* [`foreignObject`](http://mcc.id.au/temp/stacking-contexts/foreignObject.html)

Fails in Chrome, Edge, Firefox, Safari:
* [`<image>` element](http://mcc.id.au/temp/stacking-contexts/image.svg)
* [`<use>` element](http://mcc.id.au/temp/stacking-contexts/use.svg)
* [inner `<svg>` element](http://mcc.id.au/temp/stacking-contexts/inner-svg.svg)
* [`clip-path`](http://mcc.id.au/temp/stacking-contexts/clip-path.svg)
* [`opacity`](http://mcc.id.au/temp/stacking-contexts/opacity.svg)
* [`filter`](http://mcc.id.au/temp/stacking-contexts/filter.svg)
* [`transform`](http://mcc.id.au/temp/stacking-contexts/transform.svg) (Edge fails due to not supporting transform on SVG elements set via style)

I can understand wanting to align with CSS here in general, but I can't see how we can make most of these cases induce stacking contexts without breaking content.

Please view or discuss this issue at https://github.com/w3c/svgwg/issues/463 using your GitHub account

Received on Friday, 18 May 2018 02:48:59 UTC