Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 07f28d8dc23bc8916423610af77e4d6c2f69b15a
https://github.com/WebKit/WebKit/commit/07f28d8dc23bc8916423610af77e4d6c2f69b15a
Author: Simon Fraser <[email protected]>
Date: 2024-11-09 (Sat, 09 Nov 2024)
Changed paths:
M Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h
M Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm
M Source/WebKit/UIProcess/PageClient.h
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h
M Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm
M
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.h
M
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/mac/PageClientImplMac.h
M Source/WebKit/UIProcess/mac/PageClientImplMac.mm
M Source/WebKit/UIProcess/mac/WebPageProxyMac.mm
M Source/WebKit/UIProcess/mac/WebViewImpl.h
M Source/WebKit/UIProcess/mac/WebViewImpl.mm
Log Message:
-----------
Make it possible to set -_topContentInset with an immediate push to the web
process
https://bugs.webkit.org/show_bug.cgi?id=282857
rdar://139542356
Reviewed by Aditya Keerthi.
152497@main added some asynchrony to setting _topContentInset, delaying the
push to
the web process by a runloop turn by default. This causes problems for clients
that
attempt to change the WKWebView frame and _topContentInset at the same time,
and expect
flicker-free rendering.
This change doesn't fix the fundamental issue that changing the view's frame and
_topContentInset isn't synchronized (because the visible impact of changing
_topContentInset require a round-trip via the web process), but it does allow
the client
to avoid the `RunLoop::main().dispatch()` asynchrony in
`scheduleSetTopContentInsetDispatch`
via a new `-[WKWebView _setTopContentInset:immediate:]` SPI.
In addition, if the view size is changed, we ensure that we push a pending
topContentInset
change to the web process in
`RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry()`. This
requires moving the storage of `m_pendingTopContentInset` and related data and
functions
from WebViewImpl to WebPageProxy. We use a PageClient callback to compute the
automatic topContentInset.
* Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:
* Source/WebKit/UIProcess/API/mac/WKWebViewMac.mm:
(-[WKWebView _setTopContentInset:]):
(-[WKWebView _setTopContentInset:immediate:]):
* Source/WebKit/UIProcess/PageClient.h:
(WebKit::PageClient::computeAutomaticTopContentInset):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.h:
* Source/WebKit/UIProcess/mac/PageClientImplMac.mm:
(WebKit::PageClientImpl::computeAutomaticTopContentInset):
* Source/WebKit/UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::setAutomaticallyAdjustsContentInsets):
(WebKit::WebPageProxy::updateContentInsetsIfAutomatic):
(WebKit::WebPageProxy::setTopContentInsetAsync):
(WebKit::WebPageProxy::pendingOrActualTopContentInset const):
(WebKit::WebPageProxy::scheduleSetTopContentInsetDispatch):
(WebKit::WebPageProxy::dispatchSetTopContentInset):
* Source/WebKit/UIProcess/mac/WebViewImpl.h:
* Source/WebKit/UIProcess/mac/WebViewImpl.mm:
(WebKit::WebViewImpl::setAutomaticallyAdjustsContentInsets):
(WebKit::WebViewImpl::automaticallyAdjustsContentInsets const):
(WebKit::WebViewImpl::updateContentInsetsIfAutomatic):
(WebKit::WebViewImpl::topContentInset const):
(WebKit::WebViewImpl::setTopContentInset):
(WebKit::WebViewImpl::flushPendingTopContentInset):
(WebKit::WebViewImpl::endDeferringViewInWindowChanges):
(WebKit::WebViewImpl::endDeferringViewInWindowChangesSync):
(WebKit::WebViewImpl::prepareForMoveToWindow):
(WebKit::WebViewImpl::scheduleSetTopContentInsetDispatch): Deleted.
(WebKit::WebViewImpl::dispatchSetTopContentInset): Deleted.
Canonical link: https://commits.webkit.org/286379@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