[WebXR] Plane detection support (new feature)
Component: WebCore WebXR | 730d282
LayoutTests/http/wpt/webxr/xrPlane_in_place_update.https.html
WebXR exposes real-world geometry to immersive sessions through feature-gated modules. In WebKit the platform XR device runs in the UIProcess (OpenXR on WPE/GTK) and sends per-frame data to WebContent over IPC, where WebXRSession turns it into DOM objects. The Plane Detection spec requires stable XRPlane identity across frames, lastChangedTime bumped only on polygon, orientation or label changes, detectedPlanes valid only during an active animation frame, and a plane's planeSpace that stops resolving once the plane is removed.
The commit adds XRPlane, XRPlaneSet, XRPlaneOrientation, XRFrame.detectedPlanes and XRSession.initiateRoomCapture(), with planeSpace backed by an internal WebXRPlaneSpace. A new UIProcess OpenXRPlaneDetectionManager polls OpenXR spatial-entity discovery via asynchronous XrFuture handles and maps plane-local coordinates into WebXR's convention; plane data (pose, polygon, orientation, semantic label) is added to PlatformXR.serialization.in. Quaternion helpers are refactored and the fake XR device gains updateWorld and detectedPlanes.
Significance
One commit adds a JS-exposed API, a new UIProcess-to-WebContent IPC payload and a native OpenXR backend handling long-running async futures. XRPlane objects persist across frames and update in place, creating new lifetime and state-sync requirements between the platform layer and the DOM.
Audit directions
Narrow: lifetime and identity in WebXRSession::updateDetectedPlanes, invalidateDetectedPlanes and WebXRPlane::update/invalidate — retain planes and spaces across frame boundaries, session shutdown and initiateRoomCapture promises, and look for stale session pointers. Check that XRPlaneSet's initializeSetLike backing stays consistent with the session's plane map across updates, and that re-entrant forEach callbacks can't observe or mutate a half-updated set; confirm every new accessor enforces the inactive-frame gate. Wider: deserialization in PlatformXR.serialization.in — vertex counts, degenerate or huge polygons, NaN/Inf poses, duplicate IDs, unexpected enum values in toDOMPolygon and toXRPlaneOrientation — and OpenXRPlaneDetectionManager's future polling, destruction while pending, and handle cleanup order in cleanupSessionAndAssociatedResources. Also check isFeaturePermitted/isFeatureSupported for the plane-detection descriptor and other call sites of the deleted non-const Quaternion::accumulate.