I have a method which takes in the optional rotate value from the caller. Which I am applying in the following manner when the transform needs to happen:
element.style.transform = "rotate(" + (this.rotate || 0) + "deg)";
If there is no value passed to the method resulting in this.rotate not being defined and the value for rotate is set to 0 degrees, does the browser's rendering engine optimize this to not perform any transformation or will the browser spend cycles attempting the css transform?
If yes, I will have to add an if
statement before attempting the transform.