With recent refactoring in this area, "bool coordinator_handles_offset" is always true:
https://cs.chromium.org/chromium/src/third_party/blink/renderer/core/paint/compositing/composited_layer_mapping.cc?l=1687
Both scrolling_coordinator and scrollable_area will always exist (due to https://bit.ly/root-layer-scrolling, though the details are not important).
We can refactor this code from the following:
------------------8<------------------
bool coordinator_handles_offset = false;
auto* scrolling_coordinator = owning_layer_.GetScrollingCoordinator();
auto* scrollable_area = owning_layer_.GetScrollableArea();
if (scrolling_coordinator && scrollable_area) {
coordinator_handles_offset =
scrolling_coordinator->ScrollableAreaScrollLayerDidChange(
scrollable_area);
}
scrolling_contents_layer_->SetPosition(
coordinator_handles_offset ? FloatPoint()
: FloatPoint(-ToFloatSize(scroll_position)));
------------------8<------------------
To:
------------------8<------------------
auto* scrolling_coordinator = owning_layer_.GetScrollingCoordinator();
scrolling_coordinator->ScrollableAreaScrollLayerDidChange(scrollable_area);
scrolling_contents_layer_->SetPosition(
FloatPoint(-ToFloatSize(scroll_position)));
------------------8<------------------
Comment 1 by bugdroid1@chromium.org
, Aug 10