Use clientWidth/Height instead of offsetWidth/Height. Basic padding handling. Add a timeout for visual diff.