It's wasteful for viewportContentsChanged() to be called from recalcStyle() if a layout is pending, because that's going to move things around, and then we'll call viewportContentsChanged() again.
It's actually positively bad, because resumePausedImageAnimationsIfNeeded() does repaints which assume the render tree is in a valid state.
I am busy with other things right now but I'll try to get to it asap. If someone else want to volunteer to make the change before then, feel free to reassign though.
Created attachment 247887 [details]
Comment on attachment 247887 [details]
Clearing flags on attachment: 247887
Committed r181133: <http://trac.webkit.org/changeset/181133>
All reviewed patches have been landed. Closing bug.