Firefox对transition delay为0要求强制单位,display: contents会破坏动画渲染树,rotateY(180deg)存在插值路径歧义,硬件加速需满足perspective、backface-visibility等完整条件。
Chrome会容错处理transition: background-color 0.3s ease 0,但Firefox直接判整条声明无效——开发者工具里该行被划掉,动画完全不触发。这不是“不支持”,是静默失效。
transition: background-color 0.3s ease 0s或transition: background-color 0.3s ease 0ms
delay为0时强制要求单位;duration为0也建议写0s,但非必须transition声明,尤其JS动态注入的样式,容易漏掉单位当动画目标元素(比如.wrapper span)设置了display: contents;,它在渲染树中几乎“消失”,Firefox无法为其建立独立合成层,导致动画卡顿甚至跳帧。
display: contents;做布局,把动画逻辑移到其子元素或父容器上,避开该节点本身从rotateY(0deg)到rotateY(180deg),数学上等价于rotateY(-180deg),但Firefox插值时可能选了反向路径,造成翻转方向异常或卡顿。
rotateY(179deg)或rotateY(-179deg),避开180度临界点perspective加在父容器上,不是翻转元素自身backface-visibility: hidden和transform-origin: center缺一不可,否则Firefox合成失败写了transform: translateX(10px)不代表进了GPU合成层。Firefox比Chrome更苛刻:父容器overflow、兄弟元素状态、甚至JS里读取getBoundingClientRect()都可能阻断升层。
requestAnimationFrame里只写el.style.transform
Show Compositing Borders,橙色边框才表示真走GPUwill-change: transform——在touchstart设,动画结束立刻设回auto;全局CSS写死会导致内存泄漏