Simplify the mapping between scroll layer and scrollbars.
1) I removed all scrollbar-related state and code from LayerImpl and put
it into LTI/LTHI instead. LTHI now owns the
ScrollbarAnimationControllers instead of holding short-lived references
to them. In LTI::DidUpdateScrollState, I made explicit the mechanism of
clip-layer (or inner-scroll-layer) notifications being associated with
the primary scroll layer before getting reforwarded to the scrollbars
(this has always been the case, but used to be implied in a fairly
subtle way).
2) I deleted the scrollbar registration logic in tree_synchronizer.cc and
SetScrollAndClipLayerById. This all existed purely to handle the
special case of the root viewport layers, and I replaced it with a few
lines of explicit special case logic (which became straightforward to
write after the code was moved to LTI). This makes the scrollbar
layer's pointer to the clip layer unneeded for anything, so I also
deleted that.
3) To eliminate the clumsy argument passing of "bool on_resize" (which
is there to make scrollbar fades longer during page load), I compute the
value at the last minute by checking whether state changed on the
scrollbar layer. This required reformulating scrollbar state from
"maximum+visible ratio" to "scroll layer length+clip layer length".
NOTRY=true
BUG=476553
TEST=LayerTreeHostImplTest.ScrollbarRegistration
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1353883005
Cr-Commit-Position: refs/heads/master@{#352984}
35 files changed