[webkit-changes] [WebKit/WebKit] 324a29: [WebXR] Add support for the new transient-pointer ...

Ada Chan noreply at github.com
Tue Nov 14 15:53:44 PST 2023


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 324a294aa828cf2710b6792a2930fabd829e3e42
      https://github.com/WebKit/WebKit/commit/324a294aa828cf2710b6792a2930fabd829e3e42
  Author: Ada Chan <adachan at apple.com>
  Date:   2023-11-14 (Tue, 14 Nov 2023)

  Changed paths:
    A LayoutTests/http/wpt/webxr/events_transient_pointer_input_source.https-expected.txt
    A LayoutTests/http/wpt/webxr/events_transient_pointer_input_source.https.html
    M Source/WebCore/Modules/webxr/WebXRInputSource.cpp
    M Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp
    M Source/WebCore/Modules/webxr/WebXRInputSourceArray.h
    M Source/WebCore/Modules/webxr/XRTargetRayMode.idl
    M Source/WebCore/platform/xr/PlatformXR.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

  Log Message:
  -----------
  [WebXR] Add support for the new transient-pointer targetRayMode
https://bugs.webkit.org/show_bug.cgi?id=264791
rdar://118342599

Reviewed by Dean Jackson.

Spec: https://www.w3.org/TR/webxr/#dom-xrtargetraymode-transient-pointer

- Add transient-pointer to the list of targetRayModes
- Since the transient input source is connected only during the transient
action, we need to fire a select event when that input source is no longer
connected.
- Fix the event order such that all XRInputSourceEvents for an input source
are ordered before the XRInputSourcesChangedEvent indicating its removal.
- Update the startXRSession UIClient API to take in the feature requested
and add a PlatformViewController parameter in its completion handler.
Add a new version of the startXRSession WKUIDelegatePrivate method that
takes in the requested feature list and adds a view controller to the
completion handler. Update the platform guards on the startXRSession and
endXRSession methods in UIClient.

* LayoutTests/http/wpt/webxr/events_transient_pointer_input_source.https-expected.txt: Added.
* LayoutTests/http/wpt/webxr/events_transient_pointer_input_source.https.html: Added.
Simulate connecting and disconnecting a transient-pointer input source, and
verify the expected list of events fire in the right order.
* Source/WebCore/Modules/webxr/WebXRInputSource.cpp:
(WebCore::WebXRInputSource::pollEvents):
Fire a select event when the transient-pointer input source is disconnected
during the primary action.
* Source/WebCore/Modules/webxr/WebXRInputSourceArray.cpp:
(WebCore::WebXRInputSourceArray::update):
Add a new local input source array to track input sources that are being
removed but have other input source events that need to fire. This way
we can fire the XRInputSourcesChangedEvent for the removal after the
XRInputSourceEvents have been fired.
(WebCore::WebXRInputSourceArray::handleRemovedInputSources):
Add any input source being removed to removedWithInputEvents if it also
generates XRInputSourceEvents.
(WebCore::WebXRInputSourceArray::handleAddedOrUpdatedInputSources):
Ditto.
* Source/WebCore/Modules/webxr/WebXRInputSourceArray.h:
* Source/WebCore/Modules/webxr/XRTargetRayMode.idl:
* Source/WebCore/platform/xr/PlatformXR.h:
* Source/WebKit/UIProcess/API/APIUIClient.h:
(API::UIClient::startXRSession):
* Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.h:
* Source/WebKit/UIProcess/Cocoa/UIDelegate.mm:
(WebKit::UIDelegate::setDelegate):
(WebKit::UIDelegate::UIClient::startXRSession):

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




More information about the webkit-changes mailing list