[webkit-changes] [WebKit/WebKit] be619a: [visionOS] Introduce a flag to delegate Image Full...

Etienne Segonzac noreply at github.com
Fri Feb 16 03:59:06 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: be619ad087652b064ffa055bd66568035e58228a
      https://github.com/WebKit/WebKit/commit/be619ad087652b064ffa055bd66568035e58228a
  Author: Etienne Segonzac <sgz at apple.com>
  Date:   2024-02-16 (Fri, 16 Feb 2024)

  Changed paths:
    M Source/WTF/wtf/PlatformEnableCocoa.h
    M Source/WebKit/CMakeLists.txt
    M Source/WebKit/DerivedSources-input.xcfilelist
    M Source/WebKit/DerivedSources.make
    M Source/WebKit/Scripts/webkit/messages.py
    A Source/WebKit/Shared/FullScreenMediaDetails.h
    A Source/WebKit/Shared/FullScreenMediaDetails.serialization.in
    M Source/WebKit/SourcesCocoa.txt
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h
    M Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm
    M Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp
    M Source/WebKit/UIProcess/WebFullScreenManagerProxy.h
    M Source/WebKit/UIProcess/WebFullScreenManagerProxy.messages.in
    M Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm
    M Source/WebKit/WebKit.xcodeproj/project.pbxproj
    A Source/WebKit/WebKitSwift/Preview/PreviewWindowController.swift
    A Source/WebKit/WebKitSwift/Preview/WKSPreviewWindowController.h
    M Source/WebKit/WebKitSwift/WebKitSwift.h
    M Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
    M Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp
    M Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h

  Log Message:
  -----------
  [visionOS] Introduce a flag to delegate Image Fullscreen to Quick Look
https://bugs.webkit.org/show_bug.cgi?id=268826
<rdar://120903017>

Reviewed by Tim Horton.

On visionOS, when fullscreening an image, create a SharedMemory buffer of the cached
image and forward it to Quick Look.

* Source/WebKit/CMakeLists.txt:
* Source/WebKit/DerivedSources-input.xcfilelist:
* Source/WebKit/DerivedSources.make:
* Source/WebKit/Scripts/webkit/messages.py:
(types_that_must_be_moved):
* Source/WebKit/Shared/FullScreenMediaDetails.h: Added.
* Source/WebKit/Shared/FullScreenMediaDetails.serialization.in: Added.
* Source/WebKit/UIProcess/WebFullScreenManagerProxy.messages.in:
* Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.cpp:
(WebKit::InjectedBundlePageFullScreenClient::enterFullScreenForElement):
* Source/WebKit/WebProcess/InjectedBundle/InjectedBundlePageFullScreenClient.h:
Introduce a new serializable FullScreenMediaDetails struct that contains
all the media information needed for visionOS fullscreen.

* Source/WebKit/UIProcess/WebFullScreenManagerProxy.h:
(WebKit::WebFullScreenManagerProxy::isVideoElement const):
(WebKit::WebFullScreenManagerProxy::isImageElement const):
(WebKit::WebFullScreenManagerProxy::imageMIMEType const):
(WebKit::WebFullScreenManagerProxy::imageBuffer const):
* Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::enterFullScreen):
Create a SharedBuffer from the image SharedMemoryHandle.
(WebKit::WebFullScreenManagerProxy::exitFullScreen):
Release the SharedBuffer on exit.
(WebKit::WebFullScreenManagerProxy::isVideoElement const): Deleted.
Moved to the header with other similar methods.

* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
* Source/WebKit/WebKitSwift/WebKitSwift.h:
* Source/WebKit/WebKitSwift/Preview/WKSPreviewWindowController.h: Added.
* Source/WebKit/WebKitSwift/Preview/PreviewWindowController.swift: Added.
(PreviewWindowController.item):
(PreviewWindowController.previewApp):
(PreviewWindowController.delegate):
(PreviewWindowController.presentWindow):
(PreviewWindowController.dismissWindow):
Add a Swift wrapper for the AssetViewer Preview SPI.

* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.h:
* Source/WebKit/UIProcess/Cocoa/WebKitSwiftSoftLink.mm:
Add WKSPreviewWindowController to WebKitSoftLink.
* Source/WebKit/SourcesCocoa.txt:
Mark the WebKitSoftLink with @no-unify.

* Source/WebKit/UIProcess/ios/fullscreen/WKFullScreenWindowControllerIOS.mm:
Soft link libWebKitSwift to access the new WKSPreviewWindowController.
(-[WKFullScreenWindowController _performSpatialFullScreenTransition:completionHandler:]):
(-[WKFullScreenWindowController showUI]):
Launch a Quick Look preview and keep the inWindow faded when Image data
is available.
Always hide the chrome when a Quick Look Preview is displayed.
(-[WKFullScreenWindowController previewWindowControllerDidClose]):
(-[WKFullScreenWindowController provideDataForItem:]):
Adopt the WKSPreviewWindowControllerDelegate and
QLPreviewItemDataProvider protocols.
Create an NSData object from the manager's SharedBuffer to provide the
image to Quick Look.

* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::enterFullScreenForElement):
When the new preference is on, and the fullscreen element is an image,
create a SharedMemory buffer of the cached image and forward it.

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




More information about the webkit-changes mailing list