Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e3f74a2799bcd897eccfe38f0f3b827dc3cfcd42
      
https://github.com/WebKit/WebKit/commit/e3f74a2799bcd897eccfe38f0f3b827dc3cfcd42
  Author: Ben Nham <[email protected]>
  Date:   2026-07-10 (Fri, 10 Jul 2026)

  Changed paths:
    M 
Source/WebKit/UIProcess/RemoteLayerTree/mac/RemoteLayerTreeDrawingAreaProxyMac.mm
    M Source/WebKit/UIProcess/mac/WebViewImpl.mm
    M Tools/TestWebKitAPI/SourcesCocoa.txt
    A 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/DoAfterNextPresentationUpdateOffscreen.mm

  Log Message:
  -----------
  Fix _doAfterNextPresentationUpdate hanging forever in views using 
_relatedWebView
https://bugs.webkit.org/show_bug.cgi?id=318996
rdar://181137520

Reviewed by Simon Fraser.

Test: 
Tools/TestWebKitAPI/Tests/WebKit/WKWebView/DoAfterNextPresentationUpdateOffscreen.mm

This fixes an issue where `_doAfterNextPresentationUpdate:` sometimes hangs 
forever. This is bad,
because `_doAfterNextPresentationUpdate:` hangs on to the associated WKWebView 
forever, which then
causes the associated WebContent process to run forever.

The issue affects offscreen WKWebViews using `_relatedWebView`. The first 
WKWebView's WebPageProxy
gets a drawing area with a non-empty display ID, because 
`WebPageProxy::finishAttachingToWebProcess`
eventually calls `WebViewImpl::windowDidChangeScreen`.

The second WKWebView use `_relatedWebView` and creates a WebPageProxy that has 
a drawing area with
an empty display ID. This is because those pages go down the 
`WebPageProxy::ensureRunningProcess()`
path, which never calls `WebViewImpl::windowDidChangeScreen`.

Fix this by making the WebViewImpl constructor always call 
`windowDidChangeScreen`, so that the
associated WebPageProxy and drawing area always have some non-empty display ID.

A better fix might be to make m_displayID non-optional in 
RemoteLayerTreeDrawingAreaProxyMac, which
is already mentioned in the header. However, that's a larger change, so I 
didn't attempt it here.

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



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

Reply via email to