Currently we don't produce sticky position constraints until the compositing inputs update (pre-spv2) or prepaint walk (spv2). Asking for the offset before this stage has run just returns 0. Since sticky position locations are needed for layout queries ( issue 672457 ), scrolling ( issue 746590 , issue 740417 ) we added the ability to ensure compositing inputs were clean but it was not very clean.
Since the spec requires knowing the sticky offset to calculate overflow size (issue 752022) we should save the nearest ancestor overflow layer during the layout tree walk so that we can gather sticky elements within overflow scrollers during the layout walk and compute sticky position constraints as part of completing the layout for each overflow scroller.
Doing this should clean up code we added to support forcing compositing inputs clean, and should eliminate the long tail of bugs which may occur today from using an incorrect sticky position offset.
Comment 1 by smcgruer@chromium.org
, Aug 8 2017