-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Interactive Regions API #86
Comments
@AdaRoseCannon @toji I will share more fleshing out but would appreciate if have any initial feedback or thoughts. Thanks! |
Thank you so much for putting this together. It is something I have been thinking about for a while, I was thinking something based around the layer API could be a good fit. I really like that they can be selected which is something I think would be really important. |
I'd probably do something like |
Yes a similar functionality could be accomplished with the Layer API as well, say with It would be good to establish more broadly the need for an API, of whatever exact form, that accomplishes 'hover' support. Probably a good call discussion topic. Is there a solution besides developer explicitly supplying a list? A (stereo) segmentation mask texture could work, but could be overly complicated. What level of visual hover is sufficient? The above supports rectangular (and rounded rectangle / circle) regions which wouldn't cover every scenario a developer might want hover highlight to support (i.e. highlight of a character model) but could be sufficient for many scenarios. |
Your proposal is very close to the one that was made for canvas hit regions. The important part of that proposal is that there is access to a "fallback DOM" which will give the screen reader access to the accessibility tree. |
I encountered this issue today during on-site device testing and filed a WebKit Accessibility issue with Apple before even seeing this thread. Here is a link to the issue: https://feedbackassistant.apple.com/feedback/13464533 Pasting below for convenience since the link above requires a login:
|
An Interactive Regions API would give the ability to define interactive regions within an immersive WebXR experience, allowing the OS (or the browser) to highlight these regions when gazed upon, providing users with intuitive visual feedback in a privacy conscious way.
The WebXR experience would be responsible for creating interactive regions and attaching them to an active WebXR session, and optionally listening for 'click' events on these regions.
Background
Hover effects are useful and ubiquitous on the web but they raise serious privacy concerns if they are driven directly by a user's gaze (e.g. via eye tracking on an HMD) in a naive way. To strike a balance between usability and user privacy, Apple introduced a privacy-preserving method with its visonOS wherein elements are visually highlighted when a user looks at them, but crucially the highlighting is done only by the OS, without any applications having knowledge of the highlighting state.
Applications must be able to specify the areas to highlight, 'interactive regions', to the OS. In the case of the Safari browser, the WebKit engine generates these regions on the 2D page from various pieces of webpage markup and styles. The webpage thus determines where these interactive regions are.
Extending this concept into the 3D world of WebXR would be a logical progression. While WebXR doesn't rely on traditional 2D DOM elements which a web engine could automatically identify and highlight, immersive experiences have their own set of 3D elements that users can interact with that would greatly benefit from being able see highlighted like they can see elsewhere in their interactions on the platform. As the browser can't automatically identify regions, the web developer would have to explicitly supply them.
References:
WWDC Safari talk, discussion of 2D web interactive regions:
https://developer.apple.com/videos/play/wwdc2023/10279/?time=288
Code:
An example of what usage of Interactive Regions would look like:
Prototype:
.
The text was updated successfully, but these errors were encountered: