See ToPrimitive() in StyleAnimationValue.cpp