Changeset 272492 in webkit


Ignore:
Timestamp:
Feb 8, 2021 8:17:03 AM (3 years ago)
Author:
commit-queue@webkit.org
Message:

WebXRSystem::RequestSession with 'viewer' as a required feature should succeed
https://bugs.webkit.org/show_bug.cgi?id=221267

Patch by Imanol Fernandez <imanol> on 2021-02-08
Reviewed by Sergio Villar Senin.

LayoutTests/imported/w3c:

Mark xrSession_viewer_availability test as passing.

  • web-platform-tests/webxr/xrSession_viewer_availability.https-expected.txt: Added.

Source/WebCore:

Tested by wpt/webxr/xrSession_viewer_availability.html

  • Modules/webxr/WebXRSystem.cpp:

(WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const):

LayoutTests:

Mark xrSession_viewer_availability test as passing.

  • platform/wpe/TestExpectations:
Location:
trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r272490 r272492  
     12021-02-08  Imanol Fernandez  <ifernandez@igalia.com>
     2
     3        WebXRSystem::RequestSession with 'viewer' as a required feature should succeed
     4        https://bugs.webkit.org/show_bug.cgi?id=221267
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Mark xrSession_viewer_availability test as passing.
     9
     10        * platform/wpe/TestExpectations:
     11
    1122021-02-08  Andres Gonzalez  <andresg_22@apple.com>
    213
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r272469 r272492  
     12021-02-08  Imanol Fernandez  <ifernandez@igalia.com>
     2
     3        WebXRSystem::RequestSession with 'viewer' as a required feature should succeed
     4        https://bugs.webkit.org/show_bug.cgi?id=221267
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Mark xrSession_viewer_availability test as passing.
     9
     10        * web-platform-tests/webxr/xrSession_viewer_availability.https-expected.txt: Added.
     11
    1122021-02-06  Alex Christensen  <achristensen@webkit.org>
    213
  • trunk/LayoutTests/platform/wpe/TestExpectations

    r272479 r272492  
    642642webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/xrSession_requestAnimationFrame_callback_calls.https.html [ Pass ]
    643643webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/xrSession_requestReferenceSpace.https.html [ Pass ]
     644imported/w3c/web-platform-tests/webxr/xrSession_viewer_availability.https.html [ Pass ]
    644645webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/ar-module/idlharness.https.window.html [ Pass ]
    645646webkit.org/b/209859 imported/w3c/web-platform-tests/webxr/ar-module/xrDevice_isSessionSupported_immersive-ar.https.html [ Pass ]
  • trunk/Source/WebCore/ChangeLog

    r272491 r272492  
     12021-02-08  Imanol Fernandez  <ifernandez@igalia.com>
     2
     3        WebXRSystem::RequestSession with 'viewer' as a required feature should succeed
     4        https://bugs.webkit.org/show_bug.cgi?id=221267
     5
     6        Reviewed by Sergio Villar Senin.
     7
     8        Tested by wpt/webxr/xrSession_viewer_availability.html
     9
     10        * Modules/webxr/WebXRSystem.cpp:
     11        (WebCore::WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject const):
     12
    1132021-02-08  Imanol Fernandez  <ifernandez@igalia.com>
    214
  • trunk/Source/WebCore/Modules/webxr/WebXRSystem.cpp

    r269032 r272492  
    205205bool WebXRSystem::inlineSessionRequestIsAllowedForGlobalObject(DOMWindow& globalObject, Document& document, const XRSessionInit& init) const
    206206{
    207     // 1. If the session request contained any required features or optional features and the request was not made
     207    auto isEmptyOrViewer = [&document](const JSFeaturesArray& features) {
     208        if (features.isEmpty())
     209            return true;
     210        if (features.size() == 1) {
     211            auto feature = parseEnumeration<XRReferenceSpaceType>(*document.globalObject(), features.first());
     212            if (feature == XRReferenceSpaceType::Viewer)
     213                return true;
     214        }
     215        return false;
     216    };
     217
     218    // 1. If the session request contained any required features or optional features (besides 'viewer') and the request was not made
    208219    //    while the global object has transient activation or when launching a web application, return false.
    209     bool sessionRequestContainedAnyFeature = !init.optionalFeatures.isEmpty() || !init.requiredFeatures.isEmpty();
     220    bool sessionRequestContainedAnyFeature = !isEmptyOrViewer(init.optionalFeatures) || !isEmptyOrViewer(init.requiredFeatures);
    210221    if (sessionRequestContainedAnyFeature && !globalObject.hasTransientActivation() /* TODO: || !launching a web app */)
    211222        return false;
Note: See TracChangeset for help on using the changeset viewer.