[WebXR] IDLs, stubs and build configuration for WPE
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2020 15:49:47 +0000 (15:49 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 16 Mar 2020 15:49:47 +0000 (15:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=208702

Reviewed by Dean Jackson.

.:

Added a new compile flag for WEBXR which depends on WEBGL.

For the WPE port, added OpenXR detection and USE_OPENXR define to be
used in the sources. It also adds a dependency between USE_OPENXR and
ENABLE_WEBXR.

Largely based on previous work by Žan Doberšek.

* Source/cmake/FindOpenXR.cmake: Added.
* Source/cmake/OptionsWPE.cmake: Added mandatory OpenXR dependency if
WEBXR is enabled exposing USE_OPENXR to the build.
* Source/cmake/WebKitFeatures.cmake: Added ENABLE_WEBXR.
* Source/cmake/tools/vsprops/FeatureDefines.props: Ditto.
* Source/cmake/tools/vsprops/FeatureDefinesCairo.props: Ditto.

Source/JavaScriptCore:

* Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.

Source/WebCore:

Added the IDLs defined by the spec with very basic empty implementations to get them
built. Apart from that a very basic implementation of the required platform code using
OpenXR API was also added.

No new tests as no new functionality was really added (empty implementations). However
follow up patches will import the already available WPT tests for WebXR.

Largely based on previous work by Žan Doberšek.

* CMakeLists.txt:
* Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
* DerivedSources.make:
* Modules/webxr/NavigatorWebXR.cpp: Added.
(WebCore::NavigatorWebXR::xr):
(WebCore::NavigatorWebXR::from):
* Modules/webxr/NavigatorWebXR.h: Added.
* Modules/webxr/NavigatorWebXR.idl: Added.
* Modules/webxr/WebXRBoundedReferenceSpace.cpp: Added.
(WebCore::WebXRBoundedReferenceSpace::boundsGeometry const):
* Modules/webxr/WebXRBoundedReferenceSpace.h: Added.
* Modules/webxr/WebXRBoundedReferenceSpace.idl: Added.
* Modules/webxr/WebXRFrame.cpp: Added.
(WebCore::WebXRFrame::create):
(WebCore::WebXRFrame::WebXRFrame):
(WebCore::WebXRFrame::session const):
(WebCore::WebXRFrame::getViewerPose):
(WebCore::WebXRFrame::getPose):
* Modules/webxr/WebXRFrame.h: Added.
* Modules/webxr/WebXRFrame.idl: Added.
* Modules/webxr/WebXRInputSource.cpp: Added.
(WebCore::WebXRInputSource::create):
(WebCore::WebXRInputSource::WebXRInputSource):
(WebCore::WebXRInputSource::handedness const):
(WebCore::WebXRInputSource::targetRayMode const):
(WebCore::WebXRInputSource::targetRaySpace const):
(WebCore::WebXRInputSource::gripSpace const):
(WebCore::WebXRInputSource::profiles const):
* Modules/webxr/WebXRInputSource.h: Added.
* Modules/webxr/WebXRInputSource.idl: Added.
* Modules/webxr/WebXRInputSourceArray.cpp: Added.
(WebCore::WebXRInputSourceArray::length const):
(WebCore::WebXRInputSourceArray::item const):
* Modules/webxr/WebXRInputSourceArray.h: Added.
* Modules/webxr/WebXRInputSourceArray.idl: Added.
* Modules/webxr/WebXRPose.cpp: Added.
(WebCore::WebXRPose::create):
(WebCore::WebXRPose::WebXRPose):
(WebCore::WebXRPose::transform const):
(WebCore::WebXRPose::emulatedPosition const):
* Modules/webxr/WebXRPose.h: Added.
* Modules/webxr/WebXRPose.idl: Added.
* Modules/webxr/WebXRReferenceSpace.cpp: Added.
(WebCore::WebXRReferenceSpace::WebXRReferenceSpace):
(WebCore::WebXRReferenceSpace::getOffsetReferenceSpace):
* Modules/webxr/WebXRReferenceSpace.h: Added.
* Modules/webxr/WebXRReferenceSpace.idl: Added.
* Modules/webxr/WebXRRenderState.cpp: Added.
(WebCore::WebXRRenderState::create):
(WebCore::WebXRRenderState::WebXRRenderState):
(WebCore::WebXRRenderState::depthNear const):
(WebCore::WebXRRenderState::depthFar const):
(WebCore::WebXRRenderState::inlineVerticalFieldOfView const):
(WebCore::WebXRRenderState::baseLayer const):
* Modules/webxr/WebXRRenderState.h: Added.
* Modules/webxr/WebXRRenderState.idl: Added.
* Modules/webxr/WebXRRigidTransform.cpp: Added.
(WebCore::WebXRRigidTransform::create):
(WebCore::WebXRRigidTransform::WebXRRigidTransform):
(WebCore::WebXRRigidTransform::position const):
(WebCore::WebXRRigidTransform::orientation const):
(WebCore::WebXRRigidTransform::matrix const):
(WebCore::WebXRRigidTransform::inverse const):
* Modules/webxr/WebXRRigidTransform.h: Added.
* Modules/webxr/WebXRRigidTransform.idl: Added.
* Modules/webxr/WebXRSession.cpp: Added.
(WebCore::WebXRSession::environmentBlendMode const):
(WebCore::WebXRSession::visibilityState const):
(WebCore::WebXRSession::renderState const):
(WebCore::WebXRSession::inputSources const):
(WebCore::WebXRSession::updateRenderState):
(WebCore::WebXRSession::requestReferenceSpace):
(WebCore::WebXRSession::requestAnimationFrame):
(WebCore::WebXRSession::cancelAnimationFrame):
(WebCore::WebXRSession::end):
(WebCore::WebXRSession::activeDOMObjectName const):
(WebCore::WebXRSession::stop):
* Modules/webxr/WebXRSession.h: Added.
* Modules/webxr/WebXRSession.idl: Added.
* Modules/webxr/WebXRSpace.cpp: Added.
(WebCore::WebXRSpace::WebXRSpace):
* Modules/webxr/WebXRSpace.h: Added.
* Modules/webxr/WebXRSpace.idl: Added.
* Modules/webxr/WebXRSystem.cpp: Added.
(WebCore::WebXRSystem::create):
(WebCore::WebXRSystem::WebXRSystem):
(WebCore::WebXRSystem::isSessionSupported):
(WebCore::WebXRSystem::requestSession):
(WebCore::WebXRSystem::activeDOMObjectName const):
(WebCore::WebXRSystem::stop):
* Modules/webxr/WebXRSystem.h: Added.
* Modules/webxr/WebXRSystem.idl: Added.
* Modules/webxr/WebXRView.cpp: Added.
(WebCore::WebXRView::create):
(WebCore::WebXRView::WebXRView):
(WebCore::WebXRView::eye const):
(WebCore::WebXRView::projectionMatrix const):
(WebCore::WebXRView::transform const):
* Modules/webxr/WebXRView.h: Added.
* Modules/webxr/WebXRView.idl: Added.
* Modules/webxr/WebXRViewerPose.cpp: Added.
(WebCore::WebXRViewerPose::create):
(WebCore::WebXRViewerPose::views const):
* Modules/webxr/WebXRViewerPose.h: Added.
* Modules/webxr/WebXRViewerPose.idl: Added.
* Modules/webxr/WebXRViewport.cpp: Added.
(WebCore::WebXRViewport::create):
(WebCore::WebXRViewport::x const):
(WebCore::WebXRViewport::y const):
(WebCore::WebXRViewport::width const):
(WebCore::WebXRViewport::height const):
* Modules/webxr/WebXRViewport.h: Added.
* Modules/webxr/WebXRViewport.idl: Added.
* Modules/webxr/WebXRWebGLLayer.cpp: Added.
(WebCore::WebXRWebGLLayer::create):
(WebCore::WebXRWebGLLayer::WebXRWebGLLayer):
(WebCore::WebXRWebGLLayer::antialias const):
(WebCore::WebXRWebGLLayer::ignoreDepthValues const):
(WebCore::WebXRWebGLLayer::framebuffer const):
(WebCore::WebXRWebGLLayer::framebufferWidth const):
(WebCore::WebXRWebGLLayer::framebufferHeight const):
(WebCore::WebXRWebGLLayer::getViewport):
(WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor):
* Modules/webxr/WebXRWebGLLayer.h: Added.
* Modules/webxr/WebXRWebGLLayer.idl: Added.
* Modules/webxr/XREnvironmentBlendMode.h: Added.
* Modules/webxr/XREnvironmentBlendMode.idl: Added.
* Modules/webxr/XREye.h: Added.
* Modules/webxr/XREye.idl: Added.
* Modules/webxr/XRFrameRequestCallback.h: Added.
* Modules/webxr/XRFrameRequestCallback.idl: Added.
* Modules/webxr/XRHandedness.h: Added.
* Modules/webxr/XRHandedness.idl: Added.
* Modules/webxr/XRInputSourceEvent.cpp: Added.
(WebCore::XRInputSourceEvent::create):
(WebCore::XRInputSourceEvent::XRInputSourceEvent):
(WebCore::XRInputSourceEvent::frame const):
(WebCore::XRInputSourceEvent::inputSource const):
(WebCore::XRInputSourceEvent::buttonIndex const):
* Modules/webxr/XRInputSourceEvent.h: Added.
* Modules/webxr/XRInputSourceEvent.idl: Added.
* Modules/webxr/XRInputSourcesChangeEvent.cpp: Added.
(WebCore::XRInputSourcesChangeEvent::create):
(WebCore::XRInputSourcesChangeEvent::XRInputSourcesChangeEvent):
(WebCore::XRInputSourcesChangeEvent::session const):
(WebCore::XRInputSourcesChangeEvent::added const):
(WebCore::XRInputSourcesChangeEvent::removed const):
* Modules/webxr/XRInputSourcesChangeEvent.h: Added.
* Modules/webxr/XRInputSourcesChangeEvent.idl: Added.
* Modules/webxr/XRReferenceSpaceEvent.cpp: Added.
(WebCore::XRReferenceSpaceEvent::create):
(WebCore::XRReferenceSpaceEvent::XRReferenceSpaceEvent):
(WebCore::XRReferenceSpaceEvent::referenceSpace const):
(WebCore::XRReferenceSpaceEvent::transform const):
* Modules/webxr/XRReferenceSpaceEvent.h: Added.
* Modules/webxr/XRReferenceSpaceEvent.idl: Added.
* Modules/webxr/XRReferenceSpaceType.h: Added.
* Modules/webxr/XRReferenceSpaceType.idl: Added.
* Modules/webxr/XRRenderStateInit.h: Added.
* Modules/webxr/XRRenderStateInit.idl: Added.
* Modules/webxr/XRSessionEvent.cpp: Added.
(WebCore::XRSessionEvent::create):
(WebCore::XRSessionEvent::XRSessionEvent):
(WebCore::XRSessionEvent::session const):
* Modules/webxr/XRSessionEvent.h: Added.
* Modules/webxr/XRSessionEvent.idl: Added.
* Modules/webxr/XRSessionInit.h: Added.
* Modules/webxr/XRSessionInit.idl: Added.
* Modules/webxr/XRSessionMode.h: Added.
* Modules/webxr/XRSessionMode.idl: Added.
* Modules/webxr/XRTargetRayMode.h: Added.
* Modules/webxr/XRTargetRayMode.idl: Added.
* Modules/webxr/XRVisibilityState.h: Added.
* Modules/webxr/XRVisibilityState.idl: Added.
* Modules/webxr/XRWebGLLayerInit.h: Added.
* Modules/webxr/XRWebGLLayerInit.idl: Added.
* PlatformWPE.cmake: Added OpenXR libraries and include paths.
* Sources.txt: Added new cpp files.
* WebCore.xcodeproj/project.pbxproj: Added new files.
* bindings/IDLTypes.h: Added SequenceStorageType.
* bindings/js/JSDOMConvertSequences.h:
* bindings/js/WebCoreBuiltinNames.h:
* dom/EventNames.h:
* dom/EventNames.in: Added WebXR events.
* dom/EventTargetFactory.in: Added WebXR event targets.
* page/RuntimeEnabledFeatures.h: Added new runtime feature for WebXR.
(WebCore::RuntimeEnabledFeatures::setWebXREnabled):
(WebCore::RuntimeEnabledFeatures::webXREnabled const):
* platform/xr/PlatformXR.cpp: Added.
* platform/xr/PlatformXR.h: Added.
* platform/xr/openxr/PlatformXR.cpp: Added.
(PlatformXR::createStructure): Utility function to create OpenXR structs.
(PlatformXR::resultToString): Translates OpenXR error codes to strings.
(PlatformXR::Instance::Impl::Impl):
(PlatformXR::Instance::Impl::~Impl):
(PlatformXR::Instance::singleton):

Source/WebCore/PAL:

* Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.

Source/WebKit:

Added WebXR to the list of experimental features.

* Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
* Shared/WebPreferences.yaml: Added WebXR feature.
* Shared/WebPreferencesDefaultValues.cpp:
(WebKit::defaultWebXREnabled): Set WebXR to off by default unless HAVE_SYSTEM_FEATURE_FLAGS.
* Shared/WebPreferencesDefaultValues.h:
* WebProcess/InjectedBundle/InjectedBundle.cpp:
(WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):

Source/WebKitLegacy/mac:

* Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.

Tools:

* Scripts/webkitperl/FeatureList.pm: Added WebXR.
* TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@258498 268f45cc-cd09-0410-ab3c-d52691b4dbfc

121 files changed:
ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig
Source/WTF/wtf/Platform.h
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/Configurations/FeatureDefines.xcconfig
Source/WebCore/DerivedSources.make
Source/WebCore/Modules/webxr/NavigatorWebXR.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/NavigatorWebXR.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/NavigatorWebXR.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRFrame.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRFrame.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRFrame.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSource.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSource.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSource.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSourceArray.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRInputSourceArray.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRPose.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRPose.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRPose.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRReferenceSpace.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRReferenceSpace.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRReferenceSpace.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRenderState.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRenderState.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRenderState.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRigidTransform.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRigidTransform.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRRigidTransform.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSession.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSession.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSession.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSpace.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSpace.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSpace.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSystem.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSystem.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRSystem.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRView.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRView.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRView.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewerPose.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewerPose.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewerPose.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewport.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewport.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRViewport.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRWebGLLayer.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XREnvironmentBlendMode.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XREnvironmentBlendMode.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XREye.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XREye.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRFrameRequestCallback.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRFrameRequestCallback.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRHandedness.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRHandedness.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourceEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourceEvent.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourceEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRReferenceSpaceType.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRReferenceSpaceType.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRRenderStateInit.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRRenderStateInit.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionEvent.cpp [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionEvent.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionEvent.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionInit.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionInit.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionMode.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRSessionMode.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRTargetRayMode.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRTargetRayMode.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRVisibilityState.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRVisibilityState.idl [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRWebGLLayerInit.h [new file with mode: 0644]
Source/WebCore/Modules/webxr/XRWebGLLayerInit.idl [new file with mode: 0644]
Source/WebCore/PAL/ChangeLog
Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig
Source/WebCore/PlatformWPE.cmake
Source/WebCore/Sources.txt
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/bindings/IDLTypes.h
Source/WebCore/bindings/js/JSDOMConvertSequences.h
Source/WebCore/bindings/js/WebCoreBuiltinNames.h
Source/WebCore/dom/EventNames.h
Source/WebCore/dom/EventNames.in
Source/WebCore/dom/EventTargetFactory.in
Source/WebCore/page/RuntimeEnabledFeatures.h
Source/WebCore/platform/xr/PlatformXR.cpp [new file with mode: 0644]
Source/WebCore/platform/xr/PlatformXR.h [new file with mode: 0644]
Source/WebCore/platform/xr/openxr/PlatformXR.cpp [new file with mode: 0644]
Source/WebKit/ChangeLog
Source/WebKit/Configurations/FeatureDefines.xcconfig
Source/WebKit/Shared/WebPreferences.yaml
Source/WebKit/Shared/WebPreferencesDefaultValues.cpp
Source/WebKit/Shared/WebPreferencesDefaultValues.h
Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp
Source/WebKitLegacy/mac/ChangeLog
Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig
Source/cmake/FindOpenXR.cmake [new file with mode: 0644]
Source/cmake/OptionsWPE.cmake
Source/cmake/WebKitFeatures.cmake
Source/cmake/tools/vsprops/FeatureDefines.props
Source/cmake/tools/vsprops/FeatureDefinesCairo.props
Tools/ChangeLog
Tools/Scripts/webkitperl/FeatureList.pm
Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig

index fa0a12d..a42d69e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,25 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        Added a new compile flag for WEBXR which depends on WEBGL.
+
+        For the WPE port, added OpenXR detection and USE_OPENXR define to be
+        used in the sources. It also adds a dependency between USE_OPENXR and
+        ENABLE_WEBXR.
+
+        Largely based on previous work by Žan Doberšek.
+
+        * Source/cmake/FindOpenXR.cmake: Added.
+        * Source/cmake/OptionsWPE.cmake: Added mandatory OpenXR dependency if
+        WEBXR is enabled exposing USE_OPENXR to the build.
+        * Source/cmake/WebKitFeatures.cmake: Added ENABLE_WEBXR.
+        * Source/cmake/tools/vsprops/FeatureDefines.props: Ditto.
+        * Source/cmake/tools/vsprops/FeatureDefinesCairo.props: Ditto.
+
 2020-03-14  Michael Catanzaro  <mcatanzaro@gnome.org>
 
         [CMake] Warning when ccache is not installed
index c11a293..7455aaf 100644 (file)
@@ -1,3 +1,12 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.
+
 2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         reportZappedCellAndCrash should handle PreciseAllocation in IsoSubspace
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index dedfa14..6802cc8 100644 (file)
 #if (USE_ANGLE && (USE_OPENGL || USE_OPENGL_ES || (defined(USE_EGL) && USE_EGL))) && !USE(TEXTURE_MAPPER)
 #error USE_ANGLE is incompatible with USE_OPENGL, USE_OPENGL_ES and USE_EGL
 #endif
+
 #endif
 
 #if USE(TEXTURE_MAPPER) && ENABLE(GRAPHICS_CONTEXT_GL) && !defined(USE_TEXTURE_MAPPER_GL)
 #if PLATFORM(COCOA) && ENABLE(ACCESSIBILITY)
 #define USE_ACCESSIBILITY_CONTEXT_MENUS 1
 #endif
+
index 2efce0d..1276fce 100644 (file)
@@ -64,6 +64,7 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/Modules/webgpu/WHLSL"
     "${WEBCORE_DIR}/Modules/webgpu/WHLSL/AST"
     "${WEBCORE_DIR}/Modules/websockets"
+    "${WEBCORE_DIR}/Modules/webxr"
     "${WEBCORE_DIR}/accessibility"
     "${WEBCORE_DIR}/accessibility/isolatedtree"
     "${WEBCORE_DIR}/animation"
@@ -141,7 +142,7 @@ set(WebCore_PRIVATE_INCLUDE_DIRECTORIES
     "${WEBCORE_DIR}/platform/network"
     "${WEBCORE_DIR}/platform/sql"
     "${WEBCORE_DIR}/platform/text"
-    "${WEBCORE_DIR}/platform/vr"
+    "${WEBCORE_DIR}/platform/xr"
     "${WEBCORE_DIR}/plugins"
     "${WEBCORE_DIR}/rendering"
     "${WEBCORE_DIR}/rendering/line"
@@ -1179,6 +1180,42 @@ if (ENABLE_GAMEPAD)
     )
 endif ()
 
+if (ENABLE_WEBGL)
+    list(APPEND WebCore_NON_SVG_IDL_FILES
+        Modules/webxr/NavigatorWebXR.idl
+        Modules/webxr/WebXRBoundedReferenceSpace.idl
+        Modules/webxr/WebXRFrame.idl
+        Modules/webxr/WebXRInputSource.idl
+        Modules/webxr/WebXRInputSourceArray.idl
+        Modules/webxr/WebXRPose.idl
+        Modules/webxr/WebXRReferenceSpace.idl
+        Modules/webxr/WebXRRenderState.idl
+        Modules/webxr/WebXRRigidTransform.idl
+        Modules/webxr/WebXRSession.idl
+        Modules/webxr/WebXRSpace.idl
+        Modules/webxr/WebXRSystem.idl
+        Modules/webxr/WebXRView.idl
+        Modules/webxr/WebXRViewerPose.idl
+        Modules/webxr/WebXRViewport.idl
+        Modules/webxr/WebXRWebGLLayer.idl
+        Modules/webxr/XREnvironmentBlendMode.idl
+        Modules/webxr/XREye.idl
+        Modules/webxr/XRFrameRequestCallback.idl
+        Modules/webxr/XRHandedness.idl
+        Modules/webxr/XRInputSourceEvent.idl
+        Modules/webxr/XRInputSourcesChangeEvent.idl
+        Modules/webxr/XRReferenceSpaceEvent.idl
+        Modules/webxr/XRReferenceSpaceType.idl
+        Modules/webxr/XRRenderStateInit.idl
+        Modules/webxr/XRSessionEvent.idl
+        Modules/webxr/XRSessionInit.idl
+        Modules/webxr/XRSessionMode.idl
+        Modules/webxr/XRTargetRayMode.idl
+        Modules/webxr/XRVisibilityState.idl
+        Modules/webxr/XRWebGLLayerInit.idl
+    )
+endif ()
+
 set(WebCore_IDL_FILES
     ${WebCore_NON_SVG_IDL_FILES}
     ${WebCore_SVG_IDL_FILES}
index 79620f1..6c4f161 100644 (file)
@@ -1,3 +1,216 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        Added the IDLs defined by the spec with very basic empty implementations to get them
+        built. Apart from that a very basic implementation of the required platform code using
+        OpenXR API was also added.
+
+        No new tests as no new functionality was really added (empty implementations). However
+        follow up patches will import the already available WPT tests for WebXR.
+
+        Largely based on previous work by Žan Doberšek.
+
+        * CMakeLists.txt:
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
+        * DerivedSources.make:
+        * Modules/webxr/NavigatorWebXR.cpp: Added.
+        (WebCore::NavigatorWebXR::xr):
+        (WebCore::NavigatorWebXR::from):
+        * Modules/webxr/NavigatorWebXR.h: Added.
+        * Modules/webxr/NavigatorWebXR.idl: Added.
+        * Modules/webxr/WebXRBoundedReferenceSpace.cpp: Added.
+        (WebCore::WebXRBoundedReferenceSpace::boundsGeometry const):
+        * Modules/webxr/WebXRBoundedReferenceSpace.h: Added.
+        * Modules/webxr/WebXRBoundedReferenceSpace.idl: Added.
+        * Modules/webxr/WebXRFrame.cpp: Added.
+        (WebCore::WebXRFrame::create):
+        (WebCore::WebXRFrame::WebXRFrame):
+        (WebCore::WebXRFrame::session const):
+        (WebCore::WebXRFrame::getViewerPose):
+        (WebCore::WebXRFrame::getPose):
+        * Modules/webxr/WebXRFrame.h: Added.
+        * Modules/webxr/WebXRFrame.idl: Added.
+        * Modules/webxr/WebXRInputSource.cpp: Added.
+        (WebCore::WebXRInputSource::create):
+        (WebCore::WebXRInputSource::WebXRInputSource):
+        (WebCore::WebXRInputSource::handedness const):
+        (WebCore::WebXRInputSource::targetRayMode const):
+        (WebCore::WebXRInputSource::targetRaySpace const):
+        (WebCore::WebXRInputSource::gripSpace const):
+        (WebCore::WebXRInputSource::profiles const):
+        * Modules/webxr/WebXRInputSource.h: Added.
+        * Modules/webxr/WebXRInputSource.idl: Added.
+        * Modules/webxr/WebXRInputSourceArray.cpp: Added.
+        (WebCore::WebXRInputSourceArray::length const):
+        (WebCore::WebXRInputSourceArray::item const):
+        * Modules/webxr/WebXRInputSourceArray.h: Added.
+        * Modules/webxr/WebXRInputSourceArray.idl: Added.
+        * Modules/webxr/WebXRPose.cpp: Added.
+        (WebCore::WebXRPose::create):
+        (WebCore::WebXRPose::WebXRPose):
+        (WebCore::WebXRPose::transform const):
+        (WebCore::WebXRPose::emulatedPosition const):
+        * Modules/webxr/WebXRPose.h: Added.
+        * Modules/webxr/WebXRPose.idl: Added.
+        * Modules/webxr/WebXRReferenceSpace.cpp: Added.
+        (WebCore::WebXRReferenceSpace::WebXRReferenceSpace):
+        (WebCore::WebXRReferenceSpace::getOffsetReferenceSpace):
+        * Modules/webxr/WebXRReferenceSpace.h: Added.
+        * Modules/webxr/WebXRReferenceSpace.idl: Added.
+        * Modules/webxr/WebXRRenderState.cpp: Added.
+        (WebCore::WebXRRenderState::create):
+        (WebCore::WebXRRenderState::WebXRRenderState):
+        (WebCore::WebXRRenderState::depthNear const):
+        (WebCore::WebXRRenderState::depthFar const):
+        (WebCore::WebXRRenderState::inlineVerticalFieldOfView const):
+        (WebCore::WebXRRenderState::baseLayer const):
+        * Modules/webxr/WebXRRenderState.h: Added.
+        * Modules/webxr/WebXRRenderState.idl: Added.
+        * Modules/webxr/WebXRRigidTransform.cpp: Added.
+        (WebCore::WebXRRigidTransform::create):
+        (WebCore::WebXRRigidTransform::WebXRRigidTransform):
+        (WebCore::WebXRRigidTransform::position const):
+        (WebCore::WebXRRigidTransform::orientation const):
+        (WebCore::WebXRRigidTransform::matrix const):
+        (WebCore::WebXRRigidTransform::inverse const):
+        * Modules/webxr/WebXRRigidTransform.h: Added.
+        * Modules/webxr/WebXRRigidTransform.idl: Added.
+        * Modules/webxr/WebXRSession.cpp: Added.
+        (WebCore::WebXRSession::environmentBlendMode const):
+        (WebCore::WebXRSession::visibilityState const):
+        (WebCore::WebXRSession::renderState const):
+        (WebCore::WebXRSession::inputSources const):
+        (WebCore::WebXRSession::updateRenderState):
+        (WebCore::WebXRSession::requestReferenceSpace):
+        (WebCore::WebXRSession::requestAnimationFrame):
+        (WebCore::WebXRSession::cancelAnimationFrame):
+        (WebCore::WebXRSession::end):
+        (WebCore::WebXRSession::activeDOMObjectName const):
+        (WebCore::WebXRSession::stop):
+        * Modules/webxr/WebXRSession.h: Added.
+        * Modules/webxr/WebXRSession.idl: Added.
+        * Modules/webxr/WebXRSpace.cpp: Added.
+        (WebCore::WebXRSpace::WebXRSpace):
+        * Modules/webxr/WebXRSpace.h: Added.
+        * Modules/webxr/WebXRSpace.idl: Added.
+        * Modules/webxr/WebXRSystem.cpp: Added.
+        (WebCore::WebXRSystem::create):
+        (WebCore::WebXRSystem::WebXRSystem):
+        (WebCore::WebXRSystem::isSessionSupported):
+        (WebCore::WebXRSystem::requestSession):
+        (WebCore::WebXRSystem::activeDOMObjectName const):
+        (WebCore::WebXRSystem::stop):
+        * Modules/webxr/WebXRSystem.h: Added.
+        * Modules/webxr/WebXRSystem.idl: Added.
+        * Modules/webxr/WebXRView.cpp: Added.
+        (WebCore::WebXRView::create):
+        (WebCore::WebXRView::WebXRView):
+        (WebCore::WebXRView::eye const):
+        (WebCore::WebXRView::projectionMatrix const):
+        (WebCore::WebXRView::transform const):
+        * Modules/webxr/WebXRView.h: Added.
+        * Modules/webxr/WebXRView.idl: Added.
+        * Modules/webxr/WebXRViewerPose.cpp: Added.
+        (WebCore::WebXRViewerPose::create):
+        (WebCore::WebXRViewerPose::views const):
+        * Modules/webxr/WebXRViewerPose.h: Added.
+        * Modules/webxr/WebXRViewerPose.idl: Added.
+        * Modules/webxr/WebXRViewport.cpp: Added.
+        (WebCore::WebXRViewport::create):
+        (WebCore::WebXRViewport::x const):
+        (WebCore::WebXRViewport::y const):
+        (WebCore::WebXRViewport::width const):
+        (WebCore::WebXRViewport::height const):
+        * Modules/webxr/WebXRViewport.h: Added.
+        * Modules/webxr/WebXRViewport.idl: Added.
+        * Modules/webxr/WebXRWebGLLayer.cpp: Added.
+        (WebCore::WebXRWebGLLayer::create):
+        (WebCore::WebXRWebGLLayer::WebXRWebGLLayer):
+        (WebCore::WebXRWebGLLayer::antialias const):
+        (WebCore::WebXRWebGLLayer::ignoreDepthValues const):
+        (WebCore::WebXRWebGLLayer::framebuffer const):
+        (WebCore::WebXRWebGLLayer::framebufferWidth const):
+        (WebCore::WebXRWebGLLayer::framebufferHeight const):
+        (WebCore::WebXRWebGLLayer::getViewport):
+        (WebCore::WebXRWebGLLayer::getNativeFramebufferScaleFactor):
+        * Modules/webxr/WebXRWebGLLayer.h: Added.
+        * Modules/webxr/WebXRWebGLLayer.idl: Added.
+        * Modules/webxr/XREnvironmentBlendMode.h: Added.
+        * Modules/webxr/XREnvironmentBlendMode.idl: Added.
+        * Modules/webxr/XREye.h: Added.
+        * Modules/webxr/XREye.idl: Added.
+        * Modules/webxr/XRFrameRequestCallback.h: Added.
+        * Modules/webxr/XRFrameRequestCallback.idl: Added.
+        * Modules/webxr/XRHandedness.h: Added.
+        * Modules/webxr/XRHandedness.idl: Added.
+        * Modules/webxr/XRInputSourceEvent.cpp: Added.
+        (WebCore::XRInputSourceEvent::create):
+        (WebCore::XRInputSourceEvent::XRInputSourceEvent):
+        (WebCore::XRInputSourceEvent::frame const):
+        (WebCore::XRInputSourceEvent::inputSource const):
+        (WebCore::XRInputSourceEvent::buttonIndex const):
+        * Modules/webxr/XRInputSourceEvent.h: Added.
+        * Modules/webxr/XRInputSourceEvent.idl: Added.
+        * Modules/webxr/XRInputSourcesChangeEvent.cpp: Added.
+        (WebCore::XRInputSourcesChangeEvent::create):
+        (WebCore::XRInputSourcesChangeEvent::XRInputSourcesChangeEvent):
+        (WebCore::XRInputSourcesChangeEvent::session const):
+        (WebCore::XRInputSourcesChangeEvent::added const):
+        (WebCore::XRInputSourcesChangeEvent::removed const):
+        * Modules/webxr/XRInputSourcesChangeEvent.h: Added.
+        * Modules/webxr/XRInputSourcesChangeEvent.idl: Added.
+        * Modules/webxr/XRReferenceSpaceEvent.cpp: Added.
+        (WebCore::XRReferenceSpaceEvent::create):
+        (WebCore::XRReferenceSpaceEvent::XRReferenceSpaceEvent):
+        (WebCore::XRReferenceSpaceEvent::referenceSpace const):
+        (WebCore::XRReferenceSpaceEvent::transform const):
+        * Modules/webxr/XRReferenceSpaceEvent.h: Added.
+        * Modules/webxr/XRReferenceSpaceEvent.idl: Added.
+        * Modules/webxr/XRReferenceSpaceType.h: Added.
+        * Modules/webxr/XRReferenceSpaceType.idl: Added.
+        * Modules/webxr/XRRenderStateInit.h: Added.
+        * Modules/webxr/XRRenderStateInit.idl: Added.
+        * Modules/webxr/XRSessionEvent.cpp: Added.
+        (WebCore::XRSessionEvent::create):
+        (WebCore::XRSessionEvent::XRSessionEvent):
+        (WebCore::XRSessionEvent::session const):
+        * Modules/webxr/XRSessionEvent.h: Added.
+        * Modules/webxr/XRSessionEvent.idl: Added.
+        * Modules/webxr/XRSessionInit.h: Added.
+        * Modules/webxr/XRSessionInit.idl: Added.
+        * Modules/webxr/XRSessionMode.h: Added.
+        * Modules/webxr/XRSessionMode.idl: Added.
+        * Modules/webxr/XRTargetRayMode.h: Added.
+        * Modules/webxr/XRTargetRayMode.idl: Added.
+        * Modules/webxr/XRVisibilityState.h: Added.
+        * Modules/webxr/XRVisibilityState.idl: Added.
+        * Modules/webxr/XRWebGLLayerInit.h: Added.
+        * Modules/webxr/XRWebGLLayerInit.idl: Added.
+        * PlatformWPE.cmake: Added OpenXR libraries and include paths.
+        * Sources.txt: Added new cpp files.
+        * WebCore.xcodeproj/project.pbxproj: Added new files.
+        * bindings/IDLTypes.h: Added SequenceStorageType.
+        * bindings/js/JSDOMConvertSequences.h:
+        * bindings/js/WebCoreBuiltinNames.h:
+        * dom/EventNames.h:
+        * dom/EventNames.in: Added WebXR events.
+        * dom/EventTargetFactory.in: Added WebXR event targets.
+        * page/RuntimeEnabledFeatures.h: Added new runtime feature for WebXR.
+        (WebCore::RuntimeEnabledFeatures::setWebXREnabled):
+        (WebCore::RuntimeEnabledFeatures::webXREnabled const):
+        * platform/xr/PlatformXR.cpp: Added.
+        * platform/xr/PlatformXR.h: Added.
+        * platform/xr/openxr/PlatformXR.cpp: Added.
+        (PlatformXR::createStructure): Utility function to create OpenXR structs.
+        (PlatformXR::resultToString): Translates OpenXR error codes to strings.
+        (PlatformXR::Instance::Impl::Impl):
+        (PlatformXR::Instance::Impl::~Impl):
+        (PlatformXR::Instance::singleton):
+
 2020-03-16  Zan Dobersek  <zdobersek@igalia.com>
 
         [Cairo] Path copy constructor and operator must also copy over CTM
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 4d9edaf..4e92568 100644 (file)
@@ -64,6 +64,7 @@ VPATH = \
     $(WebCore)/Modules/webdriver \
     $(WebCore)/Modules/webgpu \
     $(WebCore)/Modules/websockets \
+    $(WebCore)/Modules/webxr \
     $(WebCore)/accessibility \
     $(WebCore)/animation \
     $(WebCore)/bindings/js \
@@ -460,6 +461,37 @@ JS_BINDING_IDLS = \
     $(WebCore)/Modules/webgpu/WorkerNavigatorGPU.idl \
     $(WebCore)/Modules/websockets/CloseEvent.idl \
     $(WebCore)/Modules/websockets/WebSocket.idl \
+    $(WebCore)/Modules/webxr/NavigatorWebXR.idl \
+    $(WebCore)/Modules/webxr/WebXRBoundedReferenceSpace.idl \
+    $(WebCore)/Modules/webxr/WebXRFrame.idl \
+    $(WebCore)/Modules/webxr/WebXRInputSourceArray.idl \
+    $(WebCore)/Modules/webxr/WebXRInputSource.idl \
+    $(WebCore)/Modules/webxr/WebXRPose.idl \
+    $(WebCore)/Modules/webxr/WebXRReferenceSpace.idl \
+    $(WebCore)/Modules/webxr/WebXRRenderState.idl \
+    $(WebCore)/Modules/webxr/WebXRRigidTransform.idl \
+    $(WebCore)/Modules/webxr/WebXRSession.idl \
+    $(WebCore)/Modules/webxr/WebXRSpace.idl \
+    $(WebCore)/Modules/webxr/WebXRSystem.idl \
+    $(WebCore)/Modules/webxr/WebXRViewerPose.idl \
+    $(WebCore)/Modules/webxr/WebXRView.idl \
+    $(WebCore)/Modules/webxr/WebXRViewport.idl \
+    $(WebCore)/Modules/webxr/WebXRWebGLLayer.idl \
+    $(WebCore)/Modules/webxr/XREnvironmentBlendMode.idl \
+    $(WebCore)/Modules/webxr/XREye.idl \
+    $(WebCore)/Modules/webxr/XRFrameRequestCallback.idl \
+    $(WebCore)/Modules/webxr/XRHandedness.idl \
+    $(WebCore)/Modules/webxr/XRInputSourceEvent.idl \
+    $(WebCore)/Modules/webxr/XRInputSourcesChangeEvent.idl \
+    $(WebCore)/Modules/webxr/XRReferenceSpaceEvent.idl \
+    $(WebCore)/Modules/webxr/XRReferenceSpaceType.idl \
+    $(WebCore)/Modules/webxr/XRRenderStateInit.idl \
+    $(WebCore)/Modules/webxr/XRSessionEvent.idl \
+    $(WebCore)/Modules/webxr/XRSessionInit.idl \
+    $(WebCore)/Modules/webxr/XRSessionMode.idl \
+    $(WebCore)/Modules/webxr/XRTargetRayMode.idl \
+    $(WebCore)/Modules/webxr/XRVisibilityState.idl \
+    $(WebCore)/Modules/webxr/XRWebGLLayerInit.idl \
     $(WebCore)/accessibility/AccessibilityRole.idl \
     $(WebCore)/accessibility/AriaAttributes.idl \
     $(WebCore)/animation/Animatable.idl \
diff --git a/Source/WebCore/Modules/webxr/NavigatorWebXR.cpp b/Source/WebCore/Modules/webxr/NavigatorWebXR.cpp
new file mode 100644 (file)
index 0000000..06a4c5d
--- /dev/null
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "NavigatorWebXR.h"
+
+#if ENABLE(WEBXR)
+
+#include "Navigator.h"
+#include "WebXRSystem.h"
+
+namespace WebCore {
+
+WebXRSystem& NavigatorWebXR::xr(ScriptExecutionContext& scriptExecutionContext, Navigator& navigatorObject)
+{
+    auto& navigator = NavigatorWebXR::from(navigatorObject);
+    if (!navigator.m_xr)
+        navigator.m_xr = WebXRSystem::create(scriptExecutionContext);
+    return *navigator.m_xr;
+}
+
+NavigatorWebXR& NavigatorWebXR::from(Navigator& navigator)
+{
+    auto* supplement = static_cast<NavigatorWebXR*>(Supplement<Navigator>::from(&navigator, "NavigatorWebXR"));
+    if (!supplement) {
+        auto newSupplement = makeUnique<NavigatorWebXR>();
+        supplement = newSupplement.get();
+        provideTo(&navigator, "NavigatorWebXR", WTFMove(newSupplement));
+    }
+    return *supplement;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/NavigatorWebXR.h b/Source/WebCore/Modules/webxr/NavigatorWebXR.h
new file mode 100644 (file)
index 0000000..ff34e4e
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "Supplementable.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class Navigator;
+class ScriptExecutionContext;
+class WebXRSystem;
+
+class NavigatorWebXR final : public Supplement<Navigator> {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static WebXRSystem& xr(ScriptExecutionContext&, Navigator&);
+
+private:
+    static NavigatorWebXR& from(Navigator&);
+
+    RefPtr<WebXRSystem> m_xr;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/NavigatorWebXR.idl b/Source/WebCore/Modules/webxr/NavigatorWebXR.idl
new file mode 100644 (file)
index 0000000..d9bbf5d
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] partial interface Navigator {
+    [SecureContext, SameObject, CallWith=ScriptExecutionContext] readonly attribute WebXRSystem xr;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.cpp b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.cpp
new file mode 100644 (file)
index 0000000..8bdeda3
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRBoundedReferenceSpace.h"
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+const Vector<Ref<DOMPointReadOnly>>& WebXRBoundedReferenceSpace::boundsGeometry() const
+{
+    return m_boundsGeometry;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h
new file mode 100644 (file)
index 0000000..9b3b74f
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#include "WebXRReferenceSpace.h"
+#include <wtf/Ref.h>
+#include <wtf/Vector.h>
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+class DOMPointReadOnly;
+
+class WebXRBoundedReferenceSpace : public WebXRReferenceSpace {
+public:
+    virtual ~WebXRBoundedReferenceSpace();
+
+    const Vector<Ref<DOMPointReadOnly>>& boundsGeometry() const;
+
+private:
+    Vector<Ref<DOMPointReadOnly>> m_boundsGeometry;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.idl b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.idl
new file mode 100644 (file)
index 0000000..d5b8833
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    InterfaceName=XRBoundedReferenceSpace
+] interface WebXRBoundedReferenceSpace : WebXRReferenceSpace {
+    readonly attribute FrozenArray<DOMPointReadOnly> boundsGeometry;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRFrame.cpp b/Source/WebCore/Modules/webxr/WebXRFrame.cpp
new file mode 100644 (file)
index 0000000..935dc12
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRFrame.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRSession.h"
+#include "WebXRViewerPose.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRFrame);
+
+Ref<WebXRFrame> WebXRFrame::create(Ref<WebXRSession>&& session)
+{
+    return adoptRef(*new WebXRFrame(WTFMove(session)));
+}
+
+WebXRFrame::WebXRFrame(Ref<WebXRSession>&& session)
+    : m_session(WTFMove(session))
+{
+}
+
+WebXRFrame::~WebXRFrame() = default;
+
+const WebXRSession& WebXRFrame::session() const
+{
+    return m_session;
+}
+
+RefPtr<WebXRViewerPose> WebXRFrame::getViewerPose(const WebXRReferenceSpace&)
+{
+    return { };
+}
+
+RefPtr<WebXRPose> WebXRFrame::getPose(const WebXRSpace&, const WebXRSpace&)
+{
+    return { };
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRFrame.h b/Source/WebCore/Modules/webxr/WebXRFrame.h
new file mode 100644 (file)
index 0000000..808a676
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebXRPose;
+class WebXRReferenceSpace;
+class WebXRSession;
+class WebXRSpace;
+class WebXRViewerPose;
+
+class WebXRFrame : public RefCounted<WebXRFrame> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRFrame);
+public:
+    static Ref<WebXRFrame> create(Ref<WebXRSession>&&);
+    ~WebXRFrame();
+
+    const WebXRSession& session() const;
+
+    RefPtr<WebXRViewerPose> getViewerPose(const WebXRReferenceSpace&);
+    RefPtr<WebXRPose> getPose(const WebXRSpace&, const WebXRSpace&);
+
+private:
+    WebXRFrame(Ref<WebXRSession>&&);
+
+    Ref<WebXRSession> m_session;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRFrame.idl b/Source/WebCore/Modules/webxr/WebXRFrame.idl
new file mode 100644 (file)
index 0000000..21fcf3c
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRFrame
+] interface WebXRFrame {
+    [SameObject] readonly attribute WebXRSession session;
+
+    WebXRViewerPose? getViewerPose(WebXRReferenceSpace referenceSpace);
+    WebXRPose? getPose(WebXRSpace space, WebXRSpace baseSpace);
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSource.cpp b/Source/WebCore/Modules/webxr/WebXRInputSource.cpp
new file mode 100644 (file)
index 0000000..f307675
--- /dev/null
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRInputSource.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRSpace.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRInputSource);
+
+Ref<WebXRInputSource> WebXRInputSource::create(Ref<WebXRSpace>&& targetRaySpace)
+{
+    return adoptRef(*new WebXRInputSource(WTFMove(targetRaySpace)));
+}
+
+WebXRInputSource::WebXRInputSource(Ref<WebXRSpace>&& targetRaySpace)
+    : m_handedness(XRHandedness::None)
+    , m_targetRayMode(XRTargetRayMode::Gaze)
+    , m_targetRaySpace(WTFMove(targetRaySpace))
+{
+}
+
+WebXRInputSource::~WebXRInputSource() = default;
+
+XRHandedness WebXRInputSource::handedness() const
+{
+    return m_handedness;
+}
+
+XRTargetRayMode WebXRInputSource::targetRayMode() const
+{
+    return m_targetRayMode;
+}
+
+const WebXRSpace& WebXRInputSource::targetRaySpace() const
+{
+    return m_targetRaySpace;
+}
+
+RefPtr<WebXRSpace> WebXRInputSource::gripSpace() const
+{
+    return { };
+}
+
+const Vector<String>& WebXRInputSource::profiles() const
+{
+    return m_profiles;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSource.h b/Source/WebCore/Modules/webxr/WebXRInputSource.h
new file mode 100644 (file)
index 0000000..68c29ab
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "XRHandedness.h"
+#include "XRTargetRayMode.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class WebXRSpace;
+
+class WebXRInputSource : public RefCounted<WebXRInputSource> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRInputSource);
+public:
+    static Ref<WebXRInputSource> create(Ref<WebXRSpace>&&);
+    ~WebXRInputSource();
+
+    XRHandedness handedness() const;
+    XRTargetRayMode targetRayMode() const;
+    const WebXRSpace& targetRaySpace() const;
+    RefPtr<WebXRSpace> gripSpace() const;
+    const Vector<String>& profiles() const;
+
+private:
+    WebXRInputSource(Ref<WebXRSpace>&&);
+
+    XRHandedness m_handedness;
+    XRTargetRayMode m_targetRayMode;
+    Ref<WebXRSpace> m_targetRaySpace;
+    Vector<String> m_profiles;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSource.idl b/Source/WebCore/Modules/webxr/WebXRInputSource.idl
new file mode 100644 (file)
index 0000000..0459f3f
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRInputSource
+] interface WebXRInputSource {
+    readonly attribute XRHandedness handedness;
+    readonly attribute XRTargetRayMode targetRayMode ;
+    [SameObject] readonly attribute WebXRSpace targetRaySpace;
+    [SameObject] readonly attribute WebXRSpace? gripSpace ;
+    [SameObject] readonly attribute FrozenArray<DOMString> profiles;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp
new file mode 100644 (file)
index 0000000..c4c0855
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRInputSourceArray.h"
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRInputSourceArray);
+
+unsigned WebXRInputSourceArray::length() const
+{
+    return 0;
+}
+
+WebXRInputSource* WebXRInputSourceArray::item(unsigned) const
+{
+    return nullptr;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
+
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSourceArray.h b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.h
new file mode 100644 (file)
index 0000000..f421f02
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebXRInputSource;
+
+class WebXRInputSourceArray : public RefCounted<WebXRInputSourceArray> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRInputSourceArray);
+public:
+    unsigned length() const;
+    WebXRInputSource* item(unsigned) const;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRInputSourceArray.idl b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.idl
new file mode 100644 (file)
index 0000000..fcad84a
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRInputSourceArray
+] interface WebXRInputSourceArray {
+    iterable<WebXRInputSource>;
+    readonly attribute unsigned long length;
+    getter WebXRInputSource(unsigned long index);
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRPose.cpp b/Source/WebCore/Modules/webxr/WebXRPose.cpp
new file mode 100644 (file)
index 0000000..1c5f80a
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRPose.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRRigidTransform.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRPose);
+
+Ref<WebXRPose> WebXRPose::create()
+{
+    return adoptRef(*new WebXRPose);
+}
+
+WebXRPose::WebXRPose()
+    : m_transform(WebXRRigidTransform::create())
+{
+}
+
+WebXRPose::~WebXRPose() = default;
+
+const WebXRRigidTransform& WebXRPose::transform() const
+{
+    return m_transform;
+}
+
+bool WebXRPose::emulatedPosition() const
+{
+    return m_emulatedPosition;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRPose.h b/Source/WebCore/Modules/webxr/WebXRPose.h
new file mode 100644 (file)
index 0000000..29919d2
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebXRRigidTransform;
+
+class WebXRPose : public RefCounted<WebXRPose> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRPose);
+public:
+    static Ref<WebXRPose> create();
+    ~WebXRPose();
+
+    const WebXRRigidTransform& transform() const;
+    bool emulatedPosition() const;
+
+protected:
+    WebXRPose();
+
+    Ref<WebXRRigidTransform> m_transform;
+    bool m_emulatedPosition { false };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRPose.idl b/Source/WebCore/Modules/webxr/WebXRPose.idl
new file mode 100644 (file)
index 0000000..4c4e9da
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRPose
+] interface WebXRPose {
+    [SameObject] readonly attribute WebXRRigidTransform transform;
+    readonly attribute boolean emulatedPosition;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRReferenceSpace.cpp b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.cpp
new file mode 100644 (file)
index 0000000..b33bf70
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRReferenceSpace.h"
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+WebXRReferenceSpace::WebXRReferenceSpace(ScriptExecutionContext& context)
+    : WebXRSpace(context)
+{
+}
+
+WebXRReferenceSpace::~WebXRReferenceSpace() = default;
+
+Ref<WebXRReferenceSpace> WebXRReferenceSpace::getOffsetReferenceSpace(const WebXRRigidTransform&)
+{
+    return adoptRef(*new WebXRReferenceSpace(*scriptExecutionContext()));
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRReferenceSpace.h b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.h
new file mode 100644 (file)
index 0000000..26bb48c
--- /dev/null
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "WebXRSpace.h"
+
+#include <wtf/Ref.h>
+
+namespace WebCore {
+
+class WebXRRigidTransform;
+
+class WebXRReferenceSpace : public WebXRSpace {
+public:
+    virtual ~WebXRReferenceSpace();
+
+    Ref<WebXRReferenceSpace> getOffsetReferenceSpace(const WebXRRigidTransform&);
+
+private:
+    WebXRReferenceSpace(ScriptExecutionContext&);
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRReferenceSpace.idl b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.idl
new file mode 100644 (file)
index 0000000..283507f
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    JSGenerateToJSObject,
+    JSGenerateToNativeObject,
+    InterfaceName=XRReferenceSpace
+] interface WebXRReferenceSpace : WebXRSpace {
+    [NewObject] WebXRReferenceSpace getOffsetReferenceSpace(WebXRRigidTransform originOffset);
+
+    attribute EventHandler onreset;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRRenderState.cpp b/Source/WebCore/Modules/webxr/WebXRRenderState.cpp
new file mode 100644 (file)
index 0000000..06789f8
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRRenderState.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRWebGLLayer.h"
+#include "XRRenderStateInit.h"
+#include <wtf/IsoMallocInlines.h>
+#include <wtf/MathExtras.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRRenderState);
+
+Ref<WebXRRenderState> WebXRRenderState::create(const WebXRSession& session)
+{
+    // When an XRRenderState object is created for an XRSession session, the user agent MUST initialize the render state by running the following steps:
+    //   1. Let state be the newly created XRRenderState object.
+
+    //   2. Initialize state’s depthNear to 0.1.
+    //   3. Initialize state’s depthFar to 1000.0.
+    // (Default-initialized in the XRRenderState class definition.)
+
+    //   4. If session is an immersive session, initialize state’s inlineVerticalFieldOfView to null.
+    //   5. Else initialize state’s inlineVerticalFieldOfView to PI * 0.5.
+    // FIXME: "immersive session" support
+    UNUSED_PARAM(session);
+    Optional<double> inlineVerticalFieldOfView { piOverTwoDouble };
+
+    //   6. Initialize state’s baseLayer to null.
+    //   7. Initialize state’s outputContext to null.
+    // (Initialized to null by default.)
+
+    return adoptRef(*new WebXRRenderState(WTFMove(inlineVerticalFieldOfView)));
+}
+
+WebXRRenderState::WebXRRenderState(Optional<double>&& inlineVerticalFieldOfView)
+    : m_inlineVerticalFieldOfView(WTFMove(inlineVerticalFieldOfView))
+{
+}
+
+WebXRRenderState::WebXRRenderState(const XRRenderStateInit&)
+{
+}
+
+WebXRRenderState::~WebXRRenderState() = default;
+
+double WebXRRenderState::depthNear() const
+{
+    return m_depth.near;
+}
+
+double WebXRRenderState::depthFar() const
+{
+    return m_depth.far;
+}
+
+Optional<double> WebXRRenderState::inlineVerticalFieldOfView() const
+{
+    return m_inlineVerticalFieldOfView;
+}
+
+RefPtr<WebXRWebGLLayer> WebXRRenderState::baseLayer() const
+{
+    return m_baseLayer;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRRenderState.h b/Source/WebCore/Modules/webxr/WebXRRenderState.h
new file mode 100644 (file)
index 0000000..3f292ac
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/Optional.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebXRWebGLLayer;
+struct XRRenderStateInit;
+class WebXRSession;
+
+class WebXRRenderState : public RefCounted<WebXRRenderState> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRRenderState);
+public:
+    static Ref<WebXRRenderState> create(const WebXRSession&);
+    ~WebXRRenderState();
+
+    double depthNear() const;
+    double depthFar() const;
+    Optional<double> inlineVerticalFieldOfView() const;
+    RefPtr<WebXRWebGLLayer> baseLayer() const;
+
+private:
+    WebXRRenderState(Optional<double>&&);
+    WebXRRenderState(const XRRenderStateInit&);
+
+    struct {
+        double near { 0.1 };
+        double far { 1000 };
+    } m_depth;
+    Optional<double> m_inlineVerticalFieldOfView;
+    RefPtr<WebXRWebGLLayer> m_baseLayer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRRenderState.idl b/Source/WebCore/Modules/webxr/WebXRRenderState.idl
new file mode 100644 (file)
index 0000000..ae1ace6
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRRenderState
+] interface WebXRRenderState {
+    readonly attribute double depthNear;
+    readonly attribute double depthFar;
+    readonly attribute double? inlineVerticalFieldOfView;
+    readonly attribute WebXRWebGLLayer? baseLayer;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRRigidTransform.cpp b/Source/WebCore/Modules/webxr/WebXRRigidTransform.cpp
new file mode 100644 (file)
index 0000000..d3fdcfb
--- /dev/null
@@ -0,0 +1,114 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRRigidTransform.h"
+
+#if ENABLE(WEBXR)
+
+#include "DOMPointReadOnly.h"
+#include "TransformationMatrix.h"
+#include <JavaScriptCore/TypedArrayInlines.h>
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRRigidTransform);
+
+Ref<WebXRRigidTransform> WebXRRigidTransform::create()
+{
+    return adoptRef(*new WebXRRigidTransform({ }, { }));
+}
+
+ExceptionOr<Ref<WebXRRigidTransform>> WebXRRigidTransform::create(const DOMPointInit& position, const DOMPointInit& orientation)
+{
+    // The XRRigidTransform(position, orientation) constructor MUST perform the following steps when invoked:
+    //   1. Let transform be a new XRRigidTransform.
+
+    //   2. If position is not a DOMPointInit initialize transform’s position to { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }.
+    //   3. If position’s w value is not 1.0, throw a TypeError.
+    //   4. Else initialize transform’s position’s x value to position’s x dictionary member, y value to position’s y dictionary member, z value to position’s z dictionary member and w to 1.0.
+    if (position.w != 1.0)
+        return Exception { TypeError };
+    DOMPointInit positionInit { position.x, position.y, position.z, 1 };
+
+    //   5. If orientation is not a DOMPointInit initialize transform’s orientation to { x: 0.0, y: 0.0, z: 0.0, w: 1.0 }.
+    //   6. Else initialize transform’s orientation’s x value to orientation’s x dictionary member, y value to orientation’s y dictionary member, z value to orientation’s z dictionary member and w value to orientation’s w dictionary member.
+    //   7. Normalize x, y, z, and w components of transform’s orientation.
+    DOMPointInit orientationInit { orientation.x, orientation.y, orientation.z, orientation.w };
+    {
+        double length = std::sqrt(orientationInit.x * orientationInit.x + orientationInit.y * orientationInit.y
+            + orientationInit.z * orientationInit.z + orientationInit.w * orientationInit.w);
+        if (WTF::areEssentiallyEqual<double>(length, 0))
+            return Exception { InvalidStateError };
+
+        orientationInit= {
+            orientationInit.x / length, orientationInit.y / length,
+            orientationInit.z / length, orientationInit.w / length,
+        };
+    }
+
+    //   8. Return transform.
+    return adoptRef(*new WebXRRigidTransform(positionInit, orientationInit));
+}
+
+WebXRRigidTransform::WebXRRigidTransform(const DOMPointInit& position, const DOMPointInit& orientation)
+    : m_position(DOMPointReadOnly::create(position))
+    , m_orientation(DOMPointReadOnly::create(orientation))
+{
+    // FIXME: implement properly, per spec.
+    TransformationMatrix matrix;
+    auto matrixData = matrix.toColumnMajorFloatArray();
+    m_matrix = Float32Array::create(matrixData.data(), matrixData.size());
+}
+
+WebXRRigidTransform::~WebXRRigidTransform() = default;
+
+const DOMPointReadOnly& WebXRRigidTransform::position() const
+{
+    return m_position;
+}
+
+const DOMPointReadOnly& WebXRRigidTransform::orientation() const
+{
+    return m_orientation;
+}
+
+Ref<Float32Array>  WebXRRigidTransform::matrix() const
+{
+    auto matrix = Float32Array::create(16);
+    matrix->zeroFill();
+    return matrix;
+}
+
+Ref<WebXRRigidTransform> WebXRRigidTransform::inverse() const
+{
+    // FIXME: implement properly.
+    return WebXRRigidTransform::create();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRRigidTransform.h b/Source/WebCore/Modules/webxr/WebXRRigidTransform.h
new file mode 100644 (file)
index 0000000..2f7cc1e
--- /dev/null
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ExceptionOr.h"
+#include <JavaScriptCore/Float32Array.h>
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+struct DOMPointInit;
+class DOMPointReadOnly;
+
+class WebXRRigidTransform : public RefCounted<WebXRRigidTransform> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRRigidTransform);
+public:
+    static Ref<WebXRRigidTransform> create();
+    static ExceptionOr<Ref<WebXRRigidTransform>> create(const DOMPointInit&, const DOMPointInit&);
+    ~WebXRRigidTransform();
+
+    const DOMPointReadOnly& position() const;
+    const DOMPointReadOnly& orientation() const;
+    Ref<Float32Array> matrix() const;
+    Ref<WebXRRigidTransform> inverse() const;
+
+private:
+    WebXRRigidTransform(const DOMPointInit&, const DOMPointInit&);
+
+    Ref<DOMPointReadOnly> m_position;
+    Ref<DOMPointReadOnly> m_orientation;
+    RefPtr<Float32Array> m_matrix;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRRigidTransform.idl b/Source/WebCore/Modules/webxr/WebXRRigidTransform.idl
new file mode 100644 (file)
index 0000000..e00cad7
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(optional DOMPointInit position, optional DOMPointInit orientation),
+    ConstructorMayThrowException,
+    ImplementationLacksVTable,
+    InterfaceName=XRRigidTransform
+] interface WebXRRigidTransform {
+    [SameObject] readonly attribute DOMPointReadOnly position;
+    [SameObject] readonly attribute DOMPointReadOnly orientation;
+    readonly attribute Float32Array matrix;
+    [SameObject] readonly attribute WebXRRigidTransform inverse;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRSession.cpp b/Source/WebCore/Modules/webxr/WebXRSession.cpp
new file mode 100644 (file)
index 0000000..ed3562f
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRSession.h"
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRSession);
+
+WebXRSession::~WebXRSession() = default;
+
+XREnvironmentBlendMode WebXRSession::environmentBlendMode() const
+{
+    return m_environmentBlendMode;
+}
+
+XRVisibilityState WebXRSession::visibilityState() const
+{
+    return m_visibilityState;
+}
+
+const WebXRRenderState& WebXRSession::renderState() const
+{
+    return *m_renderState;
+}
+
+const WebXRInputSourceArray& WebXRSession::inputSources() const
+{
+    return *m_inputSources;
+}
+
+void WebXRSession::updateRenderState(const XRRenderStateInit&)
+{
+}
+
+void WebXRSession::requestReferenceSpace(const XRReferenceSpaceType&, RequestReferenceSpacePromise&&)
+{
+}
+
+int WebXRSession::requestAnimationFrame(Ref<XRFrameRequestCallback>&&)
+{
+    return 0;
+}
+
+void WebXRSession::cancelAnimationFrame(int)
+{
+}
+
+void WebXRSession::end(EndPromise&&)
+{
+}
+
+const char* WebXRSession::activeDOMObjectName() const
+{
+    return "XRSession";
+}
+
+void WebXRSession::stop()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSession.h b/Source/WebCore/Modules/webxr/WebXRSession.h
new file mode 100644 (file)
index 0000000..78c21ca
--- /dev/null
@@ -0,0 +1,96 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include "JSDOMPromiseDeferred.h"
+#include "WebXRInputSourceArray.h"
+#include "WebXRRenderState.h"
+#include "WebXRSpace.h"
+#include "XREnvironmentBlendMode.h"
+#include "XRReferenceSpaceType.h"
+#include "XRVisibilityState.h"
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class XRFrameRequestCallback;
+class WebXRReferenceSpace;
+struct XRRenderStateInit;
+
+class WebXRSession final : public RefCounted<WebXRSession>, public EventTargetWithInlineData, public ActiveDOMObject {
+    WTF_MAKE_ISO_ALLOCATED(WebXRSession);
+public:
+    using RequestReferenceSpacePromise = DOMPromiseDeferred<IDLInterface<WebXRReferenceSpace>>;
+    using EndPromise = DOMPromiseDeferred<void>;
+
+    virtual ~WebXRSession();
+
+    using RefCounted<WebXRSession>::ref;
+    using RefCounted<WebXRSession>::deref;
+
+    XREnvironmentBlendMode environmentBlendMode() const;
+    XRVisibilityState visibilityState() const;
+    const WebXRRenderState& renderState() const;
+    const WebXRInputSourceArray& inputSources() const;
+
+    void updateRenderState(const XRRenderStateInit&);
+    void requestReferenceSpace(const XRReferenceSpaceType&, RequestReferenceSpacePromise&&);
+
+    int requestAnimationFrame(Ref<XRFrameRequestCallback>&&);
+    void cancelAnimationFrame(int handle);
+
+    void end(EndPromise&&);
+
+    bool ended() const { return m_ended; }
+
+protected:
+    // EventTarget
+    EventTargetInterface eventTargetInterface() const override { return WebXRSessionEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
+
+    // ActiveDOMObject
+    const char* activeDOMObjectName() const override;
+    void stop() override;
+
+    XREnvironmentBlendMode m_environmentBlendMode;
+    XRVisibilityState m_visibilityState;
+    RefPtr<WebXRRenderState> m_renderState;
+    RefPtr<WebXRInputSourceArray> m_inputSources;
+    bool m_ended { false };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSession.idl b/Source/WebCore/Modules/webxr/WebXRSession.idl
new file mode 100644 (file)
index 0000000..f9b4307
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    ActiveDOMObject,
+    SecureContext,
+    Exposed=Window,
+    InterfaceName=XRSession
+] interface WebXRSession : EventTarget {
+    // Attributes
+    readonly attribute XREnvironmentBlendMode environmentBlendMode;
+    readonly attribute XRVisibilityState visibilityState;
+    [SameObject] readonly attribute WebXRRenderState renderState;
+    [SameObject] readonly attribute WebXRInputSourceArray inputSources;
+
+    // Methods
+    void updateRenderState(optional XRRenderStateInit stateInit);
+    [NewObject] Promise<WebXRReferenceSpace> requestReferenceSpace(XRReferenceSpaceType type);
+
+    long requestAnimationFrame(XRFrameRequestCallback callback);
+    void cancelAnimationFrame(long handle);
+
+    Promise<void> end();
+
+    // Events
+    attribute EventHandler onend;
+    attribute EventHandler onselect;
+    attribute EventHandler oninputsourceschange;
+    attribute EventHandler onselectstart;
+    attribute EventHandler onselectend;
+    attribute EventHandler onvisibilitychange;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRSpace.cpp b/Source/WebCore/Modules/webxr/WebXRSpace.cpp
new file mode 100644 (file)
index 0000000..a555dfe
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRSpace.h"
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRSpace);
+
+WebXRSpace::WebXRSpace(ScriptExecutionContext& context)
+    : ContextDestructionObserver(&context)
+{
+}
+
+WebXRSpace::~WebXRSpace() = default;
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSpace.h b/Source/WebCore/Modules/webxr/WebXRSpace.h
new file mode 100644 (file)
index 0000000..2b4a8a4
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ContextDestructionObserver.h"
+#include "EventTarget.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class ScriptExecutionContext;
+
+class WebXRSpace : public RefCounted<WebXRSpace>, public EventTargetWithInlineData, public ContextDestructionObserver {
+    WTF_MAKE_ISO_ALLOCATED(WebXRSpace);
+public:
+    virtual ~WebXRSpace();
+
+    using RefCounted<WebXRSpace>::ref;
+    using RefCounted<WebXRSpace>::deref;
+
+protected:
+    WebXRSpace(ScriptExecutionContext&);
+
+    // EventTarget
+    ScriptExecutionContext* scriptExecutionContext() const override { return ContextDestructionObserver::scriptExecutionContext(); }
+
+private:
+    // EventTarget
+    EventTargetInterface eventTargetInterface() const override { return WebXRSpaceEventTargetInterfaceType; }
+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSpace.idl b/Source/WebCore/Modules/webxr/WebXRSpace.idl
new file mode 100644 (file)
index 0000000..bb794f1
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    InterfaceName=XRSpace
+] interface WebXRSpace : EventTarget {
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRSystem.cpp b/Source/WebCore/Modules/webxr/WebXRSystem.cpp
new file mode 100644 (file)
index 0000000..3ac4d52
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRSystem.h"
+
+#if ENABLE(WEBXR)
+
+#include "PlatformXR.h"
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRSystem);
+
+Ref<WebXRSystem> WebXRSystem::create(ScriptExecutionContext& scriptExecutionContext)
+{
+    return adoptRef(*new WebXRSystem(scriptExecutionContext));
+}
+
+WebXRSystem::WebXRSystem(ScriptExecutionContext& scriptExecutionContext)
+    : ActiveDOMObject(&scriptExecutionContext)
+{
+}
+
+WebXRSystem::~WebXRSystem() = default;
+
+void WebXRSystem::isSessionSupported(XRSessionMode, IsSessionSupportedPromise&&)
+{
+    // When the supportsSession(mode) method is invoked, it MUST return a new Promise promise and run the following steps in parallel:
+    //   1. Ensure an XR device is selected.
+    //   2. If the XR device is null, reject promise with a "NotSupportedError" DOMException and abort these steps.
+    //   3. If the XR device's list of supported modes does not contain mode, reject promise with a "NotSupportedError" DOMException and abort these steps.
+    //   4. Else resolve promise.
+}
+
+void WebXRSystem::requestSession(XRSessionMode, const XRSessionInit&, RequestSessionPromise&&)
+{
+    PlatformXR::Instance::singleton();
+
+    // When the requestSession(mode) method is invoked, the user agent MUST return a new Promise promise and run the following steps in parallel:
+    //   1. Let immersive be true if mode is "immersive-vr" or "immersive-ar", and false otherwise.
+    //   2. If immersive is true:
+    //     1. If pending immersive session is true or active immersive session is not null, reject promise with an "InvalidStateError" DOMException and abort these steps.
+    //     2. Else set pending immersive session to be true.
+    //   3. Ensure an XR device is selected.
+    //   4. If the XR device is null, reject promise with null.
+    //   5. Else if the XR device's list of supported modes does not contain mode, reject promise with a "NotSupportedError" DOMException.
+    //   6. Else If immersive is true and the algorithm is not triggered by user activation, reject promise with a "SecurityError" DOMException and abort these steps.
+    //   7. If promise was rejected and immersive is true, set pending immersive session to false.
+    //   8. If promise was rejected, abort these steps.
+    //   9. Let session be a new XRSession object.
+    //   10. Initialize the session with session and mode.
+    //   11. If immersive is true, set the active immersive session to session, and set pending immersive session to false.
+    //   12. Else append session to the list of inline sessions.
+    //   13. Resolve promise with session.
+}
+
+const char* WebXRSystem::activeDOMObjectName() const
+{
+    return "XRSystem";
+}
+
+void WebXRSystem::stop()
+{
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSystem.h b/Source/WebCore/Modules/webxr/WebXRSystem.h
new file mode 100644 (file)
index 0000000..e9ab15d
--- /dev/null
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ActiveDOMObject.h"
+#include "EventTarget.h"
+#include "JSDOMPromiseDeferred.h"
+#include "XRSessionMode.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class ScriptExecutionContext;
+class WebXRSession;
+struct XRSessionInit;
+
+class WebXRSystem final : public RefCounted<WebXRSystem>, public EventTargetWithInlineData, public ActiveDOMObject {
+    WTF_MAKE_ISO_ALLOCATED(WebXRSystem);
+public:
+    using IsSessionSupportedPromise = DOMPromiseDeferred<IDLBoolean>;
+    using RequestSessionPromise = DOMPromiseDeferred<IDLInterface<WebXRSession>>;
+
+    static Ref<WebXRSystem> create(ScriptExecutionContext&);
+    virtual ~WebXRSystem();
+
+    using RefCounted<WebXRSystem>::ref;
+    using RefCounted<WebXRSystem>::deref;
+
+    void isSessionSupported(XRSessionMode, IsSessionSupportedPromise&&);
+    void requestSession(XRSessionMode, const XRSessionInit&, RequestSessionPromise&&);
+
+protected:
+    WebXRSystem(ScriptExecutionContext&);
+
+    // EventTarget
+    EventTargetInterface eventTargetInterface() const override { return WebXRSystemEventTargetInterfaceType; }
+    ScriptExecutionContext* scriptExecutionContext() const override { return ActiveDOMObject::scriptExecutionContext(); }
+    void refEventTarget() override { ref(); }
+    void derefEventTarget() override { deref(); }
+
+    // ActiveDOMObject
+    const char* activeDOMObjectName() const override;
+    void stop() override;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRSystem.idl b/Source/WebCore/Modules/webxr/WebXRSystem.idl
new file mode 100644 (file)
index 0000000..38a760c
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    ActiveDOMObject,
+    SecureContext,
+    Exposed=Window,
+    InterfaceName=XRSystem
+] interface WebXRSystem : EventTarget {
+    // Methods
+    Promise<void> isSessionSupported(XRSessionMode mode);
+    [NewObject] Promise<WebXRSession> requestSession(XRSessionMode mode, optional XRSessionInit options);
+
+    // Events
+    attribute EventHandler ondevicechange;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRView.cpp b/Source/WebCore/Modules/webxr/WebXRView.cpp
new file mode 100644 (file)
index 0000000..24403b7
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRView.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRRigidTransform.h"
+#include <JavaScriptCore/TypedArrayInlines.h>
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRView);
+
+Ref<WebXRView> WebXRView::create()
+{
+    return adoptRef(*new WebXRView);
+}
+
+WebXRView::WebXRView()
+    : m_eye(XREye::Left)
+    , m_projectionMatrix(Float32Array::create(0))
+    , m_transform(WebXRRigidTransform::create())
+{
+}
+
+WebXRView::~WebXRView() = default;
+
+XREye WebXRView::eye() const
+{
+    return m_eye;
+}
+
+const Float32Array& WebXRView::projectionMatrix() const
+{
+    return m_projectionMatrix;
+}
+
+const WebXRRigidTransform& WebXRView::transform() const
+{
+    return m_transform;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRView.h b/Source/WebCore/Modules/webxr/WebXRView.h
new file mode 100644 (file)
index 0000000..f3580c6
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "XREye.h"
+#include <JavaScriptCore/Float32Array.h>
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebXRRigidTransform;
+
+class WebXRView : public RefCounted<WebXRView> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRView);
+public:
+    static Ref<WebXRView> create();
+    ~WebXRView();
+
+    XREye eye() const;
+    const Float32Array& projectionMatrix() const;
+    const WebXRRigidTransform& transform() const;
+
+private:
+    WebXRView();
+
+    XREye m_eye;
+    Ref<Float32Array> m_projectionMatrix;
+    Ref<WebXRRigidTransform> m_transform;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRView.idl b/Source/WebCore/Modules/webxr/WebXRView.idl
new file mode 100644 (file)
index 0000000..d25f429
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRView
+] interface WebXRView {
+    readonly attribute XREye eye;
+    readonly attribute Float32Array projectionMatrix;
+    [SameObject] readonly attribute WebXRRigidTransform transform;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRViewerPose.cpp b/Source/WebCore/Modules/webxr/WebXRViewerPose.cpp
new file mode 100644 (file)
index 0000000..6063c95
--- /dev/null
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRViewerPose.h"
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+Ref<WebXRViewerPose> WebXRViewerPose::create()
+{
+    return adoptRef(*new WebXRViewerPose);
+}
+
+WebXRViewerPose::WebXRViewerPose() = default;
+WebXRViewerPose::~WebXRViewerPose() = default;
+
+const Vector<Ref<WebXRView>>& WebXRViewerPose::views() const
+{
+    return m_views;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRViewerPose.h b/Source/WebCore/Modules/webxr/WebXRViewerPose.h
new file mode 100644 (file)
index 0000000..a4ed25b
--- /dev/null
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "WebXRPose.h"
+#include "WebXRView.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class WebXRViewerPose : public WebXRPose {
+public:
+    static Ref<WebXRViewerPose> create();
+    ~WebXRViewerPose();
+
+    const Vector<Ref<WebXRView>>& views() const;
+
+private:
+    WebXRViewerPose();
+
+    Vector<Ref<WebXRView>> m_views;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRViewerPose.idl b/Source/WebCore/Modules/webxr/WebXRViewerPose.idl
new file mode 100644 (file)
index 0000000..d1beb2c
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRViewerPose
+] interface WebXRViewerPose : WebXRPose {
+    [SameObject] readonly attribute FrozenArray<WebXRView> views;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRViewport.cpp b/Source/WebCore/Modules/webxr/WebXRViewport.cpp
new file mode 100644 (file)
index 0000000..cbaa3c8
--- /dev/null
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRViewport.h"
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMallocInlines.h>
+
+namespace WebCore {
+
+WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRViewport);
+
+Ref<WebXRViewport> WebXRViewport::create()
+{
+    return adoptRef(*new WebXRViewport);
+}
+
+WebXRViewport::WebXRViewport() = default;
+
+int WebXRViewport::x() const
+{
+    return 0;
+}
+
+int WebXRViewport::y() const
+{
+    return 0;
+}
+
+int WebXRViewport::width() const
+{
+    return 0;
+}
+
+int WebXRViewport::height() const
+{
+    return 0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRViewport.h b/Source/WebCore/Modules/webxr/WebXRViewport.h
new file mode 100644 (file)
index 0000000..2f8246a
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebXRViewport : public RefCounted<WebXRViewport> {
+    WTF_MAKE_ISO_ALLOCATED(WebXRViewport);
+public:
+    static Ref<WebXRViewport> create();
+
+    int x() const;
+    int y() const;
+    int width() const;
+    int height() const;
+
+private:
+    WebXRViewport();
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRViewport.idl b/Source/WebCore/Modules/webxr/WebXRViewport.idl
new file mode 100644 (file)
index 0000000..99b51ec
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    ImplementationLacksVTable,
+    InterfaceName=XRViewport
+] interface WebXRViewport {
+    readonly attribute long x;
+    readonly attribute long y;
+    readonly attribute long width;
+    readonly attribute long height;
+};
diff --git a/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp
new file mode 100644 (file)
index 0000000..9a78e8b
--- /dev/null
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebXRWebGLLayer.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebGLFramebuffer.h"
+#include "WebGLRenderingContext.h"
+#if ENABLE(WEBGL2)
+#include "WebGL2RenderingContext.h"
+#endif
+#include "WebXRSession.h"
+#include "WebXRViewport.h"
+#include "XRWebGLLayerInit.h"
+
+namespace WebCore {
+
+ExceptionOr<Ref<WebXRWebGLLayer>> WebXRWebGLLayer::create(const WebXRSession& session, WebXRRenderingContext&& context, const XRWebGLLayerInit& init)
+{
+    // The XRWebGLLayer(session, context, layerInit) constructor MUST perform the following steps when invoked:
+    //   1. Let layer be a new XRWebGLLayer
+
+    //   2. If session’s ended value is true, throw an InvalidStateError and abort these steps.
+    if (session.ended())
+        return Exception { InvalidStateError };
+
+    //   3. If context is lost, throw an InvalidStateError and abort these steps.
+    //   4. If context’s XR compatible boolean is false, throw an InvalidStateError and abort these steps.
+    // FIXME: TODO
+
+    //   5. Initialize layer’s context to context.
+    //   6. Initialize layer’s antialias to layerInit’s antialias value.
+    //   7. If layerInit’s ignoreDepthValues value is false and the XR Compositor will make use of depth values, Initialize layer’s ignoreDepthValues to false.
+    //   8. Else Initialize layer’s ignoreDepthValues to true
+    //   9. Initialize layer’s framebuffer to a new opaque framebuffer created with context.
+    //   10. Initialize the layer’s swap chain.
+    //   11. If layer’s swap chain was unable to be created for any reason, throw an OperationError and abort these steps.
+    // FIXME: TODO
+
+    //   12. Return layer.
+    return adoptRef(*new WebXRWebGLLayer(session, WTFMove(context), init));
+}
+
+WebXRWebGLLayer::WebXRWebGLLayer(const WebXRSession&, WebXRRenderingContext&& context, const XRWebGLLayerInit& init)
+    : m_context(WTFMove(context))
+    , m_antialias(init.antialias)
+    , m_ignoreDepthValues(init.ignoreDepthValues)
+{
+    m_framebuffer.object = WTF::switchOn(m_context,
+        [](const RefPtr<WebGLRenderingContext>& context)
+        {
+            RefPtr<WebGLFramebuffer> frameBuffer = WebGLFramebuffer::create(*context);
+            return frameBuffer;
+        },
+#if ENABLE(WEBGL2)
+        [](const RefPtr<WebGL2RenderingContext>& context)
+        {
+            RefPtr<WebGLFramebuffer> frameBuffer = WebGLFramebuffer::create(*context);
+            return frameBuffer;
+        },
+#endif
+        [](WTF::Monostate) {
+            ASSERT_NOT_REACHED();
+            return nullptr;
+        }
+    );
+}
+
+WebXRWebGLLayer::~WebXRWebGLLayer() = default;
+
+bool WebXRWebGLLayer::antialias() const
+{
+    return m_antialias;
+}
+
+bool WebXRWebGLLayer::ignoreDepthValues() const
+{
+    return m_ignoreDepthValues;
+}
+
+const WebGLFramebuffer& WebXRWebGLLayer::framebuffer() const
+{
+    return *m_framebuffer.object;
+}
+
+unsigned WebXRWebGLLayer::framebufferWidth() const
+{
+    return m_framebuffer.width;
+}
+
+unsigned WebXRWebGLLayer::framebufferHeight() const
+{
+    return m_framebuffer.height;
+}
+
+RefPtr<WebXRViewport> WebXRWebGLLayer::getViewport(const WebXRView&)
+{
+    return { };
+}
+
+double WebXRWebGLLayer::getNativeFramebufferScaleFactor(const WebXRSession&)
+{
+    return 1.0;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h
new file mode 100644 (file)
index 0000000..52d0483
--- /dev/null
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ExceptionOr.h"
+#include <wtf/IsoMalloc.h>
+#include <wtf/Ref.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RefPtr.h>
+#include <wtf/Variant.h>
+
+namespace WebCore {
+
+class WebGLFramebuffer;
+class WebGLRenderingContext;
+#if ENABLE(WEBGL2)
+class WebGL2RenderingContext;
+#endif
+class WebXRSession;
+class WebXRView;
+class WebXRViewport;
+struct XRWebGLLayerInit;
+
+class WebXRWebGLLayer : public RefCounted<WebXRWebGLLayer> {
+public:
+    
+    using WebXRRenderingContext = WTF::Variant<
+        RefPtr<WebGLRenderingContext>,
+#if ENABLE(WEBGL2)
+        RefPtr<WebGL2RenderingContext>
+#else
+        WTF::Monostate
+#endif
+    >;
+
+    static ExceptionOr<Ref<WebXRWebGLLayer>> create(const WebXRSession&, WebXRRenderingContext&&, const XRWebGLLayerInit&);
+    ~WebXRWebGLLayer();
+
+    bool antialias() const;
+    bool ignoreDepthValues() const;
+
+    const WebGLFramebuffer& framebuffer() const;
+    unsigned framebufferWidth() const;
+    unsigned framebufferHeight() const;
+
+    RefPtr<WebXRViewport> getViewport(const WebXRView&);
+
+    static double getNativeFramebufferScaleFactor(const WebXRSession&);
+
+private:
+    WebXRWebGLLayer(const WebXRSession&, WebXRRenderingContext&&, const XRWebGLLayerInit&);
+
+    WebXRRenderingContext m_context;
+    bool m_antialias { false };
+    bool m_ignoreDepthValues { false };
+
+    struct {
+        RefPtr<WebGLFramebuffer> object;
+        unsigned width { 0 };
+        unsigned height { 0 };
+    } m_framebuffer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl
new file mode 100644 (file)
index 0000000..08bad37
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef (WebGLRenderingContext or WebGL2RenderingContext) WebXRWebGLRenderingContext;
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(WebXRSession session, WebXRWebGLRenderingContext context, optional XRWebGLLayerInit layerInit),
+    ConstructorMayThrowException,
+    ImplementationLacksVTable,
+    InterfaceName=XRWebGLLayer
+] interface WebXRWebGLLayer {
+    // Attributes
+    readonly attribute boolean antialias;
+    readonly attribute boolean ignoreDepthValues;
+
+    [SameObject] readonly attribute WebGLFramebuffer framebuffer;
+    readonly attribute unsigned long framebufferWidth;
+    readonly attribute unsigned long framebufferHeight;
+
+    // Methods
+    WebXRViewport? getViewport(WebXRView view);
+
+    // Static Methods
+    static double getNativeFramebufferScaleFactor(WebXRSession session);
+};
diff --git a/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.h b/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.h
new file mode 100644 (file)
index 0000000..66f4072
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XREnvironmentBlendMode {
+    Opaque,
+    Additive,
+    AlphaBlend
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.idl b/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.idl
new file mode 100644 (file)
index 0000000..eefa088
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XREnvironmentBlendMode {
+    "opaque",
+    "additive",
+    "alpha-blend"
+};
diff --git a/Source/WebCore/Modules/webxr/XREye.h b/Source/WebCore/Modules/webxr/XREye.h
new file mode 100644 (file)
index 0000000..ea1ea7e
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XREye {
+    None,
+    Left,
+    Right,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XREye.idl b/Source/WebCore/Modules/webxr/XREye.idl
new file mode 100644 (file)
index 0000000..9ad1e43
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XREye {
+    "none",
+    "left",
+    "right"
+};
diff --git a/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h b/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h
new file mode 100644 (file)
index 0000000..1850497
--- /dev/null
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "ActiveDOMCallback.h"
+#include "CallbackResult.h"
+#include <wtf/RefCounted.h>
+
+namespace WebCore {
+
+class WebXRFrame;
+
+class XRFrameRequestCallback : public RefCounted<XRFrameRequestCallback>, public ActiveDOMCallback {
+public:
+    using ActiveDOMCallback::ActiveDOMCallback;
+
+    virtual CallbackResult<void> handleEvent(double highResTimeMs, WebXRFrame&) = 0;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRFrameRequestCallback.idl b/Source/WebCore/Modules/webxr/XRFrameRequestCallback.idl
new file mode 100644 (file)
index 0000000..a6b151a
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+typedef double DOMHighResTimeStamp;
+
+[
+    Conditional=WEBXR
+] callback XRFrameRequestCallback = void (DOMHighResTimeStamp time, WebXRFrame frame);
diff --git a/Source/WebCore/Modules/webxr/XRHandedness.h b/Source/WebCore/Modules/webxr/XRHandedness.h
new file mode 100644 (file)
index 0000000..9333034
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XRHandedness {
+    None,
+    Left,
+    Right,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRHandedness.idl b/Source/WebCore/Modules/webxr/XRHandedness.idl
new file mode 100644 (file)
index 0000000..53f705a
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XRHandedness {
+    "none",
+    "left",
+    "right"
+};
diff --git a/Source/WebCore/Modules/webxr/XRInputSourceEvent.cpp b/Source/WebCore/Modules/webxr/XRInputSourceEvent.cpp
new file mode 100644 (file)
index 0000000..22631ab
--- /dev/null
@@ -0,0 +1,70 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "XRInputSourceEvent.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRFrame.h"
+#include "WebXRInputSource.h"
+
+namespace WebCore {
+
+Ref<XRInputSourceEvent> XRInputSourceEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+{
+    return adoptRef(*new XRInputSourceEvent(type, initializer, isTrusted));
+}
+
+XRInputSourceEvent::XRInputSourceEvent(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+    , m_frame(initializer.frame)
+    , m_inputSource(initializer.inputSource)
+    , m_buttonIndex(initializer.buttonIndex)
+{
+    ASSERT(m_frame);
+    ASSERT(m_inputSource);
+}
+
+XRInputSourceEvent::~XRInputSourceEvent() = default;
+
+const WebXRFrame& XRInputSourceEvent::frame() const
+{
+    return *m_frame;
+}
+
+const WebXRInputSource& XRInputSourceEvent::inputSource() const
+{
+    return *m_inputSource;
+}
+
+Optional<int> XRInputSourceEvent::buttonIndex() const
+{
+    return m_buttonIndex;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRInputSourceEvent.h b/Source/WebCore/Modules/webxr/XRInputSourceEvent.h
new file mode 100644 (file)
index 0000000..8c7fc04
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "Event.h"
+#include <wtf/Optional.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebXRFrame;
+class WebXRInputSource;
+
+class XRInputSourceEvent final : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<WebXRFrame> frame;
+        RefPtr<WebXRInputSource> inputSource;
+        Optional<int> buttonIndex;
+    };
+
+    static Ref<XRInputSourceEvent> create(const AtomString&, const Init&, IsTrusted = IsTrusted::No);
+    virtual ~XRInputSourceEvent();
+
+    const WebXRFrame& frame() const;
+    const WebXRInputSource& inputSource() const;
+    Optional<int> buttonIndex() const;
+
+private:
+    XRInputSourceEvent(const AtomString&, const Init&, IsTrusted);
+
+    RefPtr<WebXRFrame> m_frame;
+    RefPtr<WebXRInputSource> m_inputSource;
+    Optional<int> m_buttonIndex;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRInputSourceEvent.idl b/Source/WebCore/Modules/webxr/XRInputSourceEvent.idl
new file mode 100644 (file)
index 0000000..9b48a60
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRInputSourceEventInit : EventInit {
+    required WebXRFrame frame;
+    required WebXRInputSource inputSource;
+};
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(DOMString type, XRInputSourceEventInit eventInitDict),
+] interface XRInputSourceEvent : Event {
+    [SameObject] readonly attribute WebXRFrame frame;
+    [SameObject] readonly attribute WebXRInputSource inputSource;
+};
diff --git a/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp
new file mode 100644 (file)
index 0000000..709c22f
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "XRInputSourcesChangeEvent.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRInputSource.h"
+#include "WebXRSession.h"
+
+namespace WebCore {
+
+Ref<XRInputSourcesChangeEvent> XRInputSourcesChangeEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+{
+    return adoptRef(*new XRInputSourcesChangeEvent(type, initializer, isTrusted));
+}
+
+XRInputSourcesChangeEvent::XRInputSourcesChangeEvent(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+    , m_session(*initializer.session)
+    , m_added(initializer.added)
+    , m_removed(initializer.removed)
+{
+}
+
+XRInputSourcesChangeEvent::~XRInputSourcesChangeEvent() = default;
+
+const WebXRSession& XRInputSourcesChangeEvent::session() const
+{
+    return m_session;
+}
+
+const Vector<RefPtr<WebXRInputSource>>& XRInputSourcesChangeEvent::added() const
+{
+    return m_added;
+}
+
+const Vector<RefPtr<WebXRInputSource>>& XRInputSourcesChangeEvent::removed() const
+{
+    return m_removed;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h
new file mode 100644 (file)
index 0000000..2e4ecc7
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "Event.h"
+#include <wtf/Ref.h>
+#include <wtf/Vector.h>
+
+namespace WebCore {
+
+class WebXRInputSource;
+class WebXRSession;
+
+class XRInputSourcesChangeEvent final : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<WebXRSession> session;
+        Vector<RefPtr<WebXRInputSource>> added;
+        Vector<RefPtr<WebXRInputSource>> removed;
+    };
+
+    static Ref<XRInputSourcesChangeEvent> create(const AtomString&, const Init&, IsTrusted = IsTrusted::No);
+    virtual ~XRInputSourcesChangeEvent();
+
+    const WebXRSession& session() const;
+    const Vector<RefPtr<WebXRInputSource>>& added() const;
+    const Vector<RefPtr<WebXRInputSource>>& removed() const;
+
+private:
+    XRInputSourcesChangeEvent(const AtomString&, const Init&, IsTrusted);
+
+    Ref<WebXRSession> m_session;
+    Vector<RefPtr<WebXRInputSource>> m_added;
+    Vector<RefPtr<WebXRInputSource>> m_removed;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.idl b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.idl
new file mode 100644 (file)
index 0000000..68a4659
--- /dev/null
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRInputSourcesChangeEventInit : EventInit {
+    required WebXRSession session;
+    required FrozenArray<WebXRInputSource> added;
+    required FrozenArray<WebXRInputSource> removed;
+};
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(DOMString type, XRInputSourcesChangeEventInit eventInitDict),
+] interface XRInputSourcesChangeEvent : Event {
+    [SameObject] readonly attribute WebXRSession session;
+    [SameObject] readonly attribute FrozenArray<WebXRInputSource> added;
+    [SameObject] readonly attribute FrozenArray<WebXRInputSource> removed;
+};
diff --git a/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.cpp b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.cpp
new file mode 100644 (file)
index 0000000..f7899b3
--- /dev/null
@@ -0,0 +1,64 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "XRReferenceSpaceEvent.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRReferenceSpace.h"
+#include "WebXRRigidTransform.h"
+
+namespace WebCore {
+
+Ref<XRReferenceSpaceEvent> XRReferenceSpaceEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+{
+    return adoptRef(*new XRReferenceSpaceEvent(type, initializer, isTrusted));
+}
+
+XRReferenceSpaceEvent::XRReferenceSpaceEvent(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+    , m_referenceSpace(initializer.referenceSpace)
+    , m_transform(initializer.transform)
+{
+    ASSERT(m_referenceSpace);
+    ASSERT(m_transform);
+}
+
+XRReferenceSpaceEvent::~XRReferenceSpaceEvent() = default;
+
+const WebXRReferenceSpace& XRReferenceSpaceEvent::referenceSpace() const
+{
+    return *m_referenceSpace;
+}
+
+const WebXRRigidTransform& XRReferenceSpaceEvent::transform() const
+{
+    return *m_transform;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.h b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.h
new file mode 100644 (file)
index 0000000..ac520a7
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "Event.h"
+#include <wtf/Ref.h>
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+class WebXRReferenceSpace;
+class WebXRRigidTransform;
+
+class XRReferenceSpaceEvent : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<WebXRReferenceSpace> referenceSpace;
+        RefPtr<WebXRRigidTransform> transform;
+    };
+
+    static Ref<XRReferenceSpaceEvent> create(const AtomString&, const Init&, IsTrusted = IsTrusted::No);
+    virtual ~XRReferenceSpaceEvent();
+
+    const WebXRReferenceSpace& referenceSpace() const;
+    const WebXRRigidTransform& transform() const;
+
+private:
+    XRReferenceSpaceEvent(const AtomString&, const Init&, IsTrusted);
+
+    RefPtr<WebXRReferenceSpace> m_referenceSpace;
+    RefPtr<WebXRRigidTransform> m_transform;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.idl b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.idl
new file mode 100644 (file)
index 0000000..169c14c
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRReferenceSpaceEventInit : EventInit {
+    required WebXRReferenceSpace referenceSpace;
+    WebXRRigidTransform transform;
+};
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(DOMString type, XRReferenceSpaceEventInit eventInitDict),
+] interface XRReferenceSpaceEvent : Event {
+    [SameObject] readonly attribute WebXRReferenceSpace referenceSpace;
+    [SameObject] readonly attribute WebXRRigidTransform transform;
+};
diff --git a/Source/WebCore/Modules/webxr/XRReferenceSpaceType.h b/Source/WebCore/Modules/webxr/XRReferenceSpaceType.h
new file mode 100644 (file)
index 0000000..0435896
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XRReferenceSpaceType {
+    Viewer,
+    Local,
+    LocalFloor,
+    BoundedFloor,
+    Unbounded
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRReferenceSpaceType.idl b/Source/WebCore/Modules/webxr/XRReferenceSpaceType.idl
new file mode 100644 (file)
index 0000000..f2996bb
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XRReferenceSpaceType {
+    "viewer",
+    "local",
+    "local-floor",
+    "bounded-floor",
+    "unbounded"
+};
diff --git a/Source/WebCore/Modules/webxr/XRRenderStateInit.h b/Source/WebCore/Modules/webxr/XRRenderStateInit.h
new file mode 100644 (file)
index 0000000..707180b
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "WebXRWebGLLayer.h"
+#include <wtf/RefPtr.h>
+
+namespace WebCore {
+
+struct XRRenderStateInit {
+    double depthNear;
+    double depthFar;
+    double inlineVerticalFieldOfView;
+    RefPtr<WebXRWebGLLayer> baseLayer;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRRenderStateInit.idl b/Source/WebCore/Modules/webxr/XRRenderStateInit.idl
new file mode 100644 (file)
index 0000000..a60eae4
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRRenderStateInit {
+    double depthNear;
+    double depthFar;
+    double inlineVerticalFieldOfView;
+    WebXRWebGLLayer? baseLayer;
+};
diff --git a/Source/WebCore/Modules/webxr/XRSessionEvent.cpp b/Source/WebCore/Modules/webxr/XRSessionEvent.cpp
new file mode 100644 (file)
index 0000000..df8748c
--- /dev/null
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "XRSessionEvent.h"
+
+#if ENABLE(WEBXR)
+
+#include "WebXRSession.h"
+
+namespace WebCore {
+
+Ref<XRSessionEvent> XRSessionEvent::create(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+{
+    return adoptRef(*new XRSessionEvent(type, initializer, isTrusted));
+}
+
+XRSessionEvent::XRSessionEvent(const AtomString& type, const Init& initializer, IsTrusted isTrusted)
+    : Event(type, initializer, isTrusted)
+    , m_session(initializer.session)
+{
+    ASSERT(m_session);
+}
+
+XRSessionEvent::~XRSessionEvent() = default;
+
+const WebXRSession& XRSessionEvent::session() const
+{
+    return *m_session;
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRSessionEvent.h b/Source/WebCore/Modules/webxr/XRSessionEvent.h
new file mode 100644 (file)
index 0000000..9e8ceb4
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "Event.h"
+
+namespace WebCore {
+
+class WebXRSession;
+
+class XRSessionEvent final : public Event {
+public:
+    struct Init : EventInit {
+        RefPtr<WebXRSession> session;
+    };
+
+    static Ref<XRSessionEvent> create(const AtomString&, const Init&, IsTrusted = IsTrusted::No);
+    virtual ~XRSessionEvent();
+
+    const WebXRSession& session() const;
+
+private:
+    XRSessionEvent(const AtomString&, const Init&, IsTrusted);
+
+    RefPtr<WebXRSession> m_session;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRSessionEvent.idl b/Source/WebCore/Modules/webxr/XRSessionEvent.idl
new file mode 100644 (file)
index 0000000..471933f
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRSessionEventInit : EventInit {
+    required WebXRSession session;
+};
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+    SecureContext,
+    Exposed=Window,
+    Constructor(DOMString type, XRSessionEventInit eventInitDict),
+] interface XRSessionEvent : Event {
+    [SameObject] readonly attribute WebXRSession session;
+};
diff --git a/Source/WebCore/Modules/webxr/XRSessionInit.h b/Source/WebCore/Modules/webxr/XRSessionInit.h
new file mode 100644 (file)
index 0000000..e62a268
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include <JavaScriptCore/Strong.h>
+#include <wtf/Forward.h>
+
+namespace JSC {
+class JSValue;
+}
+
+namespace WebCore {
+
+struct XRSessionInit {
+    Vector<JSC::JSValue> requiredFeatures;
+    Vector<JSC::JSValue> optionalFeatures;
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRSessionInit.idl b/Source/WebCore/Modules/webxr/XRSessionInit.idl
new file mode 100644 (file)
index 0000000..605c0d5
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRSessionInit {
+    sequence<any> requiredFeatures;
+    sequence<any> optionalFeatures;
+};
diff --git a/Source/WebCore/Modules/webxr/XRSessionMode.h b/Source/WebCore/Modules/webxr/XRSessionMode.h
new file mode 100644 (file)
index 0000000..771a9da
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+#include "PlatformXR.h"
+
+namespace WebCore {
+
+using XRSessionMode = PlatformXR::SessionMode;
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRSessionMode.idl b/Source/WebCore/Modules/webxr/XRSessionMode.idl
new file mode 100644 (file)
index 0000000..e65f606
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XRSessionMode {
+    "inline",
+    "immersive-vr",
+    "immersive-ar"
+};
diff --git a/Source/WebCore/Modules/webxr/XRTargetRayMode.h b/Source/WebCore/Modules/webxr/XRTargetRayMode.h
new file mode 100644 (file)
index 0000000..1fca44e
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XRTargetRayMode {
+    Gaze,
+    TrackedPointer,
+    Screen,
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRTargetRayMode.idl b/Source/WebCore/Modules/webxr/XRTargetRayMode.idl
new file mode 100644 (file)
index 0000000..64e5463
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XRTargetRayMode {
+    "gaze",
+    "tracked-pointer",
+    "screen"
+};
diff --git a/Source/WebCore/Modules/webxr/XRVisibilityState.h b/Source/WebCore/Modules/webxr/XRVisibilityState.h
new file mode 100644 (file)
index 0000000..6fdd859
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+enum class XRVisibilityState {
+    Visible,
+    VisibleBlurred,
+    Hidden
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRVisibilityState.idl b/Source/WebCore/Modules/webxr/XRVisibilityState.idl
new file mode 100644 (file)
index 0000000..11ef275
--- /dev/null
@@ -0,0 +1,33 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR
+] enum XRVisibilityState {
+    "visible",
+    "visible-blurred",
+    "hidden"
+};
diff --git a/Source/WebCore/Modules/webxr/XRWebGLLayerInit.h b/Source/WebCore/Modules/webxr/XRWebGLLayerInit.h
new file mode 100644 (file)
index 0000000..ba44d51
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#pragma once
+
+#if ENABLE(WEBXR)
+
+namespace WebCore {
+
+struct XRWebGLLayerInit {
+    bool antialias { true };
+    bool depth { true };
+    bool stencil { false };
+    bool alpha { true };
+    bool ignoreDepthValues { true };
+    double framebufferScaleFactor { 1.0 };
+};
+
+} // namespace WebCore
+
+#endif // ENABLE(WEBXR)
diff --git a/Source/WebCore/Modules/webxr/XRWebGLLayerInit.idl b/Source/WebCore/Modules/webxr/XRWebGLLayerInit.idl
new file mode 100644 (file)
index 0000000..3a436d2
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 Igalia S.L. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+[
+    EnabledAtRuntime=WebXR,
+    Conditional=WEBXR,
+] dictionary XRWebGLLayerInit {
+    boolean antialias = true;
+    boolean depth = true;
+    boolean stencil = false;
+    boolean alpha = true;
+    boolean ignoreDepthValues = false;
+    double framebufferScaleFactor = 1.0;
+};
index dca58cb..6e7d9aa 100644 (file)
@@ -1,3 +1,12 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
+
 2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Should not use variable-length-array (VLA)
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 0d5982e..e75ecef 100644 (file)
@@ -70,3 +70,8 @@ list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES
     ${UPOWERGLIB_INCLUDE_DIRS}
     ${WPEBACKEND_FDO_INCLUDE_DIRS}
 )
+
+if (USE_OPENXR)
+    list(APPEND WebCore_LIBRARIES ${OPENXR_LIBRARIES})
+    list(APPEND WebCore_SYSTEM_INCLUDE_DIRECTORIES ${OPENXR_INCLUDE_DIRS})
+endif ()
\ No newline at end of file
index 778263e..401cad4 100644 (file)
@@ -411,6 +411,31 @@ Modules/webgpu/WebGPUTexture.cpp
 Modules/webgpu/WebGPUTextureView.cpp
 Modules/webgpu/WorkerNavigatorGPU.cpp
 
+#if ENABLE_WEBXR
+
+Modules/webxr/NavigatorWebXR.cpp @no-unify
+Modules/webxr/WebXRBoundedReferenceSpace.cpp @no-unify
+Modules/webxr/WebXRFrame.cpp @no-unify
+Modules/webxr/WebXRInputSourceArray.cpp @no-unify
+Modules/webxr/WebXRInputSource.cpp @no-unify
+Modules/webxr/WebXRPose.cpp @no-unify
+Modules/webxr/WebXRReferenceSpace.cpp @no-unify
+Modules/webxr/WebXRRenderState.cpp @no-unify
+Modules/webxr/WebXRRigidTransform.cpp @no-unify
+Modules/webxr/WebXRSession.cpp @no-unify
+Modules/webxr/WebXRSpace.cpp @no-unify
+Modules/webxr/WebXRSystem.cpp @no-unify
+Modules/webxr/WebXRView.cpp @no-unify
+Modules/webxr/WebXRViewerPose.cpp @no-unify
+Modules/webxr/WebXRViewport.cpp @no-unify
+Modules/webxr/WebXRWebGLLayer.cpp @no-unify
+Modules/webxr/XRInputSourceEvent.cpp @no-unify
+Modules/webxr/XRInputSourcesChangeEvent.cpp @no-unify
+Modules/webxr/XRReferenceSpaceEvent.cpp @no-unify
+Modules/webxr/XRSessionEvent.cpp @no-unify
+
+#endif
+
 accessibility/AXObjectCache.cpp
 accessibility/AccessibilityARIAGrid.cpp
 accessibility/AccessibilityARIAGridCell.cpp
@@ -2077,6 +2102,9 @@ platform/text/TextEncoding.cpp
 platform/text/TextEncodingDetectorICU.cpp
 platform/text/TextEncodingRegistry.cpp
 
+platform/xr/PlatformXR.cpp @no-unify
+platform/xr/openxr/PlatformXR.cpp @no-unify
+
 plugins/DOMMimeType.cpp
 plugins/DOMMimeTypeArray.cpp
 plugins/DOMPlugin.cpp
@@ -3524,6 +3552,41 @@ JSXPathNSResolver.cpp
 JSXPathResult.cpp
 JSXSLTProcessor.cpp
 
+#if ENABLE_WEBGL
+
+JSWebXRBoundedReferenceSpace.cpp
+JSXREnvironmentBlendMode.cpp
+JSXREye.cpp
+JSWebXRFrame.cpp
+JSXRFrameRequestCallback.cpp
+JSXRHandedness.cpp
+JSWebXRInputSource.cpp
+JSWebXRInputSourceArray.cpp
+JSXRInputSourceEvent.cpp
+JSXRInputSourcesChangeEvent.cpp
+JSWebXRPose.cpp
+JSWebXRReferenceSpace.cpp
+JSXRReferenceSpaceEvent.cpp
+JSXRReferenceSpaceType.cpp
+JSWebXRRenderState.cpp
+JSXRRenderStateInit.cpp
+JSWebXRRigidTransform.cpp
+JSWebXRSession.cpp
+JSXRSessionEvent.cpp
+JSXRSessionInit.cpp
+JSXRSessionMode.cpp
+JSWebXRSpace.cpp
+JSWebXRSystem.cpp
+JSXRTargetRayMode.cpp
+JSWebXRView.cpp
+JSWebXRViewerPose.cpp
+JSWebXRViewport.cpp
+JSXRVisibilityState.cpp
+JSWebXRWebGLLayer.cpp
+JSXRWebGLLayerInit.cpp
+
+#endif
+
 #if ENABLE_GAMEPAD
 
 JSGamepad.cpp
index 73f3a9f..86ae858 100644 (file)
                E1E6EEA80B628DB3005F2F70 /* JSHTMLSelectElement.h in Headers */ = {isa = PBXBuildFile; fileRef = E1E6EEA70B628DB3005F2F70 /* JSHTMLSelectElement.h */; };
                E1EC29A00BB04C6B00EA187B /* XPathNodeSet.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EC299E0BB04C6B00EA187B /* XPathNodeSet.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E1ED8AC30CC49BE000BFC557 /* CSSPrimitiveValueMappings.h in Headers */ = {isa = PBXBuildFile; fileRef = E1ED8AC20CC49BE000BFC557 /* CSSPrimitiveValueMappings.h */; settings = {ATTRIBUTES = (Private, ); }; };
+               E1EE8B702412B2A800E794D6 /* PlatformXR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B6C2412B2A700E794D6 /* PlatformXR.cpp */; };
+               E1EE8B712412B2A800E794D6 /* PlatformXR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B6E2412B2A700E794D6 /* PlatformXR.cpp */; };
+               E1EE8B722412B2A800E794D6 /* PlatformXR.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B6F2412B2A700E794D6 /* PlatformXR.h */; };
+               E1EE8B762413191F00E794D6 /* WebXRViewerPose.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AC72412B16F00E794D6 /* WebXRViewerPose.h */; };
+               E1EE8B772413191F00E794D6 /* XRReferenceSpaceType.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AC92412B17000E794D6 /* XRReferenceSpaceType.h */; };
+               E1EE8B782413191F00E794D6 /* NavigatorWebXR.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8ACA2412B17000E794D6 /* NavigatorWebXR.h */; };
+               E1EE8B792413191F00E794D6 /* XRRenderStateInit.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8ACB2412B17000E794D6 /* XRRenderStateInit.h */; };
+               E1EE8B7A2413191F00E794D6 /* XRInputSourceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8ACC2412B17000E794D6 /* XRInputSourceEvent.cpp */; };
+               E1EE8B7B2413191F00E794D6 /* WebXRRigidTransform.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8ACD2412B17000E794D6 /* WebXRRigidTransform.cpp */; };
+               E1EE8B7C2413191F00E794D6 /* WebXRRenderState.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8ACE2412B17000E794D6 /* WebXRRenderState.cpp */; };
+               E1EE8B7D2413191F00E794D6 /* WebXRSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8ACF2412B17000E794D6 /* WebXRSpace.h */; };
+               E1EE8B7E2413191F00E794D6 /* WebXRBoundedReferenceSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AD12412B17000E794D6 /* WebXRBoundedReferenceSpace.h */; };
+               E1EE8B7F2413191F00E794D6 /* WebXRReferenceSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AD22412B17000E794D6 /* WebXRReferenceSpace.cpp */; };
+               E1EE8B802413191F00E794D6 /* WebXRBoundedReferenceSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AD32412B17000E794D6 /* WebXRBoundedReferenceSpace.cpp */; };
+               E1EE8B812413191F00E794D6 /* WebXRRenderState.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AD52412B17000E794D6 /* WebXRRenderState.h */; };
+               E1EE8B822413191F00E794D6 /* XRVisibilityState.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AD62412B17000E794D6 /* XRVisibilityState.h */; };
+               E1EE8B832413191F00E794D6 /* WebXRWebGLLayer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AD82412B17000E794D6 /* WebXRWebGLLayer.cpp */; };
+               E1EE8B842413191F00E794D6 /* XRReferenceSpaceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8ADB2412B17000E794D6 /* XRReferenceSpaceEvent.h */; };
+               E1EE8B852413191F00E794D6 /* XRSessionEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8ADC2412B17000E794D6 /* XRSessionEvent.cpp */; };
+               E1EE8B862413191F00E794D6 /* WebXRInputSourceArray.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8ADD2412B17000E794D6 /* WebXRInputSourceArray.h */; };
+               E1EE8B872413191F00E794D6 /* WebXRView.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE02412B17000E794D6 /* WebXRView.h */; };
+               E1EE8B882413191F00E794D6 /* WebXRPose.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE12412B17000E794D6 /* WebXRPose.h */; };
+               E1EE8B892413191F00E794D6 /* WebXRSystem.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE22412B17000E794D6 /* WebXRSystem.h */; };
+               E1EE8B8A2413191F00E794D6 /* WebXRFrame.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE32412B17000E794D6 /* WebXRFrame.h */; };
+               E1EE8B8B2413191F00E794D6 /* WebXRPose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */; };
+               E1EE8B8C2413191F00E794D6 /* WebXRInputSourceArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AE62412B17000E794D6 /* WebXRInputSourceArray.cpp */; };
+               E1EE8B8D2413195000E794D6 /* XRSessionEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE72412B17000E794D6 /* XRSessionEvent.h */; };
+               E1EE8B8E2413195000E794D6 /* WebXRSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AE82412B17000E794D6 /* WebXRSystem.cpp */; };
+               E1EE8B8F2413195000E794D6 /* XRFrameRequestCallback.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AE92412B17000E794D6 /* XRFrameRequestCallback.h */; };
+               E1EE8B902413195000E794D6 /* XRTargetRayMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AEA2412B17000E794D6 /* XRTargetRayMode.h */; };
+               E1EE8B912413195000E794D6 /* WebXRViewport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AEB2412B17000E794D6 /* WebXRViewport.cpp */; };
+               E1EE8B922413195000E794D6 /* XRHandedness.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AEE2412B17000E794D6 /* XRHandedness.h */; };
+               E1EE8B932413195000E794D6 /* WebXRFrame.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AF02412B17000E794D6 /* WebXRFrame.cpp */; };
+               E1EE8B942413195000E794D6 /* NavigatorWebXR.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AF12412B17000E794D6 /* NavigatorWebXR.cpp */; };
+               E1EE8B952413195000E794D6 /* XRReferenceSpaceEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AF32412B17000E794D6 /* XRReferenceSpaceEvent.cpp */; };
+               E1EE8B962413195000E794D6 /* WebXRViewport.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AF42412B17000E794D6 /* WebXRViewport.h */; };
+               E1EE8B972413195000E794D6 /* XREye.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AF52412B17000E794D6 /* XREye.h */; };
+               E1EE8B982413195000E794D6 /* WebXRSpace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8AF82412B17000E794D6 /* WebXRSpace.cpp */; };
+               E1EE8B992413195000E794D6 /* XRInputSourcesChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AF92412B17000E794D6 /* XRInputSourcesChangeEvent.h */; };
+               E1EE8B9A2413195000E794D6 /* XRSessionMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8AFE2412B17000E794D6 /* XRSessionMode.h */; };
+               E1EE8B9B2413195000E794D6 /* XRWebGLLayer.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B042412B17000E794D6 /* XRWebGLLayer.h */; };
+               E1EE8B9C2413195000E794D6 /* XREnvironmentBlendMode.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B052412B17000E794D6 /* XREnvironmentBlendMode.h */; };
+               E1EE8B9D2413195000E794D6 /* WebXRRigidTransform.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B062412B17000E794D6 /* WebXRRigidTransform.h */; };
+               E1EE8B9E2413195000E794D6 /* XRWebGLLayerInit.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B082412B17000E794D6 /* XRWebGLLayerInit.h */; };
+               E1EE8B9F2413195000E794D6 /* XRInputSourceEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B092412B17000E794D6 /* XRInputSourceEvent.h */; };
+               E1EE8BA02413195000E794D6 /* WebXRViewerPose.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B0B2412B17000E794D6 /* WebXRViewerPose.cpp */; };
+               E1EE8BA12413196300E794D6 /* WebXRInputSource.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B0D2412B17000E794D6 /* WebXRInputSource.cpp */; };
+               E1EE8BA22413196300E794D6 /* WebXRSession.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B0F2412B17000E794D6 /* WebXRSession.cpp */; };
+               E1EE8BA32413196300E794D6 /* WebXRSession.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B112412B17000E794D6 /* WebXRSession.h */; };
+               E1EE8BA42413196300E794D6 /* WebXRView.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B122412B17000E794D6 /* WebXRView.cpp */; };
+               E1EE8BA52413196300E794D6 /* XRSessionInit.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B132412B17000E794D6 /* XRSessionInit.h */; };
+               E1EE8BA62413196300E794D6 /* WebXRReferenceSpace.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B142412B17000E794D6 /* WebXRReferenceSpace.h */; };
+               E1EE8BA72413196300E794D6 /* XRInputSourcesChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E1EE8B152412B17000E794D6 /* XRInputSourcesChangeEvent.cpp */; };
+               E1EE8BA82413196300E794D6 /* WebXRInputSource.h in Headers */ = {isa = PBXBuildFile; fileRef = E1EE8B172412B17000E794D6 /* WebXRInputSource.h */; };
                E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */; };
                E1F80B8818317252007885C3 /* CryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8618317252007885C3 /* CryptoKeyPair.h */; settings = {ATTRIBUTES = (Private, ); }; };
                E1F80B8E183172B5007885C3 /* JSCryptoKeyPair.h in Headers */ = {isa = PBXBuildFile; fileRef = E1F80B8C183172B5007885C3 /* JSCryptoKeyPair.h */; };
                E1EC299D0BB04C6B00EA187B /* XPathNodeSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XPathNodeSet.cpp; sourceTree = "<group>"; };
                E1EC299E0BB04C6B00EA187B /* XPathNodeSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XPathNodeSet.h; sourceTree = "<group>"; };
                E1ED8AC20CC49BE000BFC557 /* CSSPrimitiveValueMappings.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPrimitiveValueMappings.h; sourceTree = "<group>"; };
+               E1EE8AC72412B16F00E794D6 /* WebXRViewerPose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRViewerPose.h; sourceTree = "<group>"; };
+               E1EE8AC82412B16F00E794D6 /* XRSessionMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSessionMode.idl; sourceTree = "<group>"; };
+               E1EE8AC92412B17000E794D6 /* XRReferenceSpaceType.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRReferenceSpaceType.h; sourceTree = "<group>"; };
+               E1EE8ACA2412B17000E794D6 /* NavigatorWebXR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NavigatorWebXR.h; sourceTree = "<group>"; };
+               E1EE8ACB2412B17000E794D6 /* XRRenderStateInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRRenderStateInit.h; sourceTree = "<group>"; };
+               E1EE8ACC2412B17000E794D6 /* XRInputSourceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XRInputSourceEvent.cpp; sourceTree = "<group>"; };
+               E1EE8ACD2412B17000E794D6 /* WebXRRigidTransform.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRRigidTransform.cpp; sourceTree = "<group>"; };
+               E1EE8ACE2412B17000E794D6 /* WebXRRenderState.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRRenderState.cpp; sourceTree = "<group>"; };
+               E1EE8ACF2412B17000E794D6 /* WebXRSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRSpace.h; sourceTree = "<group>"; };
+               E1EE8AD02412B17000E794D6 /* XRReferenceSpaceEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRReferenceSpaceEvent.idl; sourceTree = "<group>"; };
+               E1EE8AD12412B17000E794D6 /* WebXRBoundedReferenceSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRBoundedReferenceSpace.h; sourceTree = "<group>"; };
+               E1EE8AD22412B17000E794D6 /* WebXRReferenceSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRReferenceSpace.cpp; sourceTree = "<group>"; };
+               E1EE8AD32412B17000E794D6 /* WebXRBoundedReferenceSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRBoundedReferenceSpace.cpp; sourceTree = "<group>"; };
+               E1EE8AD42412B17000E794D6 /* XRSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSpace.idl; sourceTree = "<group>"; };
+               E1EE8AD52412B17000E794D6 /* WebXRRenderState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRRenderState.h; sourceTree = "<group>"; };
+               E1EE8AD62412B17000E794D6 /* XRVisibilityState.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRVisibilityState.h; sourceTree = "<group>"; };
+               E1EE8AD72412B17000E794D6 /* XRSessionInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSessionInit.idl; sourceTree = "<group>"; };
+               E1EE8AD82412B17000E794D6 /* WebXRWebGLLayer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRWebGLLayer.cpp; sourceTree = "<group>"; };
+               E1EE8AD92412B17000E794D6 /* XRVisibilityState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRVisibilityState.idl; sourceTree = "<group>"; };
+               E1EE8ADA2412B17000E794D6 /* XREnvironmentBlendMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XREnvironmentBlendMode.idl; sourceTree = "<group>"; };
+               E1EE8ADB2412B17000E794D6 /* XRReferenceSpaceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRReferenceSpaceEvent.h; sourceTree = "<group>"; };
+               E1EE8ADC2412B17000E794D6 /* XRSessionEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XRSessionEvent.cpp; sourceTree = "<group>"; };
+               E1EE8ADD2412B17000E794D6 /* WebXRInputSourceArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRInputSourceArray.h; sourceTree = "<group>"; };
+               E1EE8ADE2412B17000E794D6 /* XRSession.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSession.idl; sourceTree = "<group>"; };
+               E1EE8ADF2412B17000E794D6 /* XRView.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRView.idl; sourceTree = "<group>"; };
+               E1EE8AE02412B17000E794D6 /* WebXRView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRView.h; sourceTree = "<group>"; };
+               E1EE8AE12412B17000E794D6 /* WebXRPose.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRPose.h; sourceTree = "<group>"; };
+               E1EE8AE22412B17000E794D6 /* WebXRSystem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRSystem.h; sourceTree = "<group>"; };
+               E1EE8AE32412B17000E794D6 /* WebXRFrame.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRFrame.h; sourceTree = "<group>"; };
+               E1EE8AE42412B17000E794D6 /* XRInputSourcesChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRInputSourcesChangeEvent.idl; sourceTree = "<group>"; };
+               E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRPose.cpp; sourceTree = "<group>"; };
+               E1EE8AE62412B17000E794D6 /* WebXRInputSourceArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRInputSourceArray.cpp; sourceTree = "<group>"; };
+               E1EE8AE72412B17000E794D6 /* XRSessionEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRSessionEvent.h; sourceTree = "<group>"; };
+               E1EE8AE82412B17000E794D6 /* WebXRSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRSystem.cpp; sourceTree = "<group>"; };
+               E1EE8AE92412B17000E794D6 /* XRFrameRequestCallback.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRFrameRequestCallback.h; sourceTree = "<group>"; };
+               E1EE8AEA2412B17000E794D6 /* XRTargetRayMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRTargetRayMode.h; sourceTree = "<group>"; };
+               E1EE8AEB2412B17000E794D6 /* WebXRViewport.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRViewport.cpp; sourceTree = "<group>"; };
+               E1EE8AEC2412B17000E794D6 /* XRRenderStateInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRRenderStateInit.idl; sourceTree = "<group>"; };
+               E1EE8AED2412B17000E794D6 /* XRViewerPose.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRViewerPose.idl; sourceTree = "<group>"; };
+               E1EE8AEE2412B17000E794D6 /* XRHandedness.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRHandedness.h; sourceTree = "<group>"; };
+               E1EE8AEF2412B17000E794D6 /* XRInputSource.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRInputSource.idl; sourceTree = "<group>"; };
+               E1EE8AF02412B17000E794D6 /* WebXRFrame.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRFrame.cpp; sourceTree = "<group>"; };
+               E1EE8AF12412B17000E794D6 /* NavigatorWebXR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NavigatorWebXR.cpp; sourceTree = "<group>"; };
+               E1EE8AF22412B17000E794D6 /* XRRenderState.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRRenderState.idl; sourceTree = "<group>"; };
+               E1EE8AF32412B17000E794D6 /* XRReferenceSpaceEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XRReferenceSpaceEvent.cpp; sourceTree = "<group>"; };
+               E1EE8AF42412B17000E794D6 /* WebXRViewport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRViewport.h; sourceTree = "<group>"; };
+               E1EE8AF52412B17000E794D6 /* XREye.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XREye.h; sourceTree = "<group>"; };
+               E1EE8AF62412B17000E794D6 /* XRReferenceSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRReferenceSpace.idl; sourceTree = "<group>"; };
+               E1EE8AF72412B17000E794D6 /* XRBoundedReferenceSpace.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRBoundedReferenceSpace.idl; sourceTree = "<group>"; };
+               E1EE8AF82412B17000E794D6 /* WebXRSpace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRSpace.cpp; sourceTree = "<group>"; };
+               E1EE8AF92412B17000E794D6 /* XRInputSourcesChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRInputSourcesChangeEvent.h; sourceTree = "<group>"; };
+               E1EE8AFA2412B17000E794D6 /* XRReferenceSpaceType.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRReferenceSpaceType.idl; sourceTree = "<group>"; };
+               E1EE8AFB2412B17000E794D6 /* XRFrameRequestCallback.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRFrameRequestCallback.idl; sourceTree = "<group>"; };
+               E1EE8AFC2412B17000E794D6 /* XRWebGLLayer.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRWebGLLayer.idl; sourceTree = "<group>"; };
+               E1EE8AFD2412B17000E794D6 /* XRSessionEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSessionEvent.idl; sourceTree = "<group>"; };
+               E1EE8AFE2412B17000E794D6 /* XRSessionMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRSessionMode.h; sourceTree = "<group>"; };
+               E1EE8AFF2412B17000E794D6 /* XRTargetRayMode.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRTargetRayMode.idl; sourceTree = "<group>"; };
+               E1EE8B002412B17000E794D6 /* XRInputSourceEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRInputSourceEvent.idl; sourceTree = "<group>"; };
+               E1EE8B012412B17000E794D6 /* XRRigidTransform.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRRigidTransform.idl; sourceTree = "<group>"; };
+               E1EE8B022412B17000E794D6 /* XRSystem.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRSystem.idl; sourceTree = "<group>"; };
+               E1EE8B032412B17000E794D6 /* XREye.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XREye.idl; sourceTree = "<group>"; };
+               E1EE8B042412B17000E794D6 /* XRWebGLLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRWebGLLayer.h; sourceTree = "<group>"; };
+               E1EE8B052412B17000E794D6 /* XREnvironmentBlendMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XREnvironmentBlendMode.h; sourceTree = "<group>"; };
+               E1EE8B062412B17000E794D6 /* WebXRRigidTransform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRRigidTransform.h; sourceTree = "<group>"; };
+               E1EE8B072412B17000E794D6 /* XRHandedness.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRHandedness.idl; sourceTree = "<group>"; };
+               E1EE8B082412B17000E794D6 /* XRWebGLLayerInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRWebGLLayerInit.h; sourceTree = "<group>"; };
+               E1EE8B092412B17000E794D6 /* XRInputSourceEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRInputSourceEvent.h; sourceTree = "<group>"; };
+               E1EE8B0A2412B17000E794D6 /* XRViewport.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRViewport.idl; sourceTree = "<group>"; };
+               E1EE8B0B2412B17000E794D6 /* WebXRViewerPose.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRViewerPose.cpp; sourceTree = "<group>"; };
+               E1EE8B0C2412B17000E794D6 /* XRFrame.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRFrame.idl; sourceTree = "<group>"; };
+               E1EE8B0D2412B17000E794D6 /* WebXRInputSource.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRInputSource.cpp; sourceTree = "<group>"; };
+               E1EE8B0E2412B17000E794D6 /* NavigatorWebXR.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = NavigatorWebXR.idl; sourceTree = "<group>"; };
+               E1EE8B0F2412B17000E794D6 /* WebXRSession.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRSession.cpp; sourceTree = "<group>"; };
+               E1EE8B102412B17000E794D6 /* XRWebGLLayerInit.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRWebGLLayerInit.idl; sourceTree = "<group>"; };
+               E1EE8B112412B17000E794D6 /* WebXRSession.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRSession.h; sourceTree = "<group>"; };
+               E1EE8B122412B17000E794D6 /* WebXRView.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebXRView.cpp; sourceTree = "<group>"; };
+               E1EE8B132412B17000E794D6 /* XRSessionInit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XRSessionInit.h; sourceTree = "<group>"; };
+               E1EE8B142412B17000E794D6 /* WebXRReferenceSpace.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRReferenceSpace.h; sourceTree = "<group>"; };
+               E1EE8B152412B17000E794D6 /* XRInputSourcesChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XRInputSourcesChangeEvent.cpp; sourceTree = "<group>"; };
+               E1EE8B162412B17000E794D6 /* XRPose.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRPose.idl; sourceTree = "<group>"; };
+               E1EE8B172412B17000E794D6 /* WebXRInputSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebXRInputSource.h; sourceTree = "<group>"; };
+               E1EE8B182412B17000E794D6 /* XRInputSourceArray.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = XRInputSourceArray.idl; sourceTree = "<group>"; };
+               E1EE8B6C2412B2A700E794D6 /* PlatformXR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformXR.cpp; sourceTree = "<group>"; };
+               E1EE8B6E2412B2A700E794D6 /* PlatformXR.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PlatformXR.cpp; sourceTree = "<group>"; };
+               E1EE8B6F2412B2A700E794D6 /* PlatformXR.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformXR.h; sourceTree = "<group>"; };
                E1F1E82D0C3C2BB9006DB391 /* XSLTExtensions.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = XSLTExtensions.cpp; sourceTree = "<group>"; };
                E1F1E82E0C3C2BB9006DB391 /* XSLTExtensions.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XSLTExtensions.h; sourceTree = "<group>"; };
                E1F80B8418317247007885C3 /* CryptoKeyPair.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = CryptoKeyPair.idl; sourceTree = "<group>"; };
                                996E59DA1DF00D45006612B9 /* webdriver */,
                                D00F593E216ECC43000D71DB /* webgpu */,
                                97AABCF714FA09B5007457AE /* websockets */,
+                               E1EE8AC62412B16F00E794D6 /* webxr */,
                        );
                        path = Modules;
                        sourceTree = "<group>";
                                656B84D70AEA1CE900A095B4 /* network */,
                                1A2E6E560CC551E0004A2062 /* sql */,
                                B2C3D9EC0D006C1D00EF6F26 /* text */,
+                               E1EE8B6B2412B2A700E794D6 /* xr */,
                                DFDB912CF8E88A6DA1AD264F /* AbortableTaskQueue.h */,
                                49AE2D94134EE5F90072920A /* CalculationValue.cpp */,
                                49AE2D95134EE5F90072920A /* CalculationValue.h */,
                        name = Threads;
                        sourceTree = "<group>";
                };
+               E1EE8AC62412B16F00E794D6 /* webxr */ = {
+                       isa = PBXGroup;
+                       children = (
+                               E1EE8AF12412B17000E794D6 /* NavigatorWebXR.cpp */,
+                               E1EE8ACA2412B17000E794D6 /* NavigatorWebXR.h */,
+                               E1EE8B0E2412B17000E794D6 /* NavigatorWebXR.idl */,
+                               E1EE8AD32412B17000E794D6 /* WebXRBoundedReferenceSpace.cpp */,
+                               E1EE8AD12412B17000E794D6 /* WebXRBoundedReferenceSpace.h */,
+                               E1EE8AF02412B17000E794D6 /* WebXRFrame.cpp */,
+                               E1EE8AE32412B17000E794D6 /* WebXRFrame.h */,
+                               E1EE8B0D2412B17000E794D6 /* WebXRInputSource.cpp */,
+                               E1EE8B172412B17000E794D6 /* WebXRInputSource.h */,
+                               E1EE8AE62412B17000E794D6 /* WebXRInputSourceArray.cpp */,
+                               E1EE8ADD2412B17000E794D6 /* WebXRInputSourceArray.h */,
+                               E1EE8AE52412B17000E794D6 /* WebXRPose.cpp */,
+                               E1EE8AE12412B17000E794D6 /* WebXRPose.h */,
+                               E1EE8AD22412B17000E794D6 /* WebXRReferenceSpace.cpp */,
+                               E1EE8B142412B17000E794D6 /* WebXRReferenceSpace.h */,
+                               E1EE8ACE2412B17000E794D6 /* WebXRRenderState.cpp */,
+                               E1EE8AD52412B17000E794D6 /* WebXRRenderState.h */,
+                               E1EE8ACD2412B17000E794D6 /* WebXRRigidTransform.cpp */,
+                               E1EE8B062412B17000E794D6 /* WebXRRigidTransform.h */,
+                               E1EE8B0F2412B17000E794D6 /* WebXRSession.cpp */,
+                               E1EE8B112412B17000E794D6 /* WebXRSession.h */,
+                               E1EE8AF82412B17000E794D6 /* WebXRSpace.cpp */,
+                               E1EE8ACF2412B17000E794D6 /* WebXRSpace.h */,
+                               E1EE8AE82412B17000E794D6 /* WebXRSystem.cpp */,
+                               E1EE8AE22412B17000E794D6 /* WebXRSystem.h */,
+                               E1EE8B122412B17000E794D6 /* WebXRView.cpp */,
+                               E1EE8AE02412B17000E794D6 /* WebXRView.h */,
+                               E1EE8B0B2412B17000E794D6 /* WebXRViewerPose.cpp */,
+                               E1EE8AC72412B16F00E794D6 /* WebXRViewerPose.h */,
+                               E1EE8AEB2412B17000E794D6 /* WebXRViewport.cpp */,
+                               E1EE8AF42412B17000E794D6 /* WebXRViewport.h */,
+                               E1EE8AD82412B17000E794D6 /* WebXRWebGLLayer.cpp */,
+                               E1EE8AF72412B17000E794D6 /* XRBoundedReferenceSpace.idl */,
+                               E1EE8B052412B17000E794D6 /* XREnvironmentBlendMode.h */,
+                               E1EE8ADA2412B17000E794D6 /* XREnvironmentBlendMode.idl */,
+                               E1EE8AF52412B17000E794D6 /* XREye.h */,
+                               E1EE8B032412B17000E794D6 /* XREye.idl */,
+                               E1EE8B0C2412B17000E794D6 /* XRFrame.idl */,
+                               E1EE8AE92412B17000E794D6 /* XRFrameRequestCallback.h */,
+                               E1EE8AFB2412B17000E794D6 /* XRFrameRequestCallback.idl */,
+                               E1EE8AEE2412B17000E794D6 /* XRHandedness.h */,
+                               E1EE8B072412B17000E794D6 /* XRHandedness.idl */,
+                               E1EE8AEF2412B17000E794D6 /* XRInputSource.idl */,
+                               E1EE8B182412B17000E794D6 /* XRInputSourceArray.idl */,
+                               E1EE8ACC2412B17000E794D6 /* XRInputSourceEvent.cpp */,
+                               E1EE8B092412B17000E794D6 /* XRInputSourceEvent.h */,
+                               E1EE8B002412B17000E794D6 /* XRInputSourceEvent.idl */,
+                               E1EE8B152412B17000E794D6 /* XRInputSourcesChangeEvent.cpp */,
+                               E1EE8AF92412B17000E794D6 /* XRInputSourcesChangeEvent.h */,
+                               E1EE8AE42412B17000E794D6 /* XRInputSourcesChangeEvent.idl */,
+                               E1EE8B162412B17000E794D6 /* XRPose.idl */,
+                               E1EE8AF62412B17000E794D6 /* XRReferenceSpace.idl */,
+                               E1EE8AF32412B17000E794D6 /* XRReferenceSpaceEvent.cpp */,
+                               E1EE8ADB2412B17000E794D6 /* XRReferenceSpaceEvent.h */,
+                               E1EE8AD02412B17000E794D6 /* XRReferenceSpaceEvent.idl */,
+                               E1EE8AC92412B17000E794D6 /* XRReferenceSpaceType.h */,
+                               E1EE8AFA2412B17000E794D6 /* XRReferenceSpaceType.idl */,
+                               E1EE8AF22412B17000E794D6 /* XRRenderState.idl */,
+                               E1EE8ACB2412B17000E794D6 /* XRRenderStateInit.h */,
+                               E1EE8AEC2412B17000E794D6 /* XRRenderStateInit.idl */,
+                               E1EE8B012412B17000E794D6 /* XRRigidTransform.idl */,
+                               E1EE8ADE2412B17000E794D6 /* XRSession.idl */,
+                               E1EE8ADC2412B17000E794D6 /* XRSessionEvent.cpp */,
+                               E1EE8AE72412B17000E794D6 /* XRSessionEvent.h */,
+                               E1EE8AFD2412B17000E794D6 /* XRSessionEvent.idl */,
+                               E1EE8B132412B17000E794D6 /* XRSessionInit.h */,
+                               E1EE8AD72412B17000E794D6 /* XRSessionInit.idl */,
+                               E1EE8AFE2412B17000E794D6 /* XRSessionMode.h */,
+                               E1EE8AC82412B16F00E794D6 /* XRSessionMode.idl */,
+                               E1EE8AD42412B17000E794D6 /* XRSpace.idl */,
+                               E1EE8B022412B17000E794D6 /* XRSystem.idl */,
+                               E1EE8AEA2412B17000E794D6 /* XRTargetRayMode.h */,
+                               E1EE8AFF2412B17000E794D6 /* XRTargetRayMode.idl */,
+                               E1EE8ADF2412B17000E794D6 /* XRView.idl */,
+                               E1EE8AED2412B17000E794D6 /* XRViewerPose.idl */,
+                               E1EE8B0A2412B17000E794D6 /* XRViewport.idl */,
+                               E1EE8AD62412B17000E794D6 /* XRVisibilityState.h */,
+                               E1EE8AD92412B17000E794D6 /* XRVisibilityState.idl */,
+                               E1EE8B042412B17000E794D6 /* XRWebGLLayer.h */,
+                               E1EE8AFC2412B17000E794D6 /* XRWebGLLayer.idl */,
+                               E1EE8B082412B17000E794D6 /* XRWebGLLayerInit.h */,
+                               E1EE8B102412B17000E794D6 /* XRWebGLLayerInit.idl */,
+                       );
+                       path = webxr;
+                       sourceTree = "<group>";
+               };
+               E1EE8B6B2412B2A700E794D6 /* xr */ = {
+                       isa = PBXGroup;
+                       children = (
+                               E1EE8B6D2412B2A700E794D6 /* openxr */,
+                               E1EE8B6C2412B2A700E794D6 /* PlatformXR.cpp */,
+                               E1EE8B6F2412B2A700E794D6 /* PlatformXR.h */,
+                       );
+                       path = xr;
+                       sourceTree = "<group>";
+               };
+               E1EE8B6D2412B2A700E794D6 /* openxr */ = {
+                       isa = PBXGroup;
+                       children = (
+                               E1EE8B6E2412B2A700E794D6 /* PlatformXR.cpp */,
+                       );
+                       path = openxr;
+                       sourceTree = "<group>";
+               };
                E1F0424309839389006694EA /* xml */ = {
                        isa = PBXGroup;
                        children = (
                                6B507A24234BF34100BE7C62 /* NavigatorIsLoggedIn.h in Headers */,
                                5EA725D61ACABD5700EAD17B /* NavigatorMediaDevices.h in Headers */,
                                996E59DF1DF0128D006612B9 /* NavigatorWebDriver.h in Headers */,
+                               E1EE8B782413191F00E794D6 /* NavigatorWebXR.h in Headers */,
                                8A309C9F123950BE00CB9204 /* NestingLevelIncrementer.h in Headers */,
                                656D37430ADBA5DE00A4554D /* NetscapePlugInStreamLoader.h in Headers */,
                                A19D934B1AA11B1E00B46C24 /* NetworkExtensionContentFilter.h in Headers */,
                                074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,
                                52B0D4BE1C57FD1E0077CE53 /* PlatformView.h in Headers */,
                                935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
+                               E1EE8B722412B2A800E794D6 /* PlatformXR.h in Headers */,
                                712BE4801FE864A7002031CC /* PlaybackDirection.h in Headers */,
                                CDA29A091CBD99F400901CCF /* PlaybackSessionInterface.h in Headers */,
                                CDA29A321CC01A9500901CCF /* PlaybackSessionInterfaceAVKit.h in Headers */,
                                5D21A80313ECE5DF00BB7064 /* WebVTTParser.h in Headers */,
                                B10B6980140C174000BC1C26 /* WebVTTToken.h in Headers */,
                                B10B6982140C174000BC1C26 /* WebVTTTokenizer.h in Headers */,
+                               E1EE8B7E2413191F00E794D6 /* WebXRBoundedReferenceSpace.h in Headers */,
+                               E1EE8B8A2413191F00E794D6 /* WebXRFrame.h in Headers */,
+                               E1EE8BA82413196300E794D6 /* WebXRInputSource.h in Headers */,
+                               E1EE8B862413191F00E794D6 /* WebXRInputSourceArray.h in Headers */,
+                               E1EE8B882413191F00E794D6 /* WebXRPose.h in Headers */,
+                               E1EE8BA62413196300E794D6 /* WebXRReferenceSpace.h in Headers */,
+                               E1EE8B812413191F00E794D6 /* WebXRRenderState.h in Headers */,
+                               E1EE8B9D2413195000E794D6 /* WebXRRigidTransform.h in Headers */,
+                               E1EE8BA32413196300E794D6 /* WebXRSession.h in Headers */,
+                               E1EE8B7D2413191F00E794D6 /* WebXRSpace.h in Headers */,
+                               E1EE8B892413191F00E794D6 /* WebXRSystem.h in Headers */,
+                               E1EE8B872413191F00E794D6 /* WebXRView.h in Headers */,
+                               E1EE8B762413191F00E794D6 /* WebXRViewerPose.h in Headers */,
+                               E1EE8B962413195000E794D6 /* WebXRViewport.h in Headers */,
                                F55B3DE01251F12D003EF269 /* WeekInputType.h in Headers */,
                                85031B510A44EFC700F992E0 /* WheelEvent.h in Headers */,
                                2EBBC3D81B65988300F5253D /* WheelEventDeltaFilter.h in Headers */,
                                1AB7FC840A8B92EC00D9D37B /* XPathUtil.h in Headers */,
                                1AB7FC860A8B92EC00D9D37B /* XPathValue.h in Headers */,
                                1AB7FC880A8B92EC00D9D37B /* XPathVariableReference.h in Headers */,
+                               E1EE8B9C2413195000E794D6 /* XREnvironmentBlendMode.h in Headers */,
+                               E1EE8B972413195000E794D6 /* XREye.h in Headers */,
+                               E1EE8B8F2413195000E794D6 /* XRFrameRequestCallback.h in Headers */,
+                               E1EE8B922413195000E794D6 /* XRHandedness.h in Headers */,
+                               E1EE8B9F2413195000E794D6 /* XRInputSourceEvent.h in Headers */,
+                               E1EE8B992413195000E794D6 /* XRInputSourcesChangeEvent.h in Headers */,
+                               E1EE8B842413191F00E794D6 /* XRReferenceSpaceEvent.h in Headers */,
+                               E1EE8B772413191F00E794D6 /* XRReferenceSpaceType.h in Headers */,
+                               E1EE8B792413191F00E794D6 /* XRRenderStateInit.h in Headers */,
+                               E1EE8B8D2413195000E794D6 /* XRSessionEvent.h in Headers */,
+                               E1EE8BA52413196300E794D6 /* XRSessionInit.h in Headers */,
+                               E1EE8B9A2413195000E794D6 /* XRSessionMode.h in Headers */,
+                               E1EE8B902413195000E794D6 /* XRTargetRayMode.h in Headers */,
+                               E1EE8B822413191F00E794D6 /* XRVisibilityState.h in Headers */,
+                               E1EE8B9B2413195000E794D6 /* XRWebGLLayer.h in Headers */,
+                               E1EE8B9E2413195000E794D6 /* XRWebGLLayerInit.h in Headers */,
                                85217E030A5ECD4700DB8D00 /* XSLImportRule.h in Headers */,
                                93F199EC08245E59001E9ABC /* XSLStyleSheet.h in Headers */,
                                E1F1E8300C3C2BB9006DB391 /* XSLTExtensions.h in Headers */,
                                CDF2B0161820540700F2B424 /* MockSourceBufferPrivate.cpp in Sources */,
                                2D9BF7421DBFDC27007A7D99 /* NavigatorEME.cpp in Sources */,
                                51A4BB101954D62700FA5C2E /* NavigatorGamepad.cpp in Sources */,
+                               E1EE8B942413195000E794D6 /* NavigatorWebXR.cpp in Sources */,
                                1A569D130D7E2B82007C3983 /* objc_class.mm in Sources */,
                                1A569D160D7E2B82007C3983 /* objc_instance.mm in Sources */,
                                1A569D180D7E2B82007C3983 /* objc_runtime.mm in Sources */,
                                E16982601134636A00894115 /* ObjCRuntimeObject.mm in Sources */,
                                CEA284662141E84900E407E8 /* PlatformEventFactoryIOS.mm in Sources */,
                                AA12DF491743DF83004DAFDF /* PlatformSpeechSynthesizerIOS.mm in Sources */,
+                               E1EE8B712412B2A800E794D6 /* PlatformXR.cpp in Sources */,
+                               E1EE8B702412B2A800E794D6 /* PlatformXR.cpp in Sources */,
                                CDA29A301CBF74D400901CCF /* PlaybackSessionInterfaceAVKit.mm in Sources */,
                                CDA29A161CBDA56C00901CCF /* PlaybackSessionInterfaceMac.mm in Sources */,
                                419242492127B93E00634FCF /* RealtimeOutgoingVideoSourceCocoa.mm in Sources */,
                                F12171F516A8CED2000053CA /* WebVTTElement.cpp in Sources */,
                                5D21A80213ECE5DF00BB7064 /* WebVTTParser.cpp in Sources */,
                                B10B6981140C174000BC1C26 /* WebVTTTokenizer.cpp in Sources */,
+                               E1EE8B802413191F00E794D6 /* WebXRBoundedReferenceSpace.cpp in Sources */,
+                               E1EE8B932413195000E794D6 /* WebXRFrame.cpp in Sources */,
+                               E1EE8BA12413196300E794D6 /* WebXRInputSource.cpp in Sources */,
+                               E1EE8B8C2413191F00E794D6 /* WebXRInputSourceArray.cpp in Sources */,
+                               E1EE8B8B2413191F00E794D6 /* WebXRPose.cpp in Sources */,
+                               E1EE8B7F2413191F00E794D6 /* WebXRReferenceSpace.cpp in Sources */,
+                               E1EE8B7C2413191F00E794D6 /* WebXRRenderState.cpp in Sources */,
+                               E1EE8B7B2413191F00E794D6 /* WebXRRigidTransform.cpp in Sources */,
+                               E1EE8BA22413196300E794D6 /* WebXRSession.cpp in Sources */,
+                               E1EE8B982413195000E794D6 /* WebXRSpace.cpp in Sources */,
+                               E1EE8B8E2413195000E794D6 /* WebXRSystem.cpp in Sources */,
+                               E1EE8BA42413196300E794D6 /* WebXRView.cpp in Sources */,
+                               E1EE8BA02413195000E794D6 /* WebXRViewerPose.cpp in Sources */,
+                               E1EE8B912413195000E794D6 /* WebXRViewport.cpp in Sources */,
+                               E1EE8B832413191F00E794D6 /* WebXRWebGLLayer.cpp in Sources */,
                                A14832C2187F65C700DA63A6 /* WKUtilities.c in Sources */,
                                A833C7CC0A2CF07400D57664 /* XLinkNames.cpp in Sources */,
                                A833C80C0A2CF25600D57664 /* XMLNames.cpp in Sources */,
                                E15A36D91104572700B7B639 /* XMLNSNames.cpp in Sources */,
+                               E1EE8B7A2413191F00E794D6 /* XRInputSourceEvent.cpp in Sources */,
+                               E1EE8BA72413196300E794D6 /* XRInputSourcesChangeEvent.cpp in Sources */,
+                               E1EE8B952413195000E794D6 /* XRReferenceSpaceEvent.cpp in Sources */,
+                               E1EE8B852413191F00E794D6 /* XRSessionEvent.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index 305bcf5..94f3165 100644 (file)
@@ -62,6 +62,7 @@ template<typename T>
 struct IDLType {
     using ImplementationType = T;
     using StorageType = T;
+    using SequenceStorageType = T;
 
     using ParameterType = T;
     using NullableParameterType = Optional<ImplementationType>;
@@ -82,6 +83,7 @@ struct IDLUnsupportedType : IDLType<void> { };
 struct IDLNull : IDLType<std::nullptr_t> { };
 
 struct IDLAny : IDLType<JSC::Strong<JSC::Unknown>> {
+    using SequenceStorageType = JSC::JSValue;
     using ParameterType = JSC::JSValue;
     using NullableParameterType = JSC::JSValue;
 
index c49dd93..86f7f27 100644 (file)
@@ -40,7 +40,7 @@ namespace Detail {
 
 template<typename IDLType>
 struct GenericSequenceConverter {
-    using ReturnType = Vector<typename IDLType::ImplementationType>;
+    using ReturnType = Vector<typename IDLType::SequenceStorageType>;
 
     static ReturnType convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSObject* object)
     {
index 44d50b2..1882a9e 100644 (file)
@@ -235,6 +235,25 @@ namespace WebCore {
     macro(WorkletGlobalScope) \
     macro(WritableStream) \
     macro(XMLHttpRequest) \
+    macro(XRBoundedReferenceSpace) \
+    macro(XRFrame) \
+    macro(XRInputSource) \
+    macro(XRInputSourceArray) \
+    macro(XRInputSourceEvent) \
+    macro(XRInputSourcesChangeEvent) \
+    macro(XRPose) \
+    macro(XRReferenceSpace) \
+    macro(XRReferenceSpaceEvent) \
+    macro(XRRenderState) \
+    macro(XRRigidTransform) \
+    macro(XRSession) \
+    macro(XRSessionEvent) \
+    macro(XRSpace) \
+    macro(XRSystem) \
+    macro(XRView) \
+    macro(XRViewerPose) \
+    macro(XRViewport) \
+    macro(XRWebGLLayer) \
     macro(appendFromJS) \
     macro(associatedReadableByteStreamController) \
     macro(autoAllocateChunkSize) \
index d4960b9..5ceee6f 100644 (file)
@@ -148,6 +148,7 @@ namespace WebCore {
     macro(icegatheringstatechange) \
     macro(inactive) \
     macro(input) \
+    macro(inputsourceschange) \
     macro(install) \
     macro(invalid) \
     macro(keydown) \
@@ -231,6 +232,7 @@ namespace WebCore {
     macro(seeked) \
     macro(seeking) \
     macro(select) \
+    macro(selectend) \
     macro(selectionchange) \
     macro(selectstart) \
     macro(shippingaddresschange) \
@@ -285,13 +287,6 @@ namespace WebCore {
     macro(versionchange) \
     macro(visibilitychange) \
     macro(volumechange) \
-    macro(vrdisplayactivate) \
-    macro(vrdisplayblur) \
-    macro(vrdisplayconnect) \
-    macro(vrdisplaydeactivate) \
-    macro(vrdisplaydisconnect) \
-    macro(vrdisplayfocus) \
-    macro(vrdisplaypresentchange) \
     macro(waiting) \
     macro(waitingforkey) \
     macro(webglcontextchanged) \
index a590861..aeb234a 100644 (file)
@@ -85,3 +85,7 @@ MediaKeyMessageEvent conditional=ENCRYPTED_MEDIA
 PointerEvent
 GPUUncapturedErrorEvent conditional=WEBGPU
 EnterPictureInPictureEvent conditional=PICTURE_IN_PICTURE_API
+XRInputSourceEvent conditional=WEBXR
+XRInputSourcesChangeEvent conditional=WEBXR
+XRReferenceSpaceEvent conditional=WEBXR
+XRSessionEvent conditional=WEBXR
index 81e7cc9..837eb5d 100644 (file)
@@ -58,4 +58,6 @@ Worker
 WorkletGlobalScope conditional=CSS_PAINTING_API
 XMLHttpRequest
 XMLHttpRequestUpload
-
+WebXRSession conditional=WEBXR
+WebXRSpace conditional=WEBXR
+WebXRSystem conditional=WEBXR
index 5d1afdb..de7e38d 100644 (file)
@@ -138,6 +138,11 @@ public:
     void setInspectorAdditionsEnabled(bool isEnabled) { m_inspectorAdditionsEnabled = isEnabled; }
     bool inspectorAdditionsEnabled() const { return m_inspectorAdditionsEnabled; }
 
+#if ENABLE(WEBXR)
+    void setWebXREnabled(bool isEnabled) { m_webXREnabled = isEnabled; }
+    bool webXREnabled() const { return m_webXREnabled; }
+#endif
+
     void setAccessibilityObjectModelEnabled(bool isEnabled) { m_accessibilityObjectModelEnabled = isEnabled; }
     bool accessibilityObjectModelEnabled() const { return m_accessibilityObjectModelEnabled; }
 
@@ -446,6 +451,9 @@ private:
     bool m_isWebSocketEnabled { true };
     bool m_fetchAPIKeepAliveEnabled { false };
     bool m_inspectorAdditionsEnabled { false };
+#if ENABLE(WEBXR)
+    bool m_webXREnabled { false };
+#endif
     bool m_accessibilityObjectModelEnabled { false };
     bool m_ariaReflectionEnabled { true };
     bool m_itpDebugMode { false };
diff --git a/Source/WebCore/platform/xr/PlatformXR.cpp b/Source/WebCore/platform/xr/PlatformXR.cpp
new file mode 100644 (file)
index 0000000..17268ee
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Copyright (C) 2020 Igalia, S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "PlatformXR.h"
diff --git a/Source/WebCore/platform/xr/PlatformXR.h b/Source/WebCore/platform/xr/PlatformXR.h
new file mode 100644 (file)
index 0000000..c0883bd
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2020 Igalia, S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+#pragma once
+
+#include <memory>
+#include <wtf/WeakPtr.h>
+
+namespace PlatformXR {
+
+enum class SessionMode {
+    Inline,
+    ImmersiveVr,
+    ImmersiveAr,
+};
+
+#if ENABLE(WEBXR)
+
+class Device : public CanMakeWeakPtr<Device> {
+public:
+};
+
+class Instance {
+public:
+    static Instance& singleton();
+
+private:
+    Instance();
+    ~Instance();
+
+    struct Impl;
+    std::unique_ptr<Impl> m_impl;
+};
+
+#endif // ENABLE(WEBXR)
+
+} // namespace PlatformXR
diff --git a/Source/WebCore/platform/xr/openxr/PlatformXR.cpp b/Source/WebCore/platform/xr/openxr/PlatformXR.cpp
new file mode 100644 (file)
index 0000000..ca4f4c2
--- /dev/null
@@ -0,0 +1,166 @@
+/*
+ * Copyright (C) 2020 Igalia, S.L.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * aint with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "PlatformXR.h"
+
+#if ENABLE(WEBXR)
+
+#if USE_OPENXR
+#include <openxr/openxr.h>
+#include <wtf/text/StringConcatenateNumbers.h>
+#include <wtf/text/WTFString.h>
+#endif // USE_OPENXR
+#include <wtf/NeverDestroyed.h>
+
+namespace PlatformXR {
+
+#if USE_OPENXR
+
+template<typename T, XrStructureType StructureType>
+T createStructure()
+{
+    T object;
+    std::memset(&object, 0, sizeof(T));
+    object.type = StructureType;
+    object.next = nullptr;
+    return object;
+}
+
+String resultToString(XrResult value, XrInstance instance)
+{
+    char buffer[XR_MAX_RESULT_STRING_SIZE];
+    XrResult result = xrResultToString(instance, value, buffer);
+    if (result == XR_SUCCESS)
+        return String(buffer);
+    return makeString("<unknown ", int(value), ">");
+}
+
+#define RETURN_IF_FAILED(result, call, instance)                                                     \
+    if (XR_FAILED(result)) {                                                                         \
+        WTFLogAlways("%s %s: %s\n", __func__, call, resultToString(result, instance).utf8().data()); \
+        return;                                                                                      \
+    }                                                                                                \
+
+#endif // USE_OPENXR
+
+struct Instance::Impl {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    Impl();
+    ~Impl();
+
+#if USE_OPENXR
+    XrInstance m_instance { XR_NULL_HANDLE };
+#endif // USE_OPENXR
+};
+
+Instance::Impl::Impl()
+{
+#if USE_OPENXR
+    WTFLogAlways("OpenXR: initializing\n");
+
+    [&] {
+        uint32_t propertyCountOutput { 0 };
+        XrResult result = xrEnumerateApiLayerProperties(0, &propertyCountOutput, nullptr);
+        RETURN_IF_FAILED(result, "xrEnumerateApiLayerProperties()", m_instance);
+
+        if (!propertyCountOutput) {
+            WTFLogAlways("xrEnumerateApiLayerProperties(): no properties\n");
+            return;
+        }
+
+        Vector<XrApiLayerProperties> properties(propertyCountOutput);
+        result = xrEnumerateApiLayerProperties(propertyCountOutput, nullptr, properties.data());
+        RETURN_IF_FAILED(result, "xrEnumerateApiLayerProperties()", m_instance);
+
+        WTFLogAlways("xrEnumerateApiLayerProperties(): %zu properties\n", properties.size());
+    }();
+
+    [&] {
+        uint32_t propertyCountOutput { 0 };
+        XrResult result = xrEnumerateInstanceExtensionProperties(nullptr, 0, &propertyCountOutput, nullptr);
+        RETURN_IF_FAILED(result, "xrEnumerateInstanceExtensionProperties()", m_instance);
+
+        if (!propertyCountOutput) {
+            WTFLogAlways("xrEnumerateInstanceExtensionProperties(): no properties\n");
+            return;
+        }
+
+        Vector<XrExtensionProperties> properties(propertyCountOutput,
+            [] {
+                XrExtensionProperties object;
+                std::memset(&object, 0, sizeof(XrExtensionProperties));
+                object.type = XR_TYPE_EXTENSION_PROPERTIES;
+                return object;
+            }());
+        uint32_t propertyCountWritten { 0 };
+        result = xrEnumerateInstanceExtensionProperties(nullptr, propertyCountOutput, &propertyCountWritten, properties.data());
+        RETURN_IF_FAILED(result, "xrEnumerateInstanceExtensionProperties()", m_instance);
+
+        WTFLogAlways("xrEnumerateInstanceExtensionProperties(): %zu extension properties\n", properties.size());
+        for (auto& property : properties) {
+            WTFLogAlways("  extension '%s', version %u\n",
+                property.extensionName, property.extensionVersion);
+        }
+    }();
+
+    static const char* s_applicationName = "WebXR (WebKit)";
+    static const uint32_t s_applicationVersion = 1;
+
+    {
+        auto createInfo = createStructure<XrInstanceCreateInfo, XR_TYPE_INSTANCE_CREATE_INFO>();
+        createInfo.createFlags = 0;
+        std::memcpy(createInfo.applicationInfo.applicationName, s_applicationName, XR_MAX_APPLICATION_NAME_SIZE);
+        createInfo.applicationInfo.apiVersion = XR_CURRENT_API_VERSION;
+        createInfo.applicationInfo.applicationVersion = s_applicationVersion;
+        createInfo.enabledApiLayerCount = 0;
+        createInfo.enabledExtensionCount = 0;
+
+        XrInstance instance;
+        XrResult result = xrCreateInstance(&createInfo, &instance);
+        RETURN_IF_FAILED(result, "xrCreateInstance()", m_instance);
+
+        m_instance = instance;
+        WTFLogAlways("xrCreateInstance(): using instance %p\n", m_instance);
+    }
+#endif // USE_OPENXR
+}
+
+Instance::Impl::~Impl()
+{
+}
+
+Instance& Instance::singleton()
+{
+    static LazyNeverDestroyed<Instance> s_instance;
+    static std::once_flag s_onceFlag;
+    std::call_once(s_onceFlag,
+        [&] {
+            s_instance->m_impl = makeUnique<Impl>();
+        });
+    return s_instance.get();
+}
+
+Instance::Instance() = default;
+Instance::~Instance() = default;
+
+} // namespace PlatformXR
+
+#endif // ENABLE(WEBXR)
index 88e486c..36b80db 100644 (file)
@@ -1,3 +1,20 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        Added WebXR to the list of experimental features.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR off by default.
+        * Shared/WebPreferences.yaml: Added WebXR feature.
+        * Shared/WebPreferencesDefaultValues.cpp:
+        (WebKit::defaultWebXREnabled): Set WebXR to off by default unless HAVE_SYSTEM_FEATURE_FLAGS.
+        * Shared/WebPreferencesDefaultValues.h:
+        * WebProcess/InjectedBundle/InjectedBundle.cpp:
+        (WebKit::InjectedBundle::overrideBoolPreferenceForTestRunner):
+
 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
 
         [iOS] Add telemetry for message filtering
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
index 0b3ce94..3c9ab03 100644 (file)
@@ -1982,6 +1982,15 @@ IncrementalPDFLoadingEnabled:
   condition: HAVE(INCREMENTAL_PDF_APIS)
   webcoreBinding: RuntimeEnabledFeatures
 
+WebXREnabled:
+  type: bool
+  defaultValue: defaultWebXREnabled()
+  humanReadableName: "WebXR Device API"
+  humanReadableDescription: "Adds support for accessing virtual reality (VR) and augmented reality (AR) devices, including sensors and head-mounted displays, on the Web"
+  category: experimental
+  webcoreBinding: RuntimeEnabledFeatures
+  condition: ENABLE(WEBXR)
+
 # Deprecated
 
 ICECandidateFilteringEnabled:
index 7ddac13..ecf3f03 100644 (file)
@@ -225,4 +225,18 @@ bool defaultIncrementalPDFEnabled()
 }
 #endif
 
+#if ENABLE(WEBXR)
+
+bool defaultWebXREnabled()
+{
+#if HAVE(HAVE_SYSTEM_FEATURE_FLAGS)
+    return os_feature_enabled(WebKit, WebXR);
+#endif
+
+    return false;
+}
+
+#endif // ENABLE(WEBXR)
+
+
 } // namespace WebKit
index 717cf24..2955a09 100644 (file)
@@ -332,4 +332,8 @@ bool defaultInAppBrowserPrivacy();
 bool defaultIncrementalPDFEnabled();
 #endif
 
+#if ENABLE(WEBXR)
+bool defaultWebXREnabled();
+#endif
+
 } // namespace WebKit
index 5615b99..f3e6ab7 100644 (file)
@@ -289,6 +289,11 @@ void InjectedBundle::overrideBoolPreferenceForTestRunner(WebPageGroupProxy* page
         RuntimeEnabledFeatures::sharedFeatures().setOffscreenCanvasEnabled(enabled);
 #endif
 
+#if ENABLE(WEBXR)
+    if (preference == "WebKitWebXREnabled")
+        RuntimeEnabledFeatures::sharedFeatures().setWebXREnabled(enabled);
+#endif
+
     // Map the names used in LayoutTests with the names used in WebCore::Settings and WebPreferencesStore.
 #define FOR_EACH_OVERRIDE_BOOL_PREFERENCE(macro) \
     macro(WebKitJavaEnabled, JavaEnabled, javaEnabled) \
index f80267a..654b453 100644 (file)
@@ -1,3 +1,12 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        * Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.
+
 2020-03-15  Yusuke Suzuki  <ysuzuki@apple.com>
 
         Should not use variable-length-array (VLA)
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
diff --git a/Source/cmake/FindOpenXR.cmake b/Source/cmake/FindOpenXR.cmake
new file mode 100644 (file)
index 0000000..bbfdf04
--- /dev/null
@@ -0,0 +1,47 @@
+# - Try to find OpenXR.
+# Once done, this will define
+#
+#  OPENXR_FOUND - system has WPE.
+#  OPENXR_INCLUDE_DIRS - the WPE include directories
+#  OPENXR_LIBRARIES - link these to use WPE.
+#
+# Copyright (C) 2019 Igalia S.L.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND ITS CONTRIBUTORS ``AS
+# IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR ITS
+# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+find_package(PkgConfig)
+pkg_check_modules(PC_OPENXR QUIET openxr)
+
+find_path(OPENXR_INCLUDE_DIRS
+    NAMES openxr/openxr.h
+    HINTS ${PC_OPENXR_INCLUDEDIR} ${PC_OPENXR_INCLUDE_DIRS}
+)
+
+find_library(OPENXR_LIBRARIES
+    NAMES openxr_loader
+    HINTS ${PC_OPENXR_LIBDIR} ${PC_OPENXR_LIBRARY_DIRS}
+)
+
+mark_as_advanced(OPENXR_INCLUDE_DIRS OPENXR_LIBRARIES)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(OpenXR REQUIRED_VARS OPENXR_INCLUDE_DIRS OPENXR_LIBRARIES)
index dff6491..05531cf 100644 (file)
@@ -49,6 +49,9 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_XSLT PUBLIC ON)
 # Changing these options is completely unsupported.
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_ASYNC_SCROLLING PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_AUTOCAPITALIZE PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_CONIC_GRADIENTS PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_PAINTING_API PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_TYPED_OM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CONTENT_EXTENSIONS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_LAYOUT_FORMATTING_CONTEXT PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_MEDIA_STREAM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
@@ -62,9 +65,7 @@ WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_SMOOTH_SCROLLING PRIVATE OFF)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_TOUCH_EVENTS PRIVATE ON)
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBGL2 PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
 WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEB_RTC PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_PAINTING_API PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_TYPED_OM PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
-WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_CSS_CONIC_GRADIENTS PRIVATE ON)
+WEBKIT_OPTION_DEFAULT_PORT_VALUE(ENABLE_WEBXR PRIVATE ${ENABLE_EXPERIMENTAL_FEATURES})
 
 # Public options specific to the WPE port. Do not add any options here unless
 # there is a strong reason we should support changing the value of the option,
@@ -171,6 +172,11 @@ if (ENABLE_WPE_QT_API OR USE_WPE_VIDEO_PLANE_DISPLAY_DMABUF)
     find_package(WPEBackend_fdo 1.5.0 REQUIRED)
 endif ()
 
+if (ENABLE_WEBXR)
+    find_package(OpenXR 1.0)
+    SET_AND_EXPOSE_TO_BUILD(USE_OPENXR ${OpenXR_FOUND})
+endif ()
+
 add_definitions(-DBUILDING_WPE__=1)
 add_definitions(-DGETTEXT_PACKAGE="WPE")
 add_definitions(-DJSC_GLIB_API_ENABLED)
index ff7d6d1..b591965 100644 (file)
@@ -230,6 +230,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_AUTHN "Toggle Web AuthN support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_CRYPTO "Toggle WebCrypto Subtle-Crypto support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(ENABLE_WEB_RTC "Toggle WebRTC support" PRIVATE OFF)
+    WEBKIT_OPTION_DEFINE(ENABLE_WEBXR "Toggle WebXR support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_WIRELESS_PLAYBACK_TARGET "Toggle wireless playback target support" PRIVATE OFF)
     WEBKIT_OPTION_DEFINE(ENABLE_XSLT "Toggle XSLT support" PRIVATE ON)
     WEBKIT_OPTION_DEFINE(USE_SYSTEM_MALLOC "Toggle system allocator instead of WebKit's custom allocator" PRIVATE ${USE_SYSTEM_MALLOC_DEFAULT})
@@ -257,6 +258,7 @@ macro(WEBKIT_OPTION_BEGIN)
     WEBKIT_OPTION_DEPEND(ENABLE_VIDEO_TRACK ENABLE_VIDEO)
     WEBKIT_OPTION_DEPEND(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN ENABLE_VIDEO)
     WEBKIT_OPTION_DEPEND(ENABLE_TOUCH_SLIDER ENABLE_TOUCH_EVENTS)
+    WEBKIT_OPTION_DEPEND(ENABLE_WEBXR ENABLE_WEBGL)
 endmacro()
 
 macro(_WEBKIT_OPTION_ENFORCE_DEPENDS _name)
index 96d4600..bde2b88 100644 (file)
@@ -66,6 +66,7 @@
     <ENABLE_WEB_AUTHN />
     <ENABLE_WEBGL />
     <ENABLE_WEBGPU />
+    <ENABLE_WEBXR />
     <ENABLE_XHR_TIMEOUT>ENABLE_XHR_TIMEOUT</ENABLE_XHR_TIMEOUT>
     <ENABLE_XSLT>ENABLE_XSLT</ENABLE_XSLT>
   </PropertyGroup>
@@ -74,7 +75,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_OVERFLOW_SCROLLING_TOUCH);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DARK_MODE_CSS);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_QUOTA);$(ENABLE_STREAMS_API);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_WEB_AUDIO);$(ENABLE_WEBGL);$(ENABLE_WEBGPU);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_OVERFLOW_SCROLLING_TOUCH);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DARK_MODE_CSS);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_QUOTA);$(ENABLE_STREAMS_API);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_WEB_AUDIO);$(ENABLE_WEBGL);$(ENABLE_WEBGPU);$(ENABLE_WEBXR);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
index 24b94bc..d7194b2 100644 (file)
@@ -65,6 +65,7 @@
     <ENABLE_WEB_AUTHN />
     <ENABLE_WEBGL>ENABLE_WEBGL</ENABLE_WEBGL>
     <ENABLE_WEBGPU />
+    <ENABLE_WEBXR />
     <ENABLE_XHR_TIMEOUT>ENABLE_XHR_TIMEOUT</ENABLE_XHR_TIMEOUT>
     <ENABLE_XSLT>ENABLE_XSLT</ENABLE_XSLT>
   </PropertyGroup>
@@ -73,7 +74,7 @@
   </PropertyGroup>
   <ItemDefinitionGroup>
     <ClCompile>
-      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_OVERFLOW_SCROLLING_TOUCH);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DARK_MODE_CSS);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_QUOTA);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_WEB_AUDIO);$(ENABLE_WEBGL);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
+      <PreprocessorDefinitions>$(ENABLE_3D_TRANSFORMS);$(ENABLE_ACCELERATED_2D_CANVAS);$(ENABLE_OVERFLOW_SCROLLING_TOUCH);$(ENABLE_ATTACHMENT_ELEMENT);$(ENABLE_CHANNEL_MESSAGING);$(ENABLE_CSS3_CONDITIONAL_RULES);$(ENABLE_CSS_IMAGE_SET);$(ENABLE_CSS3_TEXT);$(ENABLE_CSS_BOX_DECORATION_BREAK);$(ENABLE_CSS_SHADERS);$(ENABLE_CSS_COMPOSITING);$(ENABLE_CSS_SELECTORS_LEVEL4);$(ENABLE_CSS_SHAPE_INSIDE);$(ENABLE_CSS_TRANSFORMS_ANIMATIONS_TRANSITIONS_UNPREFIXED);$(ENABLE_CURSOR_VISIBILITY);$(ENABLE_CUSTOM_SCHEME_HANDLER);$(ENABLE_DARK_MODE_CSS);$(ENABLE_DATAGRID);$(ENABLE_DATALIST_ELEMENT);$(ENABLE_DEVICE_ORIENTATION);$(ENABLE_DIRECTORY_UPLOAD);$(ENABLE_ENCRYPTED_MEDIA);$(ENABLE_FETCH_API);$(ENABLE_FILE_SYSTEM);$(ENABLE_FULLSCREEN_API);$(ENABLE_GAMEPAD);$(ENABLE_GEOLOCATION);$(ENABLE_HIGH_DPI_CANVAS);$(ENABLE_INDEXED_DATABASE);$(ENABLE_INPUT_TYPE_COLOR);$(ENABLE_INPUT_SPEECH);$(ENABLE_INPUT_TYPE_DATE);$(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE);$(ENABLE_INPUT_TYPE_DATETIMELOCAL);$(ENABLE_INPUT_TYPE_MONTH);$(ENABLE_INPUT_TYPE_TIME);$(ENABLE_INPUT_TYPE_WEEK);$(ENABLE_INTL);$(ENABLE_LEGACY_CSS_VENDOR_PREFIXES);$(ENABLE_LEGACY_ENCRYPTED_MEDIA);$(ENABLE_LINK_PRERENDER);$(ENABLE_MATHML);$(ENABLE_METER_ELEMENT);$(ENABLE_MICRODATA);$(ENABLE_MOUSE_CURSOR_SCALE);$(ENABLE_NOTIFICATIONS);$(ENABLE_QUOTA);$(ENABLE_SCRIPTED_SPEECH);$(ENABLE_SHARED_WORKERS);$(ENABLE_MEDIA_CONTROLS_SCRIPT);$(ENABLE_MEDIA_SOURCE);$(ENABLE_MEDIA_STATISTICS);$(ENABLE_SQL_DATABASE);$(ENABLE_STYLE_SCOPED);$(ENABLE_SUBPIXEL_LAYOUT);$(ENABLE_SVG_DOM_OBJC_BINDINGS);$(ENABLE_SVG_FONTS);$(ENABLE_VIDEO);$(ENABLE_VIDEO_TRACK);$(ENABLE_WEB_AUDIO);$(ENABLE_WEBGL);$(ENABLE_WEBXR);$(ENABLE_XHR_TIMEOUT);$(ENABLE_XSLT);%(PreprocessorDefinitions)</PreprocessorDefinitions>
     </ClCompile>
   </ItemDefinitionGroup>
   <ItemGroup>
index 233b607..cd23f74 100644 (file)
@@ -1,3 +1,13 @@
+2020-03-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        [WebXR] IDLs, stubs and build configuration for WPE
+        https://bugs.webkit.org/show_bug.cgi?id=208702
+
+        Reviewed by Dean Jackson.
+
+        * Scripts/webkitperl/FeatureList.pm: Added WebXR.
+        * TestWebKitAPI/Configurations/FeatureDefines.xcconfig: Added ENABLE_WEBXR, off by default.
+
 2020-03-16  Per Arne Vollan  <pvollan@apple.com>
 
         [Cocoa] Limit set of classes that can be decoded when a preference has changed
index 1c84015..763aa2e 100644 (file)
@@ -189,6 +189,7 @@ my (
     $webgl2Support,
     $webglSupport,
     $webgpuSupport,
+    $webXRSupport,
     $wirelessPlaybackTargetSupport,
     $xsltSupport,
 );
@@ -595,6 +596,9 @@ my @features = (
     { option => "webgpu", desc => "Toggle WebGPU support",
       define => "ENABLE_WEBGPU", value => \$webgpuSupport },
 
+    { option => "webxr", desc => "Toggle WebXR support",
+      define => "ENABLE_WEBXR", value => \$webXRSupport },
+
     { option => "web-api-statistics", desc => "Toggle Web API statistics support",
       define => "ENABLE_WEB_API_STATISTICS", value => \$webAPIStatisticsSupport },
 
index e6a3002..cfbb729 100644 (file)
@@ -394,6 +394,8 @@ ENABLE_WEBGPU_appletvos = ENABLE_WEBGPU;
 ENABLE_WEBGPU_macosx = $(ENABLE_WEBGPU$(WK_MACOS_1014));
 ENABLE_WEBGPU_MACOS_SINCE_1014 = ENABLE_WEBGPU;
 
+ENABLE_WEBXR = ;
+
 ENABLE_WEB_API_STATISTICS = ;
 
 ENABLE_WEB_AUDIO = ENABLE_WEB_AUDIO;
@@ -414,4 +416,4 @@ ENABLE_WIRELESS_PLAYBACK_TARGET = ENABLE_WIRELESS_PLAYBACK_TARGET;
 
 ENABLE_XSLT = ENABLE_XSLT;
 
-FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);
+FEATURE_DEFINES = $(ENABLE_3D_TRANSFORMS) $(ENABLE_ACCELERATED_2D_CANVAS) $(ENABLE_ACCESSIBILITY_ISOLATED_TREE) $(ENABLE_APPLE_PAY) $(ENABLE_APPLE_PAY_SESSION_V3) $(ENABLE_APPLE_PAY_SESSION_V4) $(ENABLE_APPLE_PAY_SESSION_V9) $(ENABLE_APPLICATION_MANIFEST) $(ENABLE_ATTACHMENT_ELEMENT) $(ENABLE_AVF_CAPTIONS) $(ENABLE_CACHE_PARTITIONING) $(ENABLE_CHANNEL_MESSAGING) $(ENABLE_CONTENT_FILTERING) $(ENABLE_CSS3_TEXT) $(ENABLE_CSS_BOX_DECORATION_BREAK) $(ENABLE_CSS_COMPOSITING) $(ENABLE_CSS_CONIC_GRADIENTS) $(ENABLE_CSS_IMAGE_RESOLUTION) $(ENABLE_CSS_PAINTING_API) $(ENABLE_CSS_SCROLL_SNAP) $(ENABLE_CSS_SELECTORS_LEVEL4) $(ENABLE_CSS_TRAILING_WORD) $(ENABLE_CSS_TYPED_OM) $(ENABLE_CURSOR_VISIBILITY) $(ENABLE_C_LOOP) $(ENABLE_DARK_MODE_CSS) $(ENABLE_DATACUE_VALUE) $(ENABLE_DATALIST_ELEMENT) $(ENABLE_DATA_INTERACTION) $(ENABLE_DEVICE_ORIENTATION) $(ENABLE_DRAG_SUPPORT) $(ENABLE_ENCRYPTED_MEDIA) $(ENABLE_EXPERIMENTAL_FEATURES) $(ENABLE_FILTERS_LEVEL_2) $(ENABLE_FULLSCREEN_API) $(ENABLE_PICTURE_IN_PICTURE_API) $(ENABLE_GAMEPAD) $(ENABLE_GEOLOCATION) $(ENABLE_GPU_PROCESS) $(ENABLE_INDEXED_DATABASE) $(ENABLE_INDEXED_DATABASE_IN_WORKERS) $(ENABLE_INPUT_TYPE_COLOR) $(ENABLE_INPUT_TYPE_DATE) $(ENABLE_INPUT_TYPE_DATETIMELOCAL) $(ENABLE_INPUT_TYPE_DATETIME_INCOMPLETE) $(ENABLE_INPUT_TYPE_MONTH) $(ENABLE_INPUT_TYPE_TIME) $(ENABLE_INPUT_TYPE_WEEK) $(ENABLE_INSPECTOR_ALTERNATE_DISPATCHERS) $(ENABLE_INSPECTOR_TELEMETRY) $(ENABLE_INTERSECTION_OBSERVER) $(ENABLE_IOS_GESTURE_EVENTS) $(ENABLE_IOS_TOUCH_EVENTS) $(ENABLE_LAYOUT_FORMATTING_CONTEXT) $(ENABLE_LEGACY_CSS_VENDOR_PREFIXES) $(ENABLE_LEGACY_CUSTOM_PROTOCOL_MANAGER) $(ENABLE_LEGACY_ENCRYPTED_MEDIA) $(ENABLE_LETTERPRESS) $(ENABLE_MAC_GESTURE_EVENTS) $(ENABLE_MATHML) $(ENABLE_MEDIA_CAPTURE) $(ENABLE_MEDIA_CONTROLS_SCRIPT) $(ENABLE_MEDIA_SESSION) $(ENABLE_MEDIA_SOURCE) $(ENABLE_MEDIA_STATISTICS) $(ENABLE_MEDIA_STREAM) $(ENABLE_MEMORY_SAMPLER) $(ENABLE_METER_ELEMENT) $(ENABLE_MHTML) $(ENABLE_MOUSE_CURSOR_SCALE) $(ENABLE_NAVIGATOR_STANDALONE) $(ENABLE_NETWORK_CACHE_SPECULATIVE_REVALIDATION) $(ENABLE_NETWORK_CACHE_STALE_WHILE_REVALIDATE) $(ENABLE_NOTIFICATIONS) $(ENABLE_OFFSCREEN_CANVAS) $(ENABLE_OVERFLOW_SCROLLING_TOUCH) $(ENABLE_PAYMENT_REQUEST) $(ENABLE_PDFKIT_PLUGIN) $(ENABLE_POINTER_LOCK) $(ENABLE_PUBLIC_SUFFIX_LIST) $(ENABLE_QUOTA) $(ENABLE_REMOTE_INSPECTOR) $(ENABLE_RESIZE_OBSERVER) $(ENABLE_RESOLUTION_MEDIA_QUERY) $(ENABLE_RESOURCE_LOAD_STATISTICS) $(ENABLE_RESOURCE_USAGE) $(ENABLE_RUBBER_BANDING) $(ENABLE_SANDBOX_EXTENSIONS) $(ENABLE_SERVER_PRECONNECT) $(ENABLE_SERVICE_CONTROLS) $(ENABLE_SERVICE_WORKER) $(ENABLE_SHAREABLE_RESOURCE) $(ENABLE_SPEECH_SYNTHESIS) $(ENABLE_STREAMS_API) $(ENABLE_SVG_FONTS) $(ENABLE_TELEPHONE_NUMBER_DETECTION) $(ENABLE_TEXT_AUTOSIZING) $(ENABLE_TOUCH_EVENTS) $(ENABLE_USERSELECT_ALL) $(ENABLE_USER_MESSAGE_HANDLERS) $(ENABLE_VARIATION_FONTS) $(ENABLE_VIDEO) $(ENABLE_VIDEO_PRESENTATION_MODE) $(ENABLE_VIDEO_TRACK) $(ENABLE_VIDEO_USES_ELEMENT_FULLSCREEN) $(ENABLE_WEBDRIVER_MOUSE_INTERACTIONS) $(ENABLE_WEBDRIVER_KEYBOARD_INTERACTIONS) $(ENABLE_WEBDRIVER_TOUCH_INTERACTIONS) $(ENABLE_WEBGL) $(ENABLE_WEBGL2) $(ENABLE_WEBGPU) $(ENABLE_WEBXR) $(ENABLE_WEB_API_STATISTICS) $(ENABLE_WEB_AUDIO) $(ENABLE_WEB_AUTHN) $(ENABLE_WEB_CRYPTO) $(ENABLE_WEB_RTC) $(ENABLE_WIRELESS_PLAYBACK_TARGET) $(ENABLE_XSLT);