Fixing glitches in animations for safari browser