Fix performance regression related to overflow recalc

In r731227 we started to mark the container chain
in one extra situation compared with the previous code.
That introduced performance regressions in a few tests.
That situation was when SelfPaintingLayerNeedsVisualOverflowRecalc()
was false, in that case we also called
MarkContainerChainForOverflowRecalcIfNeeded().

This patch comes back to the previous code when we only call
MarkContainerChainForOverflowRecalcIfNeeded()
if SelfNeedsLayoutOverflowRecalc() is false.

This can be confusing when we call SetNeedsOverflowRecalc()
only for visual overflow, as we don't mark the ancestors
if SelfNeedsLayoutOverflowRecalc(). However this should
be safe anyway as MarkSelfPaintingLayerForVisualOverflowRecalc()
would have been called previously.

Bug: 1042855
Change-Id: Ifc7c0208ffdcef06a740d8a5091ba3f3b7466623
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2006549
Reviewed-by: Philip Rogers <pdr@chromium.org>
Commit-Queue: Philip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#735235}
4 files changed