[meta] Fully implement transition-behavior with display property and content-visibility property
Categories
(Core :: CSS Transitions and Animations, task)
Tracking
()
| 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
Updated•2 years ago
|
Comment 1•2 years ago
•
|
||
Looks like the animation of display is buggy, per our meta.
I'd go through it for CSS Animation as well.
Comment 2•2 years ago
•
|
||
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.
Updated•2 years ago
|
Comment 4•1 year ago
|
||
The content-visibility property is also affected, see https://developer.mozilla.org/en-US/docs/Web/CSS/content-visibility#browser_compatibility and https://github.com/mdn/browser-compat-data/issues/26155.
Comment 5•10 months ago
•
|
||
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;
};
})();
| Reporter | ||
Comment 6•10 months ago
|
||
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
| Reporter | ||
Comment 7•10 months ago
|
||
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
Updated•5 months ago
|
Updated•4 months ago
|
Comment 8•1 month ago
|
||
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.
Updated•1 month ago
|
Comment 9•16 days ago
|
||
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.
Comment 10•16 days ago
•
|
||
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?
Updated•16 days ago
|
Comment 11•16 days ago
•
|
||
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.)
Updated•16 days ago
|
Comment 12•16 days ago
|
||
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.
Updated•16 days ago
|
Comment 13•16 days ago
|
||
Just rename this first. This bug is used to focus on display and overlay properties (based on the dependencies for now).
Updated•16 days ago
|
Updated•16 days ago
|
Updated•16 days ago
|
Comment 14•16 days ago
•
|
||
(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-behaviorBCD key to be marked aspartialin Firefox, which will have the effect of making thetransition-behaviorweb-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.
Updated•16 days ago
|
Updated•16 days ago
|
Comment 15•15 days ago
•
|
||
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.
Comment 16•15 days ago
•
|
||
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.
Updated•15 days ago
|
Updated•15 days ago
|
Updated•14 days ago
|
Updated•4 days ago
|
Description
•