Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: acd5bf8f6c4985b12b7d577f199f4dea5a50f3f1
https://github.com/WebKit/WebKit/commit/acd5bf8f6c4985b12b7d577f199f4dea5a50f3f1
Author: Aditya Keerthi <[email protected]>
Date: 2025-09-09 (Tue, 09 Sep 2025)
Changed paths:
A
LayoutTests/fast/scrolling/ios/pin-scroll-position-on-scale-change-should-not-flicker-expected.txt
A
LayoutTests/fast/scrolling/ios/pin-scroll-position-on-scale-change-should-not-flicker.html
M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
M Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm
Log Message:
-----------
REGRESSION (295715@main): [iOS] Safari extension popup windows may open
scrolled down, website may flicker during scrolling
https://bugs.webkit.org/show_bug.cgi?id=296056
rdar://155965298
Reviewed by Abrar Rahman Protyasha.
295715@main inadvertently moved the zoom scale modification before computing the
scale ratio used to pin the scroll position to the top edge of the content. This
did not break PDFs since the scale ratio is computed using the ratio of the new
and old content sizes. However, the change effectively reverted 258521@main as
the scale ratio for all other web content would be 1, resulting in no content
offset adjustment, which is necessary to pin the scroll position. Instead,
UIKit's
default behavior of pinning to the center occurs, resulting in unexpected jumps.
In the case of Safari extensions, the web view's width is increased during
popover
presentation. This results in page scale changes for content with a fixed layout
width, and the scroll position may unexpectedly jump. Similarly, other sites,
like
GitHub's Checks page, may flicker, as a wide-fixed element is added and removed
during scrolling. In that instance, page scale changes due to WebKit's
shrink-to-fit
logic. This can result in an infinite loop where an element is added/removed
based
on scroll position, changing the page scale, which then changes the scroll
position.
Fix by moving the zoom scale modification back to where is originally was: after
computing the scale ratio, but before adjusting the content offset.
An API test is used to mimic the Safari extensions breakage, by simplying
changing
the frame of the web view. This issue was not caught by the test added in
294990@main,
since that test only *decreased* the size. Additionally, 258521@main did not
come
with any tests of its own. A layout test is used to mimic the flickering on
GitHub.
Consequently, there now exists test coverage for scroll position pinning due to
page scale changes driven by frame changes, and WebKit's shrink-to-fit logic.
Thanks to Jessica Cheung for assisting in the investigation of this issue.
*
LayoutTests/fast/scrolling/ios/pin-scroll-position-on-scale-change-should-not-flicker-expected.txt:
Added.
*
LayoutTests/fast/scrolling/ios/pin-scroll-position-on-scale-change-should-not-flicker.html:
Added.
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _updateScrollViewForTransaction:]):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/AnimatedResize.mm:
(TEST(AnimatedResize,
PinScrollPositionRelativeToTopEdgeOnPageScaleChangeAfterIncreasedSize)):
Canonical link: https://commits.webkit.org/299762@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes