Calculate element width/height when needed.