Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5f1860cfa16120cadfca52ea47e1c62e475eec2f
      
https://github.com/WebKit/WebKit/commit/5f1860cfa16120cadfca52ea47e1c62e475eec2f
  Author: Phipson Lee <[email protected]>
  Date:   2026-05-01 (Fri, 01 May 2026)

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

  Log Message:
  -----------
  Increase Live Resize Relayout Frequency
https://bugs.webkit.org/show_bug.cgi?id=313475
rdar://171180718

Reviewed by Wenson Hsieh and Abrar Rahman Protyasha.

This PR introduces a new relayout heuristic for visionOS during live window 
resize.
Previously during live resize we do not update the web content layout due to 
rendering
and layout bugs. This is an unideal user experience as it is unresponsive and 
users will
not know what the website looks like as they resize the window, unless they 
stop the
resize, wait, and re-initiate.

To address this, we introduce a helper function called 
_shouldForceEndLiveResize that
triggers a live resize by overriding the endLiveResizeHysteresis. This function 
returns true
whenever a certain time has past since the last resize and also if the width of 
the window
has changed past a certain amount during resize.

* Source/WTF/wtf/PlatformEnable.h:
* Source/WTF/wtf/PlatformEnableCocoa.h:
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewInternal.h:
Introduce a new flag to guard live resize relayout changes
Also introduce new parameters to track previous relayout information.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(liveResizeMinimumTimeBetweenResizes):
(liveResizeMinimumWidthDifference):
(-[WKWebView _shouldForceEndLiveResize]):
New helper function that determines whether to set the live resize timer to 0 
based on
the current time and total width changed since the last relayout.

(-[WKWebView _resetResponsiveResizeState]):
(-[WKWebView _initializeResponsiveResizeState]):
(-[WKWebView _rescheduleEndLiveResizeTimer]):
Adds a call to _shouldForceEndLiveResize to trigger a live resize/relayout.
(-[WKWebView _updateLiveResizeTransform]):
Adds a call to update the liveResizeSnapshotContainerView's transform so that 
it matches closely
to the original web content during resize
(-[WKWebView _endLiveResize]):
Updates the internal state for _perProcessState to track the updated timestampe 
and width
for relayout. Also updates the live snapshot view by placing it in a container 
such that
it will updates its transform during resize if the content view has not 
finished layout yet.

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



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

Reply via email to