ScrollAnchor: Only allow scroll anchor to be "just off screen"
During scroll anchoring, before layout, we determine an on-screen anchor and then process the layout and ensure that one of the top corners (left or right depending on writing mode) is positioned in the same spot as before. However, this causes problems if the size of the anchor also changes (with visibility) to be far off screen. Instead, only allow the anchor to move "just off screen", with one of its edges touching the viewport area. This is only applied to content-visibility: auto elements that have a pending layout. The effect is similar: the object is moved off screen, but it prevents unstable behavior with content-visibility: auto. Note that the intent of scroll anchoring is to keep the visible contents from shifting. However, in this case the contents are shifting anyway (since the anchor is off screen), so manipulating exactly how far off-screen should be ok. It is also limited to only content-visibility auto elements. R=chrishtr@chromium.org Bug: 1138801 Change-Id: I1fbc5f8b634563c770db29bf30ef6d409d810614 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2481348Reviewed-by:Chris Harrelson <chrishtr@chromium.org> Commit-Queue: vmpstr <vmpstr@chromium.org> Cr-Commit-Position: refs/heads/master@{#818681}
Showing
Please register or sign in to comment