[webkit-changes] [WebKit/WebKit] 5ae731: [iOS] Safari window sometimes flashes black when a...

Simon Fraser noreply at github.com
Mon Jul 24 17:51:19 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 5ae7317c43cdc8799371c8f0cbde1dc5c683ae78
      https://github.com/WebKit/WebKit/commit/5ae7317c43cdc8799371c8f0cbde1dc5c683ae78
  Author: Simon Fraser <simon.fraser at apple.com>
  Date:   2023-07-24 (Mon, 24 Jul 2023)

  Changed paths:
    M Source/WebKit/Platform/spi/ios/UIKitSPI.h
    M Source/WebKit/UIProcess/ApplicationStateTracker.h
    M Source/WebKit/UIProcess/ApplicationStateTracker.mm
    M Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm

  Log Message:
  -----------
  [iOS] Safari window sometimes flashes black when app switching or tab switching
https://bugs.webkit.org/show_bug.cgi?id=259455
rdar://107673739

Reviewed by Tim Horton.

WebKit relies on the _UIApplicationDidFinishSuspensionSnapshotNotification notification to do two things
in WebPageProxy::applicationDidFinishSnapshottingAfterEnteringBackground(): if layers contain Mach port
contents, map in IOSurfaces for those so that we don't hold an in-use count which prevents the layers from
becoming volatile (no longer applicable now that layers hold CAIOSurfaceRefs), and storing a TransactionID
in RemoteLayerTreeDrawingAreaProxy::hideContentUntilPendingUpdate() to keep content hidden until we get
a new transaction on resume.

UIKit stopped sending that notification a few years ago (rdar://112569013) so just hook up our call to
`applicationDidFinishSnapshottingAfterEnteringBackground()` at the end of `_didCompleteSnapshotSequence`.

Also add some release logging for background snapshotting.

* Source/WebKit/Platform/spi/ios/UIKitSPI.h:
* Source/WebKit/UIProcess/ApplicationStateTracker.h:
* Source/WebKit/UIProcess/ApplicationStateTracker.mm:
(WebKit::ApplicationStateTracker::ApplicationStateTracker):
(WebKit::ApplicationStateTracker::~ApplicationStateTracker):
(WebKit::ApplicationStateTracker::applicationDidFinishSnapshottingAfterEnteringBackground): Deleted.
* Source/WebKit/UIProcess/ios/WKApplicationStateTrackingView.mm:
(-[WKApplicationStateTrackingView didMoveToWindow]):
(-[WKApplicationStateTrackingView _applicationDidFinishSnapshottingAfterEnteringBackground]):
(-[WKApplicationStateTrackingView _willBeginSnapshotSequence]):
(-[WKApplicationStateTrackingView _didCompleteSnapshotSequence]):

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




More information about the webkit-changes mailing list