Bug 904470 - Use loadend event instead of paint event.