WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch for landing v3
bug-208702-20200316105147.patch (text/plain), 327.78 KB, created by
Sergio Villar Senin
on 2020-03-16 02:51:52 PDT
(
hide
)
Description:
Patch for landing v3
Filename:
MIME Type:
Creator:
Sergio Villar Senin
Created:
2020-03-16 02:51:52 PDT
Size:
327.78 KB
patch
obsolete
>Subversion Revision: 258489 >diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog >index c11a293937fbb18240bf032ed61854dc61dd052c..7455aaf1df25d61e653c984c78dfb6722809d7d7 100644 >--- a/Source/JavaScriptCore/ChangeLog >+++ b/Source/JavaScriptCore/ChangeLog >@@ -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 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index e31455490234b4a81e666ade66ad7a7799f1cea6..d1e53259cbf5166e1e53928ee3ecd807d96c3ad2 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -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 Rob Buis <rbuis@igalia.com> > > Remove addHTTPOriginIfNeeded calls >diff --git a/Source/WebCore/PAL/ChangeLog b/Source/WebCore/PAL/ChangeLog >index dca58cb296b86ed0f4d1c4893c4b7b891b53c2af..6e7d9aa27389a9466020147a25ee844280e5f295 100644 >--- a/Source/WebCore/PAL/ChangeLog >+++ b/Source/WebCore/PAL/ChangeLog >@@ -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) >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 70ff6e0b9899349e3382eee781b396572e3da71e..3f3e406f6b5818ce337820437790d700cde07b9d 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -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 Rob Buis <rbuis@igalia.com> > > Simplify ChromeClient.createWindow >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index f80267a590f3db013e5b4ef9b551589db773ebe1..654b4534a842fd0331a105d1898b340de0d08b4a 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -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) >diff --git a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/JavaScriptCore/Configurations/FeatureDefines.xcconfig >@@ -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/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h >index dedfa14d5a5ddda84e335bfd485e755097faec57..6802cc8ccb15a84f11d0d3f077fce927b6440690 100644 >--- a/Source/WTF/wtf/Platform.h >+++ b/Source/WTF/wtf/Platform.h >@@ -180,6 +180,7 @@ > #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) >@@ -190,3 +191,4 @@ > #if PLATFORM(COCOA) && ENABLE(ACCESSIBILITY) > #define USE_ACCESSIBILITY_CONTEXT_MENUS 1 > #endif >+ >diff --git a/Source/WebCore/CMakeLists.txt b/Source/WebCore/CMakeLists.txt >index 2efce0d3d9451c5140f7cfbe6223e2ff39287f53..1276fce1d7a4d2f0edbb226ad1773bb9f4422ad7 100644 >--- a/Source/WebCore/CMakeLists.txt >+++ b/Source/WebCore/CMakeLists.txt >@@ -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} >diff --git a/Source/WebCore/Configurations/FeatureDefines.xcconfig b/Source/WebCore/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Source/WebCore/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/Configurations/FeatureDefines.xcconfig >@@ -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/WebCore/DerivedSources.make b/Source/WebCore/DerivedSources.make >index 4d9edaf1a66b6dad957150abc649d3eed21f7641..4e92568f0722916aea928586c64976328705fe95 100644 >--- a/Source/WebCore/DerivedSources.make >+++ b/Source/WebCore/DerivedSources.make >@@ -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 >index 0000000000000000000000000000000000000000..06a4c5d783890045c13b719d39fb1d2bf2381257 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/NavigatorWebXR.cpp >@@ -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 >index 0000000000000000000000000000000000000000..ff34e4e59f39c89db2a92a4160b8803ee07f42db >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/NavigatorWebXR.h >@@ -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 >index 0000000000000000000000000000000000000000..d9bbf5dd1399434a3c6366d50def067536e8d13a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/NavigatorWebXR.idl >@@ -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 >index 0000000000000000000000000000000000000000..8bdeda35230eb730d7e56bde5bd52aa2b3261f3d >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.cpp >@@ -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 >index 0000000000000000000000000000000000000000..9b3b74f3e2ad43785cee036db8e32ae62d9d48d6 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.h >@@ -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 >index 0000000000000000000000000000000000000000..d5b88337423d06aa9fa4d5541b6c5104f0e47e4d >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRBoundedReferenceSpace.idl >@@ -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 >index 0000000000000000000000000000000000000000..935dc127c9d07a7c8d2384154587d5135887ae1a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRFrame.cpp >@@ -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 >index 0000000000000000000000000000000000000000..808a6764f0d2c5ae61e4d658c28250579fe5b627 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRFrame.h >@@ -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 >index 0000000000000000000000000000000000000000..21fcf3cfe4d9c75fd7f468e497db8e8007b8adf2 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRFrame.idl >@@ -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 >index 0000000000000000000000000000000000000000..f3076751198dbbc376cb9719b8a87b12c62018dd >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSource.cpp >@@ -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 >index 0000000000000000000000000000000000000000..68c29ab1cdb906dbe14bb9492ab2fd88b41d4112 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSource.h >@@ -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 >index 0000000000000000000000000000000000000000..0459f3fe4707521137bf53f1a344eddd98ebd369 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSource.idl >@@ -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 >index 0000000000000000000000000000000000000000..c4c085532bcd9aac2738090bfa3fddfea43355d3 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp >@@ -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 >index 0000000000000000000000000000000000000000..f421f029e64cb08a2bb9b6a65685da0d5987d025 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.h >@@ -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 >index 0000000000000000000000000000000000000000..fcad84ac055fe6051019ae7c772c042c9e02c717 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRInputSourceArray.idl >@@ -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 >index 0000000000000000000000000000000000000000..1c5f80a54455cbe8fcb072d547b3196a98878658 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRPose.cpp >@@ -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 >index 0000000000000000000000000000000000000000..29919d24c3953aa39a2c4894bc7cce5c29c17e6a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRPose.h >@@ -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 >index 0000000000000000000000000000000000000000..4c4e9dadc8ea0af31518694193b9249644788026 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRPose.idl >@@ -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 >index 0000000000000000000000000000000000000000..b33bf708cc427c81906b03e58ecd928a30ff0cd9 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.cpp >@@ -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 >index 0000000000000000000000000000000000000000..26bb48cbf69038fea2bd314826396b93d21353cd >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.h >@@ -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 >index 0000000000000000000000000000000000000000..283507f445a52fe2e171966f5073bc13b49fc53b >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRReferenceSpace.idl >@@ -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 >index 0000000000000000000000000000000000000000..06789f819271e91565269da3f3b961d33d9976ae >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRenderState.cpp >@@ -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 >index 0000000000000000000000000000000000000000..3f292ac1d681a469876018189a87a96f1edbac7d >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRenderState.h >@@ -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 >index 0000000000000000000000000000000000000000..ae1ace6552c349e84a22a256cd60dc2cc3ca0335 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRenderState.idl >@@ -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 >index 0000000000000000000000000000000000000000..d3fdcfb90e725b179780054ba6e7ba5464ff989d >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRigidTransform.cpp >@@ -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 >index 0000000000000000000000000000000000000000..2f7cc1e7ab718d04f120168843bbb46f1f845415 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRigidTransform.h >@@ -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 >index 0000000000000000000000000000000000000000..e00cad7f2e073341ee56353e7109bbe2f1680523 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRRigidTransform.idl >@@ -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 >index 0000000000000000000000000000000000000000..ed3562f2e3f6c8d88943b09138f7668702157a2f >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSession.cpp >@@ -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 >index 0000000000000000000000000000000000000000..78c21ca9a9374fe8db1564fe1a68540a9e1469f9 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSession.h >@@ -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 >index 0000000000000000000000000000000000000000..f9b43079c06205f1efe82d506c48c1ea07fedcfd >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSession.idl >@@ -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 >index 0000000000000000000000000000000000000000..a555dfeb0559570ccc2c9d76f7634b9777488dec >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSpace.cpp >@@ -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 >index 0000000000000000000000000000000000000000..2b4a8a40d3d36f0b8e7d6021008c6f51a88ab121 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSpace.h >@@ -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 >index 0000000000000000000000000000000000000000..bb794f18b233170676d1d5499b9a17116aee7cb1 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSpace.idl >@@ -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 >index 0000000000000000000000000000000000000000..3ac4d5280344ea43611384e261a5ffdaf2c1310c >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSystem.cpp >@@ -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 >index 0000000000000000000000000000000000000000..e9ab15d7aea445d1332fc212a456845dced9cee1 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSystem.h >@@ -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 >index 0000000000000000000000000000000000000000..38a760cca9d6df33826fd3e3daf8232051f390a0 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRSystem.idl >@@ -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 >index 0000000000000000000000000000000000000000..24403b70ddc1dcf998f318301ca6d00523d0aca6 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRView.cpp >@@ -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 >index 0000000000000000000000000000000000000000..f3580c6cf7b529b7bee8b9988bfee94ebe8e3829 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRView.h >@@ -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 >index 0000000000000000000000000000000000000000..d25f429814662173214c47d6d5c142e358e21923 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRView.idl >@@ -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 >index 0000000000000000000000000000000000000000..6063c95f3643adab0a281da88b3cbae65a797b09 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewerPose.cpp >@@ -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 >index 0000000000000000000000000000000000000000..a4ed25b10c25319a6e9218528064e51c8d4d8f20 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewerPose.h >@@ -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 >index 0000000000000000000000000000000000000000..d1beb2c086f89bfafdf5e0bf1f95c0f48c607613 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewerPose.idl >@@ -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 >index 0000000000000000000000000000000000000000..cbaa3c8a5a93e6d1e9e693a19d410cfcd53f9ddb >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewport.cpp >@@ -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 >index 0000000000000000000000000000000000000000..2f8246a9b1d4eaa3a0411164b16b5e469c203014 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewport.h >@@ -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 >index 0000000000000000000000000000000000000000..99b51ecf14c363f183458335789d7d0ccff2c972 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRViewport.idl >@@ -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 >index 0000000000000000000000000000000000000000..9a78e8b0b67d031814a9eead6d822c56a87f06a7 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.cpp >@@ -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 >index 0000000000000000000000000000000000000000..52d0483ed5fb61e2023b439ed1ff2611bf1bfc11 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.h >@@ -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 >index 0000000000000000000000000000000000000000..08bad37bd7c2a39ce169a06644f8a4959ceb9661 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/WebXRWebGLLayer.idl >@@ -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 >index 0000000000000000000000000000000000000000..66f4072a715cdf5cb7133b329f9cb8ea578760ff >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.h >@@ -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 >index 0000000000000000000000000000000000000000..eefa088cfced6109e9ccb21def3c411e88ca38f4 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XREnvironmentBlendMode.idl >@@ -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 >index 0000000000000000000000000000000000000000..ea1ea7e1e7d8226325f60c826fffbc0b9ba4d66f >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XREye.h >@@ -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 >index 0000000000000000000000000000000000000000..9ad1e4304a62ea65937035465954403962038392 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XREye.idl >@@ -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 >index 0000000000000000000000000000000000000000..18504976884ec18eef381edacc2a5354f1cf2832 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRFrameRequestCallback.h >@@ -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 >index 0000000000000000000000000000000000000000..a6b151a31baf8e7b980b12f52509484fc594817d >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRFrameRequestCallback.idl >@@ -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 >index 0000000000000000000000000000000000000000..9333034d0cd49ac8dee902a081644804378cbc2c >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRHandedness.h >@@ -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 >index 0000000000000000000000000000000000000000..53f705a600beebb21e81d812f2d7d0c72c506f0a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRHandedness.idl >@@ -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 >index 0000000000000000000000000000000000000000..22631ab55297056cc063d744689d3e033ca0fa57 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourceEvent.cpp >@@ -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 >index 0000000000000000000000000000000000000000..8c7fc04747a2bf11ea8b2fb7b5ca9f454ac15303 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourceEvent.h >@@ -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 >index 0000000000000000000000000000000000000000..9b48a602f8b1259fd8899ae1675afab2443bf160 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourceEvent.idl >@@ -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 >index 0000000000000000000000000000000000000000..709c22ffe45905a06fa1c890078430d701680a0a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.cpp >@@ -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 >index 0000000000000000000000000000000000000000..2e4ecc774f98db30a2228180a8e6ab638a2c48a1 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.h >@@ -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 >index 0000000000000000000000000000000000000000..68a46592b96cbd9f1ff167bb1910a6e147daec06 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRInputSourcesChangeEvent.idl >@@ -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 >index 0000000000000000000000000000000000000000..f7899b348b55fd2794387b3fc8f4d2c0df113ce8 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.cpp >@@ -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 >index 0000000000000000000000000000000000000000..ac520a7cdf19009914432dfba9e758b88f3ed8fa >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.h >@@ -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 >index 0000000000000000000000000000000000000000..169c14c3583f13ef8d7cab4c8c9313d9712c2d58 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRReferenceSpaceEvent.idl >@@ -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 >index 0000000000000000000000000000000000000000..0435896ab9c2406502252bd0291c550b0d9358d3 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRReferenceSpaceType.h >@@ -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 >index 0000000000000000000000000000000000000000..f2996bbe90ef4dc3eeff9c3c5fbf79dc90ce5452 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRReferenceSpaceType.idl >@@ -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 >index 0000000000000000000000000000000000000000..707180b0e0f782c217679937b14c987b3b4f1256 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRRenderStateInit.h >@@ -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 >index 0000000000000000000000000000000000000000..a60eae4b2a9d41f94da7cb25cb099ba5e2aec118 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRRenderStateInit.idl >@@ -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 >index 0000000000000000000000000000000000000000..df8748c8a01a28deb6b5481fcc54a7c1d87e6dcd >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionEvent.cpp >@@ -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 >index 0000000000000000000000000000000000000000..9e8ceb4072d5ecf69af0efbe70b3f9f8644af99a >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionEvent.h >@@ -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 >index 0000000000000000000000000000000000000000..471933f295e54410ed60f6390ae5c284f2bc9226 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionEvent.idl >@@ -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 >index 0000000000000000000000000000000000000000..e62a2682296e2ed491a77b42d874000a2ceb69f3 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionInit.h >@@ -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 >index 0000000000000000000000000000000000000000..605c0d507245d5a8379cc62595ac5519f9a0dda1 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionInit.idl >@@ -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 >index 0000000000000000000000000000000000000000..771a9da584bc0a2df4d81db098412d1f295b1f99 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionMode.h >@@ -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 >index 0000000000000000000000000000000000000000..e65f606b46979a12d7c14c36b31577128d2b1c17 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRSessionMode.idl >@@ -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 >index 0000000000000000000000000000000000000000..1fca44e451b97c56026e145b522331f8165bae7f >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRTargetRayMode.h >@@ -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 >index 0000000000000000000000000000000000000000..64e5463d34cf66e68c3c21b346bbb9773abd8aab >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRTargetRayMode.idl >@@ -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 >index 0000000000000000000000000000000000000000..6fdd85978d9d01ff79362c7c0bb858d777fb291c >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRVisibilityState.h >@@ -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 >index 0000000000000000000000000000000000000000..11ef27580fc198f367971c388c0f98ffc9d6fe8e >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRVisibilityState.idl >@@ -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 >index 0000000000000000000000000000000000000000..ba44d510a0ef4ec1dc8991f54f2b007dd038e7d9 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRWebGLLayerInit.h >@@ -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 >index 0000000000000000000000000000000000000000..3a436d2b5432ccf9852acadeb70d432e5a553b59 >--- /dev/null >+++ b/Source/WebCore/Modules/webxr/XRWebGLLayerInit.idl >@@ -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; >+}; >diff --git a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebCore/PAL/Configurations/FeatureDefines.xcconfig >@@ -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/WebCore/PlatformWPE.cmake b/Source/WebCore/PlatformWPE.cmake >index 0d5982e1dc69eb680f08debd8e6f26a7247d9da5..e75ecef140ab5ceef1d0d6dbc066e35c92d3f592 100644 >--- a/Source/WebCore/PlatformWPE.cmake >+++ b/Source/WebCore/PlatformWPE.cmake >@@ -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 >diff --git a/Source/WebCore/Sources.txt b/Source/WebCore/Sources.txt >index 778263e4a0b31731e3b5f6481089c1d0e3185480..401cad4aa5f42b63b4590c50e48435513e9dfdb7 100644 >--- a/Source/WebCore/Sources.txt >+++ b/Source/WebCore/Sources.txt >@@ -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 >diff --git a/Source/WebCore/WebCore.xcodeproj/project.pbxproj b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >index 73f3a9f8b65e3d17d98cda2fdfd2026f5e209114..86ae8589a51b8ca3fdd6952429635dbef1e31a68 100644 >--- a/Source/WebCore/WebCore.xcodeproj/project.pbxproj >+++ b/Source/WebCore/WebCore.xcodeproj/project.pbxproj >@@ -4816,6 +4816,60 @@ > 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 */; }; >@@ -15154,6 +15208,91 @@ > 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>"; }; >@@ -22394,6 +22533,7 @@ > 996E59DA1DF00D45006612B9 /* webdriver */, > D00F593E216ECC43000D71DB /* webgpu */, > 97AABCF714FA09B5007457AE /* websockets */, >+ E1EE8AC62412B16F00E794D6 /* webxr */, > ); > path = Modules; > sourceTree = "<group>"; >@@ -25944,6 +26084,7 @@ > 656B84D70AEA1CE900A095B4 /* network */, > 1A2E6E560CC551E0004A2062 /* sql */, > B2C3D9EC0D006C1D00EF6F26 /* text */, >+ E1EE8B6B2412B2A700E794D6 /* xr */, > DFDB912CF8E88A6DA1AD264F /* AbortableTaskQueue.h */, > 49AE2D94134EE5F90072920A /* CalculationValue.cpp */, > 49AE2D95134EE5F90072920A /* CalculationValue.h */, >@@ -27036,6 +27177,113 @@ > 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 = ( >@@ -31713,6 +31961,7 @@ > 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 */, >@@ -31927,6 +32176,7 @@ > 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 */, >@@ -33172,6 +33422,20 @@ > 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 */, >@@ -33268,6 +33532,22 @@ > 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 */, >@@ -33801,6 +34081,7 @@ > 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 */, >@@ -33808,6 +34089,8 @@ > 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 */, >@@ -34468,10 +34751,29 @@ > 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; > }; >diff --git a/Source/WebCore/bindings/IDLTypes.h b/Source/WebCore/bindings/IDLTypes.h >index 305bcf5144e02e361e5d32f0475415e58b865ff3..94f3165e1f27ba02ca9d6b32242cd3134eb132b5 100644 >--- a/Source/WebCore/bindings/IDLTypes.h >+++ b/Source/WebCore/bindings/IDLTypes.h >@@ -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; > >diff --git a/Source/WebCore/bindings/js/JSDOMConvertSequences.h b/Source/WebCore/bindings/js/JSDOMConvertSequences.h >index c49dd938fce27165f747e58fe08a553dbbfdf5c2..86f7f276fc08ae07c01000222d359f0efeb5aebe 100644 >--- a/Source/WebCore/bindings/js/JSDOMConvertSequences.h >+++ b/Source/WebCore/bindings/js/JSDOMConvertSequences.h >@@ -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) > { >diff --git a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >index 44d50b207c538a19792b4f3226afe65287787209..1882a9effe240c459bd5d342617a0cd933c2d889 100644 >--- a/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >+++ b/Source/WebCore/bindings/js/WebCoreBuiltinNames.h >@@ -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) \ >diff --git a/Source/WebCore/dom/EventNames.h b/Source/WebCore/dom/EventNames.h >index d4960b9cf751f411422b670841a05b8bd2c71c28..5ceee6f6816dee9d799cb150e175ac5d7ed4ac77 100644 >--- a/Source/WebCore/dom/EventNames.h >+++ b/Source/WebCore/dom/EventNames.h >@@ -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) \ >diff --git a/Source/WebCore/dom/EventNames.in b/Source/WebCore/dom/EventNames.in >index a590861068f5e37667132fd1aa42e6791817d8a0..aeb234aa3e467c3aec9b48e9b008ce1a0e63603d 100644 >--- a/Source/WebCore/dom/EventNames.in >+++ b/Source/WebCore/dom/EventNames.in >@@ -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 >diff --git a/Source/WebCore/dom/EventTargetFactory.in b/Source/WebCore/dom/EventTargetFactory.in >index 81e7cc9f0b7650562aabfefe05a5a3ad1bbbb8ff..837eb5dcd0e995ca0224ecfebe70bce1eb833b36 100644 >--- a/Source/WebCore/dom/EventTargetFactory.in >+++ b/Source/WebCore/dom/EventTargetFactory.in >@@ -58,4 +58,6 @@ Worker > WorkletGlobalScope conditional=CSS_PAINTING_API > XMLHttpRequest > XMLHttpRequestUpload >- >+WebXRSession conditional=WEBXR >+WebXRSpace conditional=WEBXR >+WebXRSystem conditional=WEBXR >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index 5d1afdbed55e36feb10f4e3503710269f37ee9ae..de7e38d25eb233c885a814fdcc22c6bc38c4524a 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -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 >index 0000000000000000000000000000000000000000..17268ee677a379a6bf55170b9904f33bbe771af8 >--- /dev/null >+++ b/Source/WebCore/platform/xr/PlatformXR.cpp >@@ -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 >index 0000000000000000000000000000000000000000..c0883bd52dbf7581a858c921fd25ab00b986b7b9 >--- /dev/null >+++ b/Source/WebCore/platform/xr/PlatformXR.h >@@ -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 >index 0000000000000000000000000000000000000000..ca4f4c2c18f3a3de131b8749311a41aefebbed5b >--- /dev/null >+++ b/Source/WebCore/platform/xr/openxr/PlatformXR.cpp >@@ -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) >diff --git a/Source/WebKit/Configurations/FeatureDefines.xcconfig b/Source/WebKit/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Source/WebKit/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKit/Configurations/FeatureDefines.xcconfig >@@ -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/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index 0b3ce943ac30508e04cdb0c711021fc5f747b4f8..3c9ab033aba2dc85f5e2775ce76cf6933f689fb0 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -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: >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >index 7ddac133d1abfc20299517bc6524b7a830581058..ecf3f0384275c3d8f7dfccac030b0f7179ac5ea0 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.cpp >@@ -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 >diff --git a/Source/WebKit/Shared/WebPreferencesDefaultValues.h b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >index 717cf2465f4456d2b50bf7270fda1faf6d5408b5..2955a094d6436bfc96bfd65df46fcea911699c13 100644 >--- a/Source/WebKit/Shared/WebPreferencesDefaultValues.h >+++ b/Source/WebKit/Shared/WebPreferencesDefaultValues.h >@@ -332,4 +332,8 @@ bool defaultInAppBrowserPrivacy(); > bool defaultIncrementalPDFEnabled(); > #endif > >+#if ENABLE(WEBXR) >+bool defaultWebXREnabled(); >+#endif >+ > } // namespace WebKit >diff --git a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >index 5615b991b33fbdd2b06591e79b5906c834f3f2d0..f3e6ab755b72c7393dfdaa5d28f10953cfc5bd1a 100644 >--- a/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >+++ b/Source/WebKit/WebProcess/InjectedBundle/InjectedBundle.cpp >@@ -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) \ >diff --git a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >+++ b/Source/WebKitLegacy/mac/Configurations/FeatureDefines.xcconfig >@@ -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 >index 0000000000000000000000000000000000000000..bbfdf04c11edd03900fc4c142ce76a6614830f6e >--- /dev/null >+++ b/Source/cmake/FindOpenXR.cmake >@@ -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) >diff --git a/Source/cmake/OptionsWPE.cmake b/Source/cmake/OptionsWPE.cmake >index dff6491a7340f1b35ce0cc28127d2c7416565660..05531cf6560c0f5b19f43e147623f1163bb9bd29 100644 >--- a/Source/cmake/OptionsWPE.cmake >+++ b/Source/cmake/OptionsWPE.cmake >@@ -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) >diff --git a/Source/cmake/WebKitFeatures.cmake b/Source/cmake/WebKitFeatures.cmake >index ff7d6d1c70f9d13007bdf7d46e64d07d7756f0f8..b5919651198f2e3825dca9b83ef6db7e35a28c3b 100644 >--- a/Source/cmake/WebKitFeatures.cmake >+++ b/Source/cmake/WebKitFeatures.cmake >@@ -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) >diff --git a/Source/cmake/tools/vsprops/FeatureDefines.props b/Source/cmake/tools/vsprops/FeatureDefines.props >index 96d4600cfb6a2174c0d89e47dbce7ccde0ef55d1..bde2b88fd5ef48c31b5ddde55d0c826b877a4666 100644 >--- a/Source/cmake/tools/vsprops/FeatureDefines.props >+++ b/Source/cmake/tools/vsprops/FeatureDefines.props >@@ -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> >diff --git a/Source/cmake/tools/vsprops/FeatureDefinesCairo.props b/Source/cmake/tools/vsprops/FeatureDefinesCairo.props >index 24b94bc7063640ac885b65feec13e31316753527..d7194b2d9054eede1fa62bb12451572bbabc31f7 100644 >--- a/Source/cmake/tools/vsprops/FeatureDefinesCairo.props >+++ b/Source/cmake/tools/vsprops/FeatureDefinesCairo.props >@@ -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> >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index 923925224a0f9e4fd28f4652c9f7edff2ff249fd..ea6b980180f0c706e5f3734ae272fb2dce7a4d15 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -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-15 Fujii Hironori <Hironori.Fujii@sony.com> > > KeyedDecoderGeneric fails to allocate Vector while decoding broken data >diff --git a/Tools/Scripts/webkitperl/FeatureList.pm b/Tools/Scripts/webkitperl/FeatureList.pm >index 1c84015cafbc52ec9eb5b7226f698398cc5e5f0b..763aa2e8329170ecbc6870f4cc96b930a61739ae 100644 >--- a/Tools/Scripts/webkitperl/FeatureList.pm >+++ b/Tools/Scripts/webkitperl/FeatureList.pm >@@ -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 }, > >diff --git a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >index e6a30029a01df1802ebf72f58fa8411581e801b4..cfbb7295135f01b4c7476519d4687e6c6f1be345 100644 >--- a/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >+++ b/Tools/TestWebKitAPI/Configurations/FeatureDefines.xcconfig >@@ -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/ChangeLog b/ChangeLog >index fa0a12dfe28b12a0db59c29904228418b48b2978..a42d69e620dea360cc3815ed089507947e962b32 100644 >--- 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
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 208702
:
392699
|
392700
|
393019
|
393046
|
393218
|
393250
|
393527
|
393533
|
393612
|
393613
| 393639