Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 8de7eac55bb0942bad22089579f1ad34d375b30c
https://github.com/WebKit/WebKit/commit/8de7eac55bb0942bad22089579f1ad34d375b30c
Author: Sergio Villar Senin <[email protected]>
Date: 2026-01-14 (Wed, 14 Jan 2026)
Changed paths:
M Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp
M Source/WebCore/Modules/webxr/WebXRWebGLLayer.h
Log Message:
-----------
[WebXR] Viewports don't get an initial value until getViewport is called
https://bugs.webkit.org/show_bug.cgi?id=305313
Reviewed by Fujii Hironori.
Base layer viewports used to be initialized only after calling
getViewport(). That's fine from the JS point of view. However if the
WebXR application does not call getViewport() (for example if it does
not want to render anything, or for whatever other reason) then the
viewports won't ever be initialized. That could cause issues with
underlying platforms (like OpenXR) because we'd be asking the compositor
to render a layer with a 0x0 sized viewport.
Other relevant implementations like Blink do also initialize the
viewport before the getViewport() call.
No new tests as this cannot be easily tested. In order to get the
viewport size in JS you have to call getViewport() so the viewports
would get properly initialized. Apart from that we have seen issues
related to that in specific runtimes but others just handle it fine.
* Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp:
(WebCore::m_isCompositionEnabled):
(WebCore::WebXRWebGLLayer::getViewport):
(WebCore::WebXRWebGLLayer::updateViewports):
(WebCore::WebXRWebGLLayer::computeViewports): Deleted.
* Source/WebCore/Modules/webxr/WebXRWebGLLayer.h:
Canonical link: https://commits.webkit.org/305565@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications