Open Bug 1882408 Opened 2 years ago Updated 4 days ago

[meta] Fully implement transition-behavior with display property and content-visibility property

Categories

(Core :: CSS Transitions and Animations, task)

Firefox 125
task

Tracking

()

REOPENED
Tracking Status
firefox125 --- affected

People

(Reporter: sebo, Unassigned)

References

(Depends on 1 open bug, Blocks 2 open bugs)

Details

(4 keywords)

User Story

web-feature:display-animation
webcompat-risk:moderate

Given the Codepen example provided by the people behind the related web.dev blog post, transition-behavior doesn't have any influence on the transition of the display property.

According to CSS Display 4, any p value between 0 and 1 results in the non-none value. So the cards in the example should have a value of block for the display property for the time of the transition (0.25s) until it switches to none.

Sebastian

Assignee: nobody → boris.chiou
Severity: -- → S3

Looks like the animation of display is buggy, per our meta.

I'd go through it for CSS Animation as well.

So it seems like we intentionally disabled the animation of display property, per Bug 1371518 comment 0. So this may be related to supporting animation for display property. Once we support it, transition-behavior should work properly.

We probably have to fix Bug 1834877 first.

Depends on: 1834877

Here's a feature-detect, if anyone needs it:

const supportsDisplayTransition = (() => {
  let cachedValue = undefined;
  return () => {
    if (cachedValue === undefined) {
      const div = document.createElement('div');
      div.style.transition = 'display 1s allow-discrete';
      document.body.append(div);
      const cs = getComputedStyle(div);
      cs.display;
      div.style.display = 'none';
      cachedValue = cs.display !== 'none';
      div.remove();
    }
    
    return cachedValue;
  };
})();

Thanks Jake!

It's sad that there's still no support for one of the main use cases for transition-behavior and also that the CSSWG missed to add a dedicated @supports keyword for that (see the related resolution for that). So authors have to rely on a JS solution for this.

Sebastian

For reference, I've now filed https://github.com/w3c/csswg-drafts/issues/13387 to discuss whether an @supports keyword should be added for that.

Sebastian

Assignee: boris.chiou → nobody
Blocks: 1834877
Depends on: 2057006
No longer depends on: 1834877
Depends on: 2057005
Points: --- → 2

So per https://github.com/mdn/browser-compat-data/issues/26155 this is going to cause the transition-behavior BCD key to be marked as partial in Firefox, which will have the effect of making the transition-behavior web-feature marked as not supported by Firefox (and regress the status from "Newly Available" to "Limited Availability", shortly before it was expected to transition to "Widely Available").

I'm going to covert this into a meta bug to track the status of the web-feature.

Type: defect → task
User Story: (updated)
Keywords: meta, web-feature
Summary: transition-behavior doesn't work as expected → [meta] Fully implement transition-behavior

The codepen example works now with the pref on (layout.css.display-animations.enabled). So I think it's fine to close this bug.

Feel free to reopen this or file other bugs if there are any issues of transition-behavior: discrete with transition: display: xxx.

Hmm, there is an existing bug when using transition-behavior on overlay (Bug 1912426). Perhaps we should tweak the dependency or make it as an independent issue?

Status: RESOLVED → REOPENED
Depends on: 2059077
Resolution: FIXED → ---
Depends on: 1912426

I think bugmon may have closed this because it saw that we generally support transition-behavior: allow-discrete, based on the see-also linkages that it added when closing this bug. That support was added in bug 1805727, and enabled by default in bug 1901645.

Per comment 2, the display property was an exception that doesn't yet work and is still off by default (behind the pref mentioned in comment 9), and I think that issue (and maybe any other straggling issues) are what this bug was meant to track, though perhaps that wasn't clear to bugbot...

Boris, maybe worth renaming this bug to make its scope more clear? And perhaps we should move the https://web-platform-dx.github.io/web-features-explorer/features/transition-behavior/ "see-also" field and web-feature user-story value to bug 1901645, so that the "shipping" status there is tied to a bug that's actually closed...

(jgraham, do you have opinions on how we should handle this? I think you're handling the web-feature bug-tagging stuff. This just seems to be a case where we inadvertently stuck the web-feature metadata on a bug that explicitly was opened to track followup work, for a feature that has already shipped.)

Flags: needinfo?(james)

I tweak the dependency to include the interaction with overlay. We do support transition-behavior:discrete with display now (behind a pref), but the interaction with overlay doesn't work well.

Summary: [meta] Fully implement transition-behavior → [meta] Fully implement transition-behavior with display and overlay properties

Just rename this first. This bug is used to focus on display and overlay properties (based on the dependencies for now).

Points: 2 → ---
Keywords: web-feature

(In reply to James Graham [:jgraham] from comment #8)

So per https://github.com/mdn/browser-compat-data/issues/26155 this is going to cause the transition-behavior BCD key to be marked as partial in Firefox, which will have the effect of making the transition-behavior web-feature marked as not supported by Firefox (and regress the status from "Newly Available" to "Limited Availability", shortly before it was expected to transition to "Widely Available").

I'm going to covert this into a meta bug to track the status of the web-feature.

Not quite sure the suitable places/bugs to set the flag. I updated the title of this bug and moved the https://web-platform-dx.github.io/web-features-explorer/features/transition-behavior/ into bug 1901645.

Perhaps we should make https://github.com/mdn/browser-compat-data/issues/26155 as a different web-feature for only display/content-visibility/overlay properties? They are quite different from the support of transition-behavior property because we even don't support the CSS animations for display property when disabling this pref.

Summary: [meta] Fully implement transition-behavior with display and overlay properties → [meta] Fully implement transition-behavior with display/content-visibility/overlay properties

So this was marked as a web-feature tracking bug for transition-behaviour which is now marked as fully supported in Firefox: https://web-platform-dx.github.io/web-features-explorer/features/transition-behavior/

Display animation has been split into a separate feature: https://web-platform-dx.github.io/web-features-explorer/features/display-animation/

The goal here is to have one meta bug per web-feature that can track the author-visible lifecycle of that feature. That does require a bit of consideration; sometimes our engineering work doesn't exactly map to the web features, and this case was harder because the feature was split precisely because Firefox doesn't support one part. I think in this case just updating this bug to reference display-animation should be fine. If you don't want that, because you want a broader scope or whatever, then we can create a separate metabug specifically for that web-feature.

User Story: (updated)
Flags: needinfo?(james)

Per https://bugzilla.mozilla.org/show_bug.cgi?id=1912426#c7, we are not planning to support overlay property so I remove it from the title.

Summary: [meta] Fully implement transition-behavior with display/content-visibility/overlay properties → [meta] Fully implement transition-behavior with display property and content-visibility property
No longer depends on: 1912426
Blocks: 1912426
Blocks: 2059077
No longer depends on: 2059077
No longer blocks: 1834877
Depends on: 1834877
User Story: (updated)
You need to log in before you can comment on or make changes to this bug.