skip transition-patch in invisible tabs (#851)
This commit is contained in:
parent
ccb2e899b3
commit
108907d4f1
|
@ -107,10 +107,12 @@ self.createStyleInjector = self.INJECTED === 1 ? self.createStyleInjector : ({
|
||||||
}
|
}
|
||||||
|
|
||||||
function _applyTransitionPatch(styles) {
|
function _applyTransitionPatch(styles) {
|
||||||
|
isTransitionPatched = true;
|
||||||
// CSS transition bug workaround: since we insert styles asynchronously,
|
// CSS transition bug workaround: since we insert styles asynchronously,
|
||||||
// the browsers, especially Firefox, may apply all transitions on page load
|
// the browsers, especially Firefox, may apply all transitions on page load
|
||||||
isTransitionPatched = document.readyState === 'complete';
|
if (document.readyState === 'complete' ||
|
||||||
if (isTransitionPatched || !styles.some(s => s.code.includes('transition'))) {
|
document.visibilityState === 'hidden' ||
|
||||||
|
!styles.some(s => s.code.includes('transition'))) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const el = _createStyle(PATCH_ID, `
|
const el = _createStyle(PATCH_ID, `
|
||||||
|
|
Loading…
Reference in New Issue
Block a user