Make it possible to cancel commits following an animation

If we didn't invalidate anything when running main thread animations, there is
no need to continue with the commit.

BUG=345584,347255

Review URL: https://codereview.chromium.org/178123003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@253910 0039d316-1c4b-4281-b951-d872f2087c98
SVN changes up to revision 253910