Here's a feature-detect, if anyone needs it:
```js
const supportsDisplayTransition = (() => {
let cachedValue = undefined;
return () => {
if (cachedValue === undefined) {
const div = document.createElement('div');
Object.assign(div.style, {
width: '2px',
transition: 'display 1s allow-discrete'
});
document.body.append(div);
div.offsetWidth;
div.style.display = 'none';
cachedValue = div.offsetWidth === 2;
}
return cachedValue;
};
})();
```
Bug 1882408 Comment 5 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Here's a feature-detect, if anyone needs it:
```js
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;
};
})();
```