Title: [274416] trunk
Revision
274416
Author
[email protected]
Date
2021-03-15 06:00:36 -0700 (Mon, 15 Mar 2021)

Log Message

Split WebXR features into enabledFeatures, supportedFeatures and requestedFeatures
https://bugs.webkit.org/show_bug.cgi?id=222796

Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Update xrSession_requestReferenceSpace_features expectations.

* web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt: Added.

Source/WebCore:

Currently enabledFeatures array is used both for checking supported and enabled features. This is causing some tests to fail,
such as "test that reference spaces that aren't default features are rejected when not requested as a feature".

This patchs splits WebXR features into:
- enabledFeatures: features thas has been granted by the permission system.
- supportedFeatures: features that the device supports.
- requestedFeatures: specific features that have been enabled for a specific session.

Tested by xrSession_requestReferenceSpace_features.html

* Modules/webxr/WebXRSession.cpp:
(WebCore::WebXRSession::create):
(WebCore::WebXRSession::WebXRSession):
(WebCore::WebXRSession::referenceSpaceIsSupported const):
* Modules/webxr/WebXRSession.h:
* Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::resolveRequestedFeatures const):
(WebCore::WebXRSystem::resolveFeaturePermissions const):
(WebCore::WebXRSystem::requestSession):
(WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice):
* Modules/webxr/WebXRSystem.h:
* platform/xr/PlatformXR.h:
(PlatformXR::Device::setSupportedFeatures):
(PlatformXR::Device::supportedFeatures const):
* platform/xr/openxr/PlatformXROpenXR.cpp:
(PlatformXR::OpenXRDevice::collectSupportedFeatures):
(PlatformXR::OpenXRDevice::collectSupportedSessionModes):
* platform/xr/openxr/PlatformXROpenXR.h:
* testing/WebXRTest.cpp:
(WebCore::WebXRTest::simulateDeviceConnection):

LayoutTests:

Update xrSession_requestReferenceSpace_features expectations.

* platform/wpe/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (274415 => 274416)


--- trunk/LayoutTests/ChangeLog	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/LayoutTests/ChangeLog	2021-03-15 13:00:36 UTC (rev 274416)
@@ -1,3 +1,14 @@
+2021-03-15  Imanol Fernandez  <[email protected]>
+
+        Split WebXR features into enabledFeatures, supportedFeatures and requestedFeatures
+        https://bugs.webkit.org/show_bug.cgi?id=222796
+
+        Reviewed by Sergio Villar Senin.
+
+        Update xrSession_requestReferenceSpace_features expectations.
+
+        * platform/wpe/TestExpectations:
+
 2021-03-14  Yusuke Suzuki  <[email protected]>
 
         Prevent dynamic import in service worker

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (274415 => 274416)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2021-03-15 13:00:36 UTC (rev 274416)
@@ -1,3 +1,14 @@
+2021-03-15  Imanol Fernandez  <[email protected]>
+
+        Split WebXR features into enabledFeatures, supportedFeatures and requestedFeatures
+        https://bugs.webkit.org/show_bug.cgi?id=222796
+
+        Reviewed by Sergio Villar Senin.
+
+        Update xrSession_requestReferenceSpace_features expectations.
+
+        * web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt: Added.
+
 2021-03-15  Rob Buis  <[email protected]>
 
         CSS aspect-ratio interpolation

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt (0 => 274416)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https-expected.txt	2021-03-15 13:00:36 UTC (rev 274416)
@@ -0,0 +1,14 @@
+
+PASS Non-immersive session supports viewer space by default
+PASS Immersive session supports viewer space by default
+PASS Immersive session supports local space by default
+PASS Non-immersive session supports local space when required
+PASS Non-immersive session supports local space when optional
+PASS Non-immersive session supports local-floor space when required
+PASS Immersive session supports local-floor space when required
+PASS Immersive session supports local-floor space when optional
+PASS Non-immersive session rejects bounded-floor space even when requested
+PASS Non-immersive session rejects unbounded space even when requested
+PASS Non-immersive session rejects local space if not requested
+PASS Immersive session rejects local-floor space if not requested
+

Modified: trunk/LayoutTests/platform/wpe/TestExpectations (274415 => 274416)


--- trunk/LayoutTests/platform/wpe/TestExpectations	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/LayoutTests/platform/wpe/TestExpectations	2021-03-15 13:00:36 UTC (rev 274416)
@@ -646,6 +646,7 @@
 imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_getViewerPose.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_timestamp.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html [ Pass ]
+imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace_features.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/xrSession_viewer_referenceSpace.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/xrViewport_valid.https.html [ Pass ]
 imported/w3c/web-platform-tests/webxr/xrWebGLLayer_constructor.https.html [ Pass ]

Modified: trunk/Source/WebCore/ChangeLog (274415 => 274416)


--- trunk/Source/WebCore/ChangeLog	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/ChangeLog	2021-03-15 13:00:36 UTC (rev 274416)
@@ -1,3 +1,41 @@
+2021-03-15  Imanol Fernandez  <[email protected]>
+
+        Split WebXR features into enabledFeatures, supportedFeatures and requestedFeatures
+        https://bugs.webkit.org/show_bug.cgi?id=222796
+
+        Reviewed by Sergio Villar Senin.
+
+        Currently enabledFeatures array is used both for checking supported and enabled features. This is causing some tests to fail,
+        such as "test that reference spaces that aren't default features are rejected when not requested as a feature".
+
+        This patchs splits WebXR features into:
+        - enabledFeatures: features thas has been granted by the permission system.
+        - supportedFeatures: features that the device supports.
+        - requestedFeatures: specific features that have been enabled for a specific session.
+
+        Tested by xrSession_requestReferenceSpace_features.html
+
+        * Modules/webxr/WebXRSession.cpp:
+        (WebCore::WebXRSession::create):
+        (WebCore::WebXRSession::WebXRSession):
+        (WebCore::WebXRSession::referenceSpaceIsSupported const):
+        * Modules/webxr/WebXRSession.h:
+        * Modules/webxr/WebXRSystem.cpp:
+        (WebCore::WebXRSystem::resolveRequestedFeatures const):
+        (WebCore::WebXRSystem::resolveFeaturePermissions const):
+        (WebCore::WebXRSystem::requestSession):
+        (WebCore::WebXRSystem::DummyInlineDevice::DummyInlineDevice):
+        * Modules/webxr/WebXRSystem.h:
+        * platform/xr/PlatformXR.h:
+        (PlatformXR::Device::setSupportedFeatures):
+        (PlatformXR::Device::supportedFeatures const):
+        * platform/xr/openxr/PlatformXROpenXR.cpp:
+        (PlatformXR::OpenXRDevice::collectSupportedFeatures):
+        (PlatformXR::OpenXRDevice::collectSupportedSessionModes):
+        * platform/xr/openxr/PlatformXROpenXR.h:
+        * testing/WebXRTest.cpp:
+        (WebCore::WebXRTest::simulateDeviceConnection):
+
 2021-03-15  Rob Buis  <[email protected]>
 
         CSS aspect-ratio interpolation

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp (274415 => 274416)


--- trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSession.cpp	2021-03-15 13:00:36 UTC (rev 274416)
@@ -45,17 +45,18 @@
 
 WTF_MAKE_ISO_ALLOCATED_IMPL(WebXRSession);
 
-Ref<WebXRSession> WebXRSession::create(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device)
+Ref<WebXRSession> WebXRSession::create(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device, FeatureList&& requestedFeatures)
 {
-    return adoptRef(*new WebXRSession(document, system, mode, device));
+    return adoptRef(*new WebXRSession(document, system, mode, device, WTFMove(requestedFeatures)));
 }
 
-WebXRSession::WebXRSession(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device)
+WebXRSession::WebXRSession(Document& document, WebXRSystem& system, XRSessionMode mode, PlatformXR::Device& device, FeatureList&& requestedFeatures)
     : ActiveDOMObject(&document)
     , m_inputSources(WebXRInputSourceArray::create())
     , m_xrSystem(system)
     , m_mode(mode)
     , m_device(makeWeakPtr(device))
+    , m_requestedFeatures(WTFMove(requestedFeatures))
     , m_activeRenderState(WebXRRenderState::create(mode))
     , m_viewerReferenceSpace(makeUnique<WebXRViewerSpace>(document, *this))
     , m_timeOrigin(MonotonicTime::now())
@@ -164,7 +165,7 @@
 bool WebXRSession::referenceSpaceIsSupported(XRReferenceSpaceType type) const
 {
     // 1. If type is not contained in session’s XR device's list of enabled features for mode return false.
-    if (!m_device->enabledFeatures(m_mode).contains(type))
+    if (!m_requestedFeatures.contains(type))
         return false;
 
     // 2. If type is viewer, return true.

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSession.h (274415 => 274416)


--- trunk/Source/WebCore/Modules/webxr/WebXRSession.h	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSession.h	2021-03-15 13:00:36 UTC (rev 274416)
@@ -57,8 +57,9 @@
 public:
     using RequestReferenceSpacePromise = DOMPromiseDeferred<IDLInterface<WebXRReferenceSpace>>;
     using EndPromise = DOMPromiseDeferred<void>;
+    using FeatureList = PlatformXR::Device::FeatureList;
 
-    static Ref<WebXRSession> create(Document&, WebXRSystem&, XRSessionMode, PlatformXR::Device&);
+    static Ref<WebXRSession> create(Document&, WebXRSystem&, XRSessionMode, PlatformXR::Device&, FeatureList&&);
     virtual ~WebXRSession();
 
     using RefCounted<WebXRSession>::ref;
@@ -97,7 +98,7 @@
     bool posesCanBeReported(const Document&) const;
 
 private:
-    WebXRSession(Document&, WebXRSystem&, XRSessionMode, PlatformXR::Device&);
+    WebXRSession(Document&, WebXRSystem&, XRSessionMode, PlatformXR::Device&, FeatureList&&);
 
     // EventTarget
     EventTargetInterface eventTargetInterface() const override { return WebXRSessionEventTargetInterfaceType; }
@@ -132,6 +133,7 @@
     WebXRSystem& m_xrSystem;
     XRSessionMode m_mode;
     WeakPtr<PlatformXR::Device> m_device;
+    FeatureList m_requestedFeatures;
     RefPtr<WebXRRenderState> m_activeRenderState;
     RefPtr<WebXRRenderState> m_pendingRenderState;
     std::unique_ptr<WebXRViewerSpace> m_viewerReferenceSpace;

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp (274415 => 274416)


--- trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp	2021-03-15 13:00:36 UTC (rev 274416)
@@ -117,7 +117,7 @@
     });
 }
 
-void WebXRSystem::obtainCurrentDevice(XRSessionMode mode, const JSFeaturesArray& requiredFeatures, const JSFeaturesArray& optionalFeatures, CompletionHandler<void(PlatformXR::Device*)>&& callback)
+void WebXRSystem::obtainCurrentDevice(XRSessionMode mode, const JSFeatureList& requiredFeatures, const JSFeatureList& optionalFeatures, CompletionHandler<void(PlatformXR::Device*)>&& callback)
 {
     if (mode == XRSessionMode::ImmersiveAr || mode == XRSessionMode::ImmersiveVr) {
         ensureImmersiveXRDeviceIsSelected([this, callback = WTFMove(callback)]() mutable {
@@ -201,7 +201,7 @@
 // https://immersive-web.github.io/webxr/#inline-session-request-is-allowed
 bool WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject(DOMWindow& globalObject, Document& document, const XRSessionInit& init) const
 {
-    auto isEmptyOrViewer = [&document](const JSFeaturesArray& features) {
+    auto isEmptyOrViewer = [&document](const JSFeatureList& features) {
         if (features.isEmpty())
             return true;
         if (features.size() == 1) {
@@ -227,9 +227,10 @@
 
 
 struct WebXRSystem::ResolvedRequestedFeatures {
-    FeaturesArray granted;
-    FeaturesArray consentRequired;
-    FeaturesArray consentOptional;
+    FeatureList granted;
+    FeatureList consentRequired;
+    FeatureList consentOptional;
+    FeatureList requested;
 };
 
 #define RETURN_FALSE_OR_CONTINUE(mustReturn) { \
@@ -268,7 +269,7 @@
     // We're merging both loops in a single lambda. The only difference is that a failure on any required features
     // implies cancelling the whole process while failures in optional features are just skipped.
     enum class ParsingMode { Strict, Loose };
-    auto parseFeatures = [&device, &globalObject, mode, &resolvedFeatures] (const JSFeaturesArray& sessionFeatures, ParsingMode parsingMode) -> bool {
+    auto parseFeatures = [&device, &globalObject, mode, &resolvedFeatures] (const JSFeatureList& sessionFeatures, ParsingMode parsingMode) -> bool {
         bool returnOnFailure = parsingMode == ParsingMode::Strict;
         for (const auto& sessionFeature : sessionFeatures) {
             // 1. If the feature is null, continue to the next entry.
@@ -284,8 +285,10 @@
                 RETURN_FALSE_OR_CONTINUE(returnOnFailure);
 
             // 3. If feature is already in granted, continue to the next entry.
-            if (resolvedFeatures.granted.contains(feature.value()))
+            if (resolvedFeatures.granted.contains(feature.value())) {
+                resolvedFeatures.requested.append(feature.value());
                 continue;
+            }
 
             // 4. If the requesting document's origin is not allowed to use any feature policy required by feature
             //    as indicated by the feature requirements table, (return null|continue to next entry).
@@ -292,12 +295,16 @@
 
             // 5. If session's XR device is not capable of supporting the functionality described by feature or the
             //    user agent has otherwise determined to reject the feature, (return null|continue to next entry).
-            if (!device->enabledFeatures(mode).contains(feature.value()))
+            if (!device->supportedFeatures(mode).contains(feature.value()))
                 RETURN_FALSE_OR_CONTINUE(returnOnFailure);
 
             // 6. If the functionality described by feature requires explicit consent, append it to (consentRequired|consentOptional).
             // 7. Else append feature to granted.
             resolvedFeatures.granted.append(feature.value());
+
+            // https://immersive-web.github.io/webxr/#requested-features
+            // The combined list of feature descriptors given by the requiredFeatures and optionalFeatures are collectively considered the requested features for an XRSession.
+            resolvedFeatures.requested.append(feature.value());
         }
         return true;
     };
@@ -310,7 +317,7 @@
 }
 
 // https://immersive-web.github.io/webxr/#request-the-xr-permission
-bool WebXRSystem::isXRPermissionGranted(XRSessionMode mode, const XRSessionInit& init, PlatformXR::Device* device, JSC::JSGlobalObject& globalObject) const
+Optional<WebXRSystem::FeatureList> WebXRSystem::resolveFeaturePermissions(XRSessionMode mode, const XRSessionInit& init, PlatformXR::Device* device, JSC::JSGlobalObject& globalObject) const
 {
     // 1. Set status's granted to an empty FrozenArray.
     // 2. Let requiredFeatures be descriptor's requiredFeatures.
@@ -324,7 +331,7 @@
     //  6.1. Set status's state to "denied".
     //  6.2. Abort these steps.
     if (!resolvedFeatures)
-        return false;
+        return WTF::nullopt;
 
     // 7. Let (consentRequired, consentOptional, granted) be the fields of result.
     // 8. The user agent MAY at this point ask the user's permission for the calling algorithm to use any of the features
@@ -344,7 +351,9 @@
     // 11. Set status's granted to granted.
     // 12. Set device's list of enabled features for mode to granted.
     // 13. Set status's state to "granted".
-    return true;
+    device->setEnabledFeatures(mode, resolvedFeatures->granted);
+
+    return resolvedFeatures->requested;
 }
 
 
@@ -410,12 +419,13 @@
         // 5.4.5 Let status be an XRPermissionStatus, initially null
         // 5.4.6 Request the xr permission with descriptor and status.
         // 5.4.7 If status' state is "denied" run the following steps: (same as above in 5.4.1)
-        if (!isXRPermissionGranted(mode, init, device, *globalObject))
+        auto requestedFeatures = resolveFeaturePermissions(mode, init, device, *globalObject);
+        if (!requestedFeatures)
             return;
 
         // 5.4.2 Let session be a new XRSession object.
         // 5.4.3 Initialize the session with session, mode, and device.
-        auto session = WebXRSession::create(protectedDocument.get(), *this, mode, *device);
+        auto session = WebXRSession::create(protectedDocument.get(), *this, mode, *device, WTFMove(*requestedFeatures));
 
         // 5.4.8 Potentially set the active immersive session as follows:
         if (immersive) {
@@ -508,7 +518,7 @@
 WebXRSystem::DummyInlineDevice::DummyInlineDevice(ScriptExecutionContext& scriptExecutionContext)
     : ContextDestructionObserver(&scriptExecutionContext)
 {
-    setEnabledFeatures(XRSessionMode::Inline, { XRReferenceSpaceType::Viewer });
+    setSupportedFeatures(XRSessionMode::Inline, { XRReferenceSpaceType::Viewer });
 }
 
 void WebXRSystem::DummyInlineDevice::requestFrame(PlatformXR::Device::RequestFrameCallback&& callback)

Modified: trunk/Source/WebCore/Modules/webxr/WebXRSystem.h (274415 => 274416)


--- trunk/Source/WebCore/Modules/webxr/WebXRSystem.h	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/Modules/webxr/WebXRSystem.h	2021-03-15 13:00:36 UTC (rev 274416)
@@ -92,9 +92,9 @@
 private:
     WebXRSystem(ScriptExecutionContext&);
 
-    using FeaturesArray = PlatformXR::Device::ListOfEnabledFeatures;
-    using JSFeaturesArray = Vector<JSC::JSValue>;
-    void obtainCurrentDevice(XRSessionMode, const JSFeaturesArray& requiredFeatures, const JSFeaturesArray& optionalFeatures, CompletionHandler<void(PlatformXR::Device*)>&&);
+    using FeatureList = PlatformXR::Device::FeatureList;
+    using JSFeatureList = Vector<JSC::JSValue>;
+    void obtainCurrentDevice(XRSessionMode, const JSFeatureList& requiredFeatures, const JSFeatureList& optionalFeatures, CompletionHandler<void(PlatformXR::Device*)>&&);
 
     bool immersiveSessionRequestIsAllowedForGlobalObject(DOMWindow&, Document&) const;
     bool inlineSessionRequestIsAllowedForGlobalObject(DOMWindow&, Document&, const XRSessionInit&) const;
@@ -101,7 +101,7 @@
 
     struct ResolvedRequestedFeatures;
     Optional<ResolvedRequestedFeatures> resolveRequestedFeatures(XRSessionMode, const XRSessionInit&, PlatformXR::Device*, JSC::JSGlobalObject&) const;
-    bool isXRPermissionGranted(XRSessionMode, const XRSessionInit&, PlatformXR::Device*, JSC::JSGlobalObject&) const;
+    Optional<FeatureList> resolveFeaturePermissions(XRSessionMode, const XRSessionInit&, PlatformXR::Device*, JSC::JSGlobalObject&) const;
 
     // https://immersive-web.github.io/webxr/#default-inline-xr-device
     class DummyInlineDevice final : public PlatformXR::Device, private ContextDestructionObserver {

Modified: trunk/Source/WebCore/platform/xr/PlatformXR.h (274415 => 274416)


--- trunk/Source/WebCore/platform/xr/PlatformXR.h	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/platform/xr/PlatformXR.h	2021-03-15 13:00:36 UTC (rev 274416)
@@ -67,10 +67,12 @@
 public:
     virtual ~Device() = default;
 
-    using ListOfEnabledFeatures = Vector<ReferenceSpaceType>;
+    using FeatureList = Vector<ReferenceSpaceType>;
     bool supports(SessionMode mode) const { return m_enabledFeaturesMap.contains(mode); }
-    void setEnabledFeatures(SessionMode mode, const ListOfEnabledFeatures& features) { m_enabledFeaturesMap.set(mode, features); }
-    ListOfEnabledFeatures enabledFeatures(SessionMode mode) const { return m_enabledFeaturesMap.get(mode); }
+    void setSupportedFeatures(SessionMode mode, const FeatureList& features) { m_enabledFeaturesMap.set(mode, features); }
+    FeatureList supportedFeatures(SessionMode mode) const { return m_enabledFeaturesMap.get(mode); }
+    void setEnabledFeatures(SessionMode mode, const FeatureList& features) { m_enabledFeaturesMap.set(mode, features); }
+    FeatureList enabledFeatures(SessionMode mode) const { return m_enabledFeaturesMap.get(mode); }
 
     virtual WebCore::IntSize recommendedResolution(SessionMode) { return { 1, 1 }; }
 
@@ -144,8 +146,9 @@
     // https://immersive-web.github.io/webxr/#xr-device-concept
     // Each XR device has a list of enabled features for each XRSessionMode in its list of supported modes,
     // which is a list of feature descriptors which MUST be initially an empty list.
-    using EnabledFeaturesPerModeMap = WTF::HashMap<SessionMode, ListOfEnabledFeatures, WTF::IntHash<SessionMode>, WTF::StrongEnumHashTraits<SessionMode>>;
-    EnabledFeaturesPerModeMap m_enabledFeaturesMap;
+    using FeaturesPerModeMap = WTF::HashMap<SessionMode, FeatureList, WTF::IntHash<SessionMode>, WTF::StrongEnumHashTraits<SessionMode>>;
+    FeaturesPerModeMap m_enabledFeaturesMap;
+    FeaturesPerModeMap m_supportedFeaturesMap;
 
     bool m_supportsOrientationTracking { false };
     bool m_supportsViewportScaling { false };

Modified: trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp (274415 => 274416)


--- trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.cpp	2021-03-15 13:00:36 UTC (rev 274416)
@@ -245,9 +245,9 @@
     return views;
 }
 
-Device::ListOfEnabledFeatures OpenXRDevice::collectEnabledFeatures()
+Device::FeatureList OpenXRDevice::collectSupportedFeatures()
 {
-    Device::ListOfEnabledFeatures features;
+    Device::FeatureList features;
 
     // https://www.khronos.org/registry/OpenXR/specs/1.0/man/html/XrReferenceSpaceType.html
     // OpenXR runtimes must support Viewer and Local spaces.
@@ -279,7 +279,7 @@
     result = xrEnumerateViewConfigurations(m_instance, m_systemId, viewConfigurationCount, &viewConfigurationCount, viewConfigurations);
     RETURN_IF_FAILED(result, "xrEnumerateViewConfigurations", m_instance);
 
-    ListOfEnabledFeatures features = collectEnabledFeatures();
+    FeatureList features = collectSupportedFeatures();
     for (uint32_t i = 0; i < viewConfigurationCount; ++i) {
         auto viewConfigurationProperties = createStructure<XrViewConfigurationProperties, XR_TYPE_VIEW_CONFIGURATION_PROPERTIES>();
         result = xrGetViewConfigurationProperties(m_instance, m_systemId, viewConfigurations[i], &viewConfigurationProperties);
@@ -290,10 +290,10 @@
         auto configType = viewConfigurationProperties.viewConfigurationType;
         switch (configType) {
         case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_MONO:
-            setEnabledFeatures(SessionMode::Inline, features);
+            setSupportedFeatures(SessionMode::Inline, features);
             break;
         case XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO:
-            setEnabledFeatures(SessionMode::ImmersiveVr, features);
+            setSupportedFeatures(SessionMode::ImmersiveVr, features);
             break;
         default:
             continue;

Modified: trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h (274415 => 274416)


--- trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/platform/xr/openxr/PlatformXROpenXR.h	2021-03-15 13:00:36 UTC (rev 274416)
@@ -59,7 +59,7 @@
     Vector<ViewData> views(SessionMode) const final;
 
     // Custom methods
-    ListOfEnabledFeatures collectEnabledFeatures();
+    FeatureList collectSupportedFeatures();
     void collectSupportedSessionModes();
     void collectConfigurationViews();
     XrSpace createReferenceSpace(XrReferenceSpaceType);

Modified: trunk/Source/WebCore/testing/WebXRTest.cpp (274415 => 274416)


--- trunk/Source/WebCore/testing/WebXRTest.cpp	2021-03-15 13:00:06 UTC (rev 274415)
+++ trunk/Source/WebCore/testing/WebXRTest.cpp	2021-03-15 13:00:36 UTC (rev 274416)
@@ -90,7 +90,7 @@
         }
 
         for (auto& mode : supportedModes)
-            simulatedDevice.setEnabledFeatures(mode, features);
+            simulatedDevice.setSupportedFeatures(mode, features);
 
         m_context->registerSimulatedXRDeviceForTesting(simulatedDevice);
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to