Introducing Natural Input for WebXR in Apple Vision Pro
Safari 17.4 on visionOS 1.1 adds a `transient-pointer` WebXR input mode, behind a flag, that maps Apple Vision Pro's gaze-and-pinch natural input onto XRInputSources. Each input exists only for the duration of a pinch and fires inputsourceschange, selectstart, select and selectend on the session. Its targetRaySpace starts from the user's gaze and then follows the hand, and its gripSpace tracks the pinch location. When hand tracking is granted, the persistent tracked-pointer hands occupy indices 0 and 1, so frameworks like Three.js that only check those indices miss selections. Objects should be attached to gripSpace rather than targetRaySpace, and the post covers testing in the visionOS Simulator.
Related posts
- Try out your website in the spatial web
WebKit mediumAdeptWebsites generally need no special changes to work in Safari on visionOS, which runs the same WebKit engine. To test and debug them, install the visionOS simulator via Xcode 15 or Xcode 16 beta and attach Safari's Web Inspector on macOS to it, or pair a physical Apple Vision Pro with the Mac using a one-time PIN and inspect pages remotely. Feature flags in visionOS 1.2 let developers preview WebXR and the <model> element ahead of visionOS 2.
- News from WWDC23: WebKit Features in Safari 17 beta
WebKit mediumAdeptSafari 17 beta brings 88 web features. Mac users can add any website to the Dock as a web app: cookies are copied over and web push and badging are supported. The release also adds experimental <model> and WebXR (immersive-vr with hand tracking) for Vision Pro, JPEG XL and HEIC image support, image-set() type arguments, and the power-efficient Managed Media Source API for adaptive streaming. HTML gains the popover attribute and <hr> in <select>, CSS gains @counter-style and expanded font-size-adjust, and each feature comes with code examples showing usage and fallbacks.
- A step into the spatial web: The HTML model element in Apple Vision Pro
WebKit mediumAdeptvisionOS 26 enables the HTML `model` element by default in Safari on Apple Vision Pro, rendering USDZ 3D assets stereoscopically inline within web pages. The API exposes a `ready` Promise for load completion and a `stagemode="orbit"` attribute for built-in pinch-and-drag rotation. It also offers an `entityTransform` property that takes a `DOMMatrix` for custom translate/rotate/scale, plus `boundingBoxCenter`/`boundingBoxExtents` for fitting content. Lighting is controlled via an `environmentmap` attribute pointing to equirectangular HDR/EXR images with an `environmentMapReady` Promise, and animations use a media-like API (`play()`, `pause()`, `currentTime`, `playbackRate`, `autoplay`, `loop`).
- News from WWDC24: WebKit in Safari 18 beta
WebKit mediumAdeptSafari 18 beta ships 48 new web platform features, 18 deprecations and 174 bug fixes across iOS 18, iPadOS 18, visionOS 2 and macOS Sequoia betas. Headline additions include immersive WebXR on visionOS with transient-pointer input and hand tracking, the View Transitions API, CSS Style Queries for custom properties, and currentcolor and system color keywords in Relative Color Syntax. Further additions are display-property transitions, the safe alignment keyword in Flexbox, content-visibility, and unprefixed backdrop-filter. Mac web apps can now open matching links based on their manifest scope and support extensions, and the Fullscreen API on visionOS can present spatial photos and panoramas immersively.
- Introducing spatial CSS: A developer preview
WebKit mediumAdeptSafari on visionOS 27.3 ships a developer preview of the proposed spatial CSS API, which routes 3D scene composition through declarative CSS built around the `<model>` element. `spatial: portal` turns a container into a shared 3D space where child models are moved with true 3D `transform`, snapped together via `position-anchor` and `position-context: anchor` against named empties exported from tools like Blender, and lit with reusable `@environment-map` rules using equirectangular HDR images. `portal-action: orbit` lets users rotate the scene, and `requestVolumetricScene()` pops the portal out into a live-linked volumetric scene in the user's space. Because it is plain CSS, spatial layouts can respond to media queries and be animated or transitioned like any other property. The preview is enabled via the CSS Portals feature flag, and WebKit is asking developers for feedback.