Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 7fc2aafa1dce06a3e6d8ff2b3413718b3f4e99f6
https://github.com/WebKit/WebKit/commit/7fc2aafa1dce06a3e6d8ff2b3413718b3f4e99f6
Author: Yoel Hawa <[email protected]>
Date: 2026-10-02 (Fri, 02 Oct 2026)
Changed paths:
M Source/WebCore/Modules/model-element/HTMLModelElement.cpp
M Source/WebCore/Modules/model-element/HTMLModelElement.h
M Source/WebCore/Modules/model-element/SpatialPortalController.cpp
M Source/WebCore/page/EventHandler.h
M Source/WebCore/page/ios/EventHandlerIOS.mm
M Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm
M Source/WebKit/Modules/Internal/module.modulemap
A Source/WebKit/UIProcess/Cocoa/WKPortalVolumetricGestureController.h
A Source/WebKit/UIProcess/Cocoa/WKPortalVolumetricGestureController.swift
M Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.mm
M Source/WebKit/UIProcess/WebPageProxy.cpp
M Source/WebKit/UIProcess/WebPageProxy.h
M Source/WebKit/UIProcess/ios/WKPortalVolumetricSceneController.h
M Source/WebKit/UIProcess/ios/WKPortalVolumetricSceneController.mm
M Source/WebKit/WebKit.xcodeproj/project.pbxproj
M Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm
M Source/WebKit/WebProcess/WebPage/WebPage.cpp
M Source/WebKit/WebProcess/WebPage/WebPage.h
M Source/WebKit/WebProcess/WebPage/WebPage.messages.in
Log Message:
-----------
[visionOS] Add orbit support to connected volumetric scenes
https://bugs.webkit.org/show_bug.cgi?id=324621
<rdar://182292385>
Reviewed by Mike Wyrzykowski.
Content presented in a connected volumetric scene could not be orbited.
The page's pan recognizer hit-tests the flat content view, where a
presented element no longer draws anything, so no drag reached stage
mode.
Capture drags on an input surface inside the volume instead, and route
them into the existing stage mode session. Whether orbit is available in
the volume follows the element's stage mode, exactly as it does inline.
No new tests needed.
* Source/WebCore/Modules/model-element/HTMLModelElement.cpp:
(WebCore::HTMLModelElement::supportsStageModeInteraction const):
* Source/WebCore/Modules/model-element/HTMLModelElement.h:
* Source/WebCore/Modules/model-element/SpatialPortalController.cpp:
(WebCore::SpatialPortalController::interactiveControllerForHitTestedElement):
* Source/WebKit/WebProcess/WebPage/Cocoa/PositionInformationForWebPage.mm:
(WebKit::positionInformationForWebPage):
The element stays interactive while it is in a volume, but its box on the
page is blank, so a hit test over that box must not reach it.
* Source/WebCore/page/EventHandler.h:
* Source/WebCore/page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::requestInteractiveModelElementAtPoint):
(WebCore::EventHandler::stageModeSessionDidBegin):
* Source/WebKit/UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::requestInteractiveModelElementAtPoint):
(WebKit::WebPageProxy::stageModeSessionDidBegin):
* Source/WebKit/UIProcess/WebPageProxy.h:
* Source/WebKit/WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::requestInteractiveModelElementAtPoint):
(WebKit::WebPage::stageModeSessionDidBegin):
* Source/WebKit/WebProcess/WebPage/WebPage.h:
* Source/WebKit/WebProcess/WebPage/WebPage.messages.in:
Inline, the hit test that finds the element also begins the session. Away
from the page the node is already known and there is nothing to hit-test,
so begin takes the node directly.
* Source/WebKit/Modules/Internal/module.modulemap:
* Source/WebKit/UIProcess/Cocoa/WKPortalVolumetricGestureController.h: Copied
from Source/WebKit/UIProcess/ios/WKPortalVolumetricSceneController.h.
* Source/WebKit/UIProcess/Cocoa/WKPortalVolumetricGestureController.swift:
Added.
(WKPortalVolumetricGestureOverlay.body):
(WKPortalVolumetricGestureController.onDragBegan):
(WKPortalVolumetricGestureController.onDragChanged):
(WKPortalVolumetricGestureController.onDragEnded):
(WKPortalVolumetricGestureController.makeHostingController):
(WKPortalVolumetricGestureController.updateProxyExtents(withWidth:height:depth:)):
* Source/WebKit/WebKit.xcodeproj/project.pbxproj:
A volume has no window glass for a pan recognizer to sit on. Capture
drags with an invisible RealityKit entity filling the volume, targeted by
a SwiftUI drag gesture.
* Source/WebKit/UIProcess/Model/PortalPresentationManagerProxy.mm:
(WebKit::stageModeTransformForLocation):
(WebKit::PortalPresentationManagerProxy::showVolumetricScene):
* Source/WebKit/UIProcess/ios/WKPortalVolumetricSceneController.h:
* Source/WebKit/UIProcess/ios/WKPortalVolumetricSceneController.mm:
(-[WKPortalVolumetricSceneController _applyInputSurfaceExtents]):
(-[WKPortalVolumetricSceneController updateLayoutForVolumeSize]):
(-[WKPortalVolumetricSceneController hostContentWithContext:pid:]):
(-[WKPortalVolumetricSceneController
installInputSurfaceWithBegan:changed:ended:]):
(-[WKPortalVolumetricSceneController _removeInputSurface]):
(-[WKPortalVolumetricSceneController dismissWithCompletion:]):
Host that surface in the volumetric window, keep its extent in step with
the volume, and report drag locations in points, the packing stage mode
already uses inline.
* Source/WebKit/ModelProcess/cocoa/ModelProcessModelPlayerProxy.mm:
(WebKit::ModelProcessModelPlayerProxy::setPresentationMode):
Tearing the volume down destroys the input surface without an end event,
so end the session there instead.
Canonical link: https://commits.webkit.org/322564@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications