Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 1f256daa14a4a51149c3ddba15a6876c40d16487
      
https://github.com/WebKit/WebKit/commit/1f256daa14a4a51149c3ddba15a6876c40d16487
  Author: Chris Dumez <[email protected]>
  Date:   2026-05-08 (Fri, 08 May 2026)

  Changed paths:
    M Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h

  Log Message:
  -----------
  [iOS Simulator] ImageAnalysisTestingUtilities.h:49:61: error: unknown type 
name 'VKImageOrientation'
https://bugs.webkit.org/show_bug.cgi?id=314304

Reviewed by Mike Wyrzykowski and Abrar Rahman Protyasha.

311694@main added a minimal fallback block in VisionKitCoreSPI.h for the
iOS simulator + clang-modules configuration, where <UIKit/UIKit.h> can't
be safely imported: CoreImage -> CoreVideo -> OpenGLES imports C++ modules
from inside an extern "C" block. That fallback declared VKAnalysisTypes
and forward-declared the VK* classes, but it omitted VKImageOrientation,
which is referenced by ImageAnalysisTestingUtilities.h and
ImageAnalysisUtilities.mm:

    Tools/TestWebKitAPI/Helpers/cocoa/ImageAnalysisTestingUtilities.h:49:61:
        error: unknown type name 'VKImageOrientation'

Rather than duplicating the VKImageOrientation NS_ENUM in the fallback
block, restructure VisionKitCoreSPI.h so the existing declarations are
reused:

- Introduce a VK_IMAGE_ANALYSIS_CAN_IMPORT_UIKIT helper macro capturing
  the "safe to import UIKit" condition.
- Drop the top-level "!PLATFORM(IOS_SIMULATOR) || !__has_feature(modules)
  || HAVE(WEBGPU_IOS_SIMULATOR_OPENGL_SUPPORT)" wrapper and the separate
  iOS-simulator+modules stub branch.
- In the non-internal-SDK fallback, guard <UIKit/UIKit.h> with the new
  macro. When UIKit can't be imported, skip the
  typedef UIImage VKImageClass / typedef UIImageOrientation VKImageOrientation
  path and reuse the existing NS_ENUM(NSInteger, VKImageOrientation) that
  was previously Mac-only.
- Similarly, gate the full @interface declarations (which use UIKit types
  like UIMenu / UIViewController / UIInteraction / UIButton) on
  VK_IMAGE_ANALYSIS_CAN_IMPORT_UIKIT || PLATFORM(MAC); otherwise emit
  @class forward declarations. The staging categories and each subsection
  of the ENABLE(IMAGE_ANALYSIS_ENHANCEMENTS) block follow the same
  pattern.

This keeps VisionKit functionality available in all previously-supported
configurations while making VKImageOrientation visible to dependent
headers on iOS simulator + modules, all without a second declaration of
the enum.

* Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h:
Restructure the header to share a single VKImageOrientation NS_ENUM
definition between the Mac fallback and the iOS-simulator+modules
configuration, gating UIKit-dependent declarations behind a new
VK_IMAGE_ANALYSIS_CAN_IMPORT_UIKIT macro.

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



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

Reply via email to