Use getBoundingClientRect where available.