Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 23e019f46ecb45cfb2262881ec29172be7d861cf
      
https://github.com/WebKit/WebKit/commit/23e019f46ecb45cfb2262881ec29172be7d861cf
  Author: Simon Fraser <[email protected]>
  Date:   2026-04-30 (Thu, 30 Apr 2026)

  Changed paths:
    M Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h
    M Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm

  Log Message:
  -----------
  [iOS] Improve scroll position preservation on rotation in RTL pages
https://bugs.webkit.org/show_bug.cgi?id=313714
rdar://175910769

Reviewed by Mike Wyrzykowski.

Add `_scrollOffsetAdjustedForObscuredInset:`, which is the inverse of
`_contentOffsetAdjustedForObscuredInset:`, and use it in `_beginLiveResize`.

`_didCommitLayerTreeDuringAnimatedResize:` had the classic scroll position/
scroll offset confusion, which breaks side-scrolling RTL pages with non-zero
scrollOrigin. Fix by converting the scrollPosition to a scroll offset before
computing contentOffsets.

No test, because rotation is not reliably testable. Manual testing shows
that this improves the behavior.

* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _scrollOffsetAdjustedForObscuredInset:]):
(-[WKWebView _didCommitLayerTreeDuringAnimatedResize:mainFrameData:]):
(-[WKWebView _updateLiveResizeTransform]):
(-[WKWebView _beginLiveResize]):

Canonical link: https://commits.webkit.org/312391@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to