Skip to content

[css-anchor-position-1] Interaction between trying position options and CSS transitions #13048

@tuankiet65

Description

@tuankiet65

When determining the position fallback styles for an element, it applies each position option on top of the base style to create a new style, then apply the style and see if it doesn't overflow or not. I have concerns that "apply the style" may lead to weird interactions with CSS transitions, since CSS transitions are automatically started on style change.

Some scenarios that I could think of:

  1. If a property that could affect layout transitions, should position fallback be applied throughout the transition, or only after it ends? Say width is transitioning from 100px to 200px, and 150px and above overflows the current position. Should we try position options when the transition hits width: 150px, or should it wait until the transition ends before trying?
  2. When trying position options, which implies applying a new style, should transitions be started between style changes? Say an element has position-try: flip-block flip-inline. If we're changing from the base style to flip-block, or from flip-block to flip-inline, should this trigger transitions?
  3. (kinda 1 + 2): If a property is transitioning, and it triggers position fallback, and it applies a new style, should transition be triggered?

The spec only says this, which I don't think says a lot:

These modified styles are applied to the element via interleaving, so they affect computed values (and can trigger transitions/etc) even though they depend on layout and used values.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions