Bug 974347 - Improve bounds handling of non-rendered elements. r=jwatt