Ignore layout shift when visibility:hidden becomes visible
We should ignore layout shift if the object was ineligible for layout shift tracking during the previous paint invalidation. Add LayoutObject::ShouldSkipNextLayoutShiftTracking() and set it during paint invalidation if the object is ineligible for layout shift tracking. In the next paint invalidation, if the flag is true, skip layout shift tracking and reset the flag. This also applies to content-visibility:auto for which we cleared LayoutBox's previous size to prevent layout shift tracking for the next cycle. The new flag is basically equivalent to the old method, but also covers more cases, e.g. the old method would fail if the object had visual overflow because PreviousPhysicalVisualOverflowRect() was not based on PreviousSize() and empty. Bug: 1152869 Change-Id: I000489dd8093dab8d2ab3605ad4ce3bd39fd11b0 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2591367Reviewed-by:Chris Harrelson <chrishtr@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#837627}
Showing
Please register or sign in to comment