Branch: refs/heads/main Home: https://github.com/WebKit/WebKit Commit: b289d5f2461d7da84861df406cee682afa4c39df https://github.com/WebKit/WebKit/commit/b289d5f2461d7da84861df406cee682afa4c39df Author: Simon Fraser <simon.fra...@apple.com> Date: 2024-03-21 (Thu, 21 Mar 2024)
Changed paths: M Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm M Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm M Source/WebKit/UIProcess/WebPageProxy.cpp M Source/WebKit/UIProcess/WebPageProxy.h Log Message: ----------- REGRESSION (UI-side compositing?): Sporadic failures in layout tests due to wrong test images https://bugs.webkit.org/show_bug.cgi?id=271348 rdar://120050275 Reviewed by Tim Horton. When we take snapshots of layout tests, we wait for a `callAfterNextPresentationUpdate()`, which waits for a transaction to come from the web process. However, it doesn't wait for the subsequent Core Animation commit, which actually pushes changes to WindowServer. Yet the snapshot we do is a WindowServer snapshot (`PlatformWebView::windowSnapshotImage()`), so we can sometimes capture state that is stale. We don't actually know when our new content gets to WindowServer and will show up in a snapshot, but we can reduce the raciness by at least waiting for the Core Animation commit to complete. So add `callAfterNextPresentationUpdateAndLayerCommit()` and use it `WebPageProxy::forceRepaint()`. Also update `-[WKWebView takeSnapshotWithConfiguration:]` to use it. * Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm: (-[WKWebView takeSnapshotWithConfiguration:completionHandler:]): * Source/WebKit/UIProcess/Cocoa/WebPageProxyCocoa.mm: (WebKit::WebPageProxy::callAfterNextPresentationUpdateAndLayerCommit): * Source/WebKit/UIProcess/WebPageProxy.cpp: (WebKit::WebPageProxy::forceRepaint): (WebKit::WebPageProxy::callAfterNextPresentationUpdateAndLayerCommit): * Source/WebKit/UIProcess/WebPageProxy.h: Canonical link: https://commits.webkit.org/276494@main To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications _______________________________________________ webkit-changes mailing list webkit-changes@lists.webkit.org https://lists.webkit.org/mailman/listinfo/webkit-changes