fix safari crash by avoiding use of calc