Fix layout shift tracking with 2d transforms
This fixes the following issues: 1. crbug.com/1109053 we reported transform changes as layout shifts. According to https://github.com/WICG/layout-instability#transform-changes we should ignore transform changes. This is fixed by just accumulating offsets of PaintOffsetTranslations for the additional offset for layout shift (previous offset_to_2d_translation_root, now additional_offset_to_layout_shift_root) Test: external/wpt/layout-instability/transform-change.html 2. Movement of transformed element itself was ignored. This is fixed by resetting the additional offset for layout shift after updating paint properties for child instead of during updating the properties because the offset applies to the transformed element itself. Test: external/wpt/layout-instability/move-transformed.html 3. Stale old additional offset for layout shift (previously baked in FragmentData::VisualRectTo2DTranslationRoot). We don't always update the offset when it changes because it's neither a paint property nor a paint invalidation data, thus the old data may be stale. To avoid that, now save VisualRectForLayoutShiftTracking() which is in the local transform space and is always updated, and recover the old additional offset from the old paint properties. Bug: 1109053,1104794 Change-Id: I36a3dec0695f9674251e7f5ce85ae2411b135eda Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2316783Reviewed-by:Chris Harrelson <chrishtr@chromium.org> Reviewed-by:
Steve Kobes <skobes@chromium.org> Commit-Queue: Xianzhu Wang <wangxianzhu@chromium.org> Cr-Commit-Position: refs/heads/master@{#792312}
Showing
This diff is collapsed.
Please register or sign in to comment