This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
IntersectionObserver stops tracking when cmd+ is used to zoom in
https://bugs.webkit.org/show_bug.cgi?id=241730 <rdar://92272892> Reviewed by Alan Bujtas. The root margin computation was broken when root margins used percentage values, and there was effective zoom. The existing code scaled the insets, computed via floatValueForLength(), by the zoom value. This makes sense for fixed length insets; localRootBounds already has zoom applied, and will be compared with element rectangles which have also taken zoom into account. However, for percentage insets, multiplying the result of floatValueForLength() double-scales the result (since the maximumValue is already scaled). So only multiply by zoomFactor for non-percentage inset values. * LayoutTests/intersection-observer/root-margin-percentage-units-with-zoom-expected.txt: Added. * LayoutTests/intersection-observer/root-margin-percentage-units-with-zoom.html: Added. * LayoutTests/platform/ios/TestExpectations: * Source/WebCore/dom/Document.cpp: (WebCore::expandRootBoundsWithRootMargin): Canonical link: https://commits.webkit.org/251829@main
- Loading branch information
Showing 4 changed files with 52 additions and 8 deletions.