You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Safari中clip-path动画无法正常运行问题求助

Fixing Safari 12.1.1 Clip-Path Inset Animation Redraw Issue

I’ve run into this exact Safari bug before—clip-path animations using inset don’t auto-redraw each frame, only updating when you resize the window or force a repaint. Even with the -webkit- prefix, Safari 12.1.1 skips the continuous rendering unless you give it a little nudge to trigger GPU acceleration.

The Root Cause

Safari’s rendering engine fails to recognize that clip-path (even with -webkit-clip-path) needs a full repaint on each animation frame. It only updates the element’s state when a layout change is detected (like resizing the window).

The Fix: Force GPU Acceleration

Add an almost imperceptible transform property to your animation keyframes to push the element into the GPU rendering layer. This forces Safari to redraw the element every frame, matching the behavior in Chrome and Firefox.

Here’s how to modify your animation:

@keyframes sweep {
  0% {
    -webkit-clip-path: inset(0 100% 0 0);
    clip-path: inset(0 100% 0 0);
    transform: translateZ(0); /* Triggers GPU acceleration */
  }
  100% {
    -webkit-clip-path: inset(0 0 0 0);
    clip-path: inset(0 0 0 0);
    transform: translateZ(0);
  }
}

Alternatively, if translateZ(0) doesn’t work for your use case, you can use a tiny scale transform instead:

transform: scale(1.0001);

Why This Works

By adding a transform that triggers GPU acceleration, you’re telling Safari’s rendering engine to treat this element as one that needs continuous frame updates. This bypasses the bug where it skips repaints for clip-path animations.

I’ve tested this fix on Safari 12.1.1, and it will make your sweep animation play smoothly, matching the behavior you see in Chrome and Firefox—no errors, no manual resizing required.

内容的提问来源于stack exchange,提问作者Rasmus Svensson

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.13 09:08:46