Re: [csswg-drafts] [css-transforms-2] Preserve-3d + backface visibility semantics need to be clarified (#918)

> The current Gecko semantics are that the DOM ancestor of an element flattens if it does not have `transform-style: preserve-3d`.

In my mental mode, I consider an element with transform-style:preserve-3d, and a parent without (or with a flattening property) to create a 3d rendering context (rather than extend the parent's one). The flattening happens at the root of the 3d rendering context, so the element with preserve-3d is the one outputting a flat representation.

The subtle difference here is that it's clearer that two siblings with transform-style:preserve-3d and a transform-style:flat parent do not intersect with each other, since they're separate 3d rendering contexts. If we consider the parent to be the one that flattens, then it's harder to explain why the two preserve-3d children don't intersect.

> 
> Proposal which relaxes the above a bit: only elements that induce pseudo stacking contexts can cause flattening.

Given the above, I think the required spec text to explain how to differentiate between transform:style:preserve-3d creating or extending a 3d rendering context is complex.

You have to walk the DOM tree (not containing block chain), looking for the first pseudo-stacking context, and check if that also has transform-style:preserve-3d. But, you also have to check the intermediate elements for a flattening property (like overflow:hidden), which does break the preserve-3d, but isn't a pseudo-stacking context.

For that reason, I'd much prefer to trial using the direct parent to check for preserve-3d, just since it's much simpler to explain and understand.



-- 
GitHub Notification of comment by mattwoodrow
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/918#issuecomment-533780089 using your GitHub account

Received on Saturday, 21 September 2019 08:35:58 UTC