[CI] Restructure SVGResourcesCycleSolver

Restructure the code so that traversing a LayoutObject's resources is
shared, and rename ResourceContainsCycles to TraverseResourceContainer.
Hoist the side-effects (clearing out resources with cycles) to the
caller.

Bug: 534817, 769774
Change-Id: Icd8200a2cd9073487479e32827a9fdeb1d8d04c4
Reviewed-on: https://chromium-review.googlesource.com/966661
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#544037}
5 files changed