Skip to content

[css-transforms-2] transform-style: preserve-3d should only have effects on transformable elements #6430

Closed

Description

@dbaron

As discussed in #1950 and as changed in #3750, css-transforms-2 currently says:

A computed value of preserve-3d for transform-style establishes both a stacking context and a containing block for all descendants.

I tend to think this should only happen for transformable elements, which are what transform-style's Applies to line says it applies to. It's worth noting that the "Applies To" line isn't really defined to do anything other than cause the property not to have a used value.

However, I think the intent of this "Applies to" line is that the property only have effects on transformable elements -- i.e., that it shouldn't have effects on non-replaced inlines. In particular, the effect here would be only the third place in CSS where non-replaced inlines could be a containing block for fixed-positioned elements (the other two being filter and backdrop-filter).

So I'd propose changing the wording of the above sentence to instead say:

A computed value of preserve-3d for transform-style on a transformable element establishes both a stacking context and a containing block for all descendants.

I think this still fits with the original intent of the wording which is that the effects of grouping properties not be considered in determining whether to establish a containing block or stacking context.

cc @mattwoodrow @smfr

Activity

  1. self-assigned this
    on Jul 7, 2021
  2. dbaron commented on Jul 8, 2021

    @dbaron
    MemberAuthor

    And based on code inspection, this appears to match what Gecko does.

    (I'd like to change Chrome to do the same, because then I won't have to worry about how to fix some assertion failures.)

  3. mattwoodrow commented on Aug 4, 2021

    @mattwoodrow
    Contributor

    Sorry for the slow response. I agree that your proposed wording better reflects the intent, and makes things easier to understand and implement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions