Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 9cd4b2a3a7eaaaf4fca1dc1a74f52b3dabf6f13f
      
https://github.com/WebKit/WebKit/commit/9cd4b2a3a7eaaaf4fca1dc1a74f52b3dabf6f13f
  Author: Aditya Keerthi <[email protected]>
  Date:   2025-11-05 (Wed, 05 Nov 2025)

  Changed paths:
    M Source/WebKit/UIProcess/WKImagePreviewViewController.h
    M Source/WebKit/UIProcess/WKImagePreviewViewController.mm
    M Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

  Log Message:
  -----------
  [iOS] Remove use of `-[UIScreen mainScreen]` in `WKImagePreviewViewController`
https://bugs.webkit.org/show_bug.cgi?id=302017
rdar://164101198

Reviewed by Abrar Rahman Protyasha.

`-[UIScreen mainScreen]` was deprecated in iOS 26. Work towards removing its
use in WebKit.

* Source/WebKit/UIProcess/WKImagePreviewViewController.h:
* Source/WebKit/UIProcess/WKImagePreviewViewController.mm:
(-[WKImagePreviewViewController 
initWithCGImage:defaultActions:elementInfo:presentingView:]):

Pass the presenting view to the initializer so that a `UIScreen` can be obtained
from the view's window. Since this view controller is presented as a result of a
context menu interaction, the view must be in the view hierarchy.

The view controller's own view is not used, since it is not in the hierarchy
during initialization. Additionally, `-viewIsAppearing` and `-viewDidAppear`
is too late to set the preferred content size.

(-[WKImagePreviewViewController initWithCGImage:defaultActions:elementInfo:]): 
Deleted.
* Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView assignLegacyDataForContextMenuInteraction]):
(-[WKContentView continueContextMenuInteraction:]):
(-[WKContentView _presentedViewControllerForPreviewItemController:]):

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



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

Reply via email to