Suspend SVG image animations when the page is hidden

Check Document::hidden() in LayoutObject::WillRenderImage,
thus pausing animations on pages that are not visible.
To resume animations, we may need to explicitly resume the
timeline, so a hook is added in Page::SetVisibilityState to
allow calling StartAnimation() on the relevant SVGImages.

Bug: 856082
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I4a0b008730ec3e6c2af26e15d52eebb26020ad32
Reviewed-by: Chris Harrelson <>
Commit-Queue: Fredrik Söderquist <>
Cr-Commit-Position: refs/heads/master@{#571543}
7 files changed