[webkit-changes] [WebKit/WebKit] 7f4d02: [WebXR] Update the algorithm for resolving request...

Ada Chan noreply at github.com
Tue Jul 18 13:53:21 PDT 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 7f4d02174118cd0e3964a2b17bfa48c175db04b1
      https://github.com/WebKit/WebKit/commit/7f4d02174118cd0e3964a2b17bfa48c175db04b1
  Author: Ada Chan <adachan at apple.com>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

  Changed paths:
    A LayoutTests/http/wpt/webxr/xrDevice_requestSession_previously_enabled_feature_not_requested.https-expected.txt
    A LayoutTests/http/wpt/webxr/xrDevice_requestSession_previously_enabled_feature_not_requested.https.html
    M Source/WebCore/Modules/webxr/WebXRSystem.cpp
    M Source/WebCore/page/ChromeClient.h
    M Source/WebKit/UIProcess/API/APIUIClient.h
    M Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.h
    M Source/WebKit/UIProcess/Cocoa/UIDelegate.mm
    M Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h
    M Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp
    M Source/WebKit/UIProcess/XR/PlatformXRSystem.h
    M Source/WebKit/UIProcess/XR/PlatformXRSystem.messages.in
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp
    M Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h
    M Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.cpp
    M Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.h

  Log Message:
  -----------
  [WebXR] Update the algorithm for resolving requested features
https://bugs.webkit.org/show_bug.cgi?id=259202
rdar://112239466

Reviewed by Dan Glastonbury.

The updated spec no longer automatically sets granted to all the previously
enabled features, but rather only add it to granted if it's requested and
previously enabled. Fix WebXRSystem::resolveRequestedFeatures() to follow
the updated steps.

Also update the APIUIClient method for requesting XR session permissions
to take in the required and optional features requested by the session
so the client has more information to decide how to present the feature
consent UI to the users.

New layout test: LayoutTests/http/wpt/webxr/xrDevice_requestSession_previously_enabled_feature_not_requested.https.html

* LayoutTests/http/wpt/webxr/xrDevice_requestSession_previously_enabled_feature_not_requested.https-expected.txt: Added.
* LayoutTests/http/wpt/webxr/xrDevice_requestSession_previously_enabled_feature_not_requested.https.html: Added.
Test to make sure hands are not returned if the device has hand tracking
enabled but the XR session did not request hands.
* Source/WebCore/Modules/webxr/WebXRSystem.cpp:
(WebCore::WebXRSystem::resolveRequestedFeatures const):
Update this logic based on the latest spec. We should not automatically add
all previously enabled features to granted but rather check previouslyEnabled
to decide whether a feature needs to be added to consentRequired or
consentOptional. Collect the lists of required features and optional features
requested by the session.
(WebCore::WebXRSystem::resolveFeaturePermissions const):
Pass the lists of required and optional features requested to the chrome
client method for requesting user permission.
* Source/WebCore/page/ChromeClient.h:
(WebCore::ChromeClient::requestPermissionOnXRSessionFeatures):
* Source/WebKit/UIProcess/API/APIUIClient.h:
(API::UIClient::requestPermissionOnXRSessionFeatures):
* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
Add a new version of the requestPermissionForXRSessionOrigin WKUIDelegatePrivate
method that takes in the lists of required and optional features requested.
* Source/WebKit/UIProcess/Cocoa/UIDelegate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::requestPermissionOnXRSessionFeatures):
Handle the new version of requestPermissionForXRSessionOrigin delegate method
and fall back to the old version if the new one is not implemented.
* Source/WebKit/UIProcess/XR/PlatformXRCoordinator.h:
(WebKit::PlatformXRCoordinator::requestPermissionOnSessionFeatures):
Updated to take in the lists of required and optional features requested by
the session.
* Source/WebKit/UIProcess/XR/PlatformXRSystem.cpp:
(WebKit::PlatformXRSystem::requestPermissionOnSessionFeatures):
* Source/WebKit/UIProcess/XR/PlatformXRSystem.h:
* Source/WebKit/UIProcess/XR/PlatformXRSystem.messages.in:
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::requestPermissionOnXRSessionFeatures):
* Source/WebKit/WebProcess/WebCoreSupport/WebChromeClient.h:
* Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.cpp:
(WebKit::PlatformXRSystemProxy::requestPermissionOnSessionFeatures):
* Source/WebKit/WebProcess/XR/PlatformXRSystemProxy.h:

Canonical link: https://commits.webkit.org/266137@main




More information about the webkit-changes mailing list