Re: [svgwg] Opacity properties should affect nothing but opacity

> This is an example (linked from 
https://philipwalton.com/articles/what-no-one-told-you-about-z-index/ 
) where changing opacity for one item (an item without any children 
elements / not a group) changes stacking order:

That's not true, the example does use groups. The opacity is changed 
on the div element, which is a grouping element. The z-index is 
applied to the object within the group.

The example is contrived to make a point. It's useful for explaining 
the finer points of stacking contexts, but It's not a good way to 
structure a document. But having thought about the structure of this 
document. I do have an idea of how we might be able to reduce any 
possible confusion - though it sacrifices flexibility.

There are legitimate reasons to want to change the opacity of a group,
 and change the position in the z axis of one element in the group - 
the group might be used to apply a common transformation perhaps (note
 transform doesn't create a stacking context in SVG). But in this 
case, you just can't do it all with one group and that's not going to 
change. A group can only represent the set of objects that are 
transformed, or the set of objects that are adjacent in the z axis.

This leads me to how we can reduce confusion. This may be achieved by 
forcing the group to only represent the set of objects that are 
adjacent in the z-axis. We can define SVG to make the parent object of
 any element that has a z-index other than 'auto' form a stacking 
context. This would mean that the use of z-index inside a group can 
only be used to control the stacking order within that group. It's 
restrictive, but mostly consistent with how groups should be used.

This might be a terrible idea (it's pretty late here), or we may not 
want to be that restrictive. But I'll reopen this for comment.

-- 
GitHub Notification of comment by nikosandronikos
Please view or discuss this issue at 
https://github.com/w3c/svgwg/issues/264#issuecomment-247193381 using 
your GitHub account

Received on Thursday, 15 September 2016 00:01:26 UTC