Skip to content

Editorial review: Document WebXR visibilitymaskchange event#43975

Open
chrisdavidmills wants to merge 2 commits intomdn:mainfrom
chrisdavidmills:xrsession-visibilitymaskchange-event
Open

Editorial review: Document WebXR visibilitymaskchange event#43975
chrisdavidmills wants to merge 2 commits intomdn:mainfrom
chrisdavidmills:xrsession-visibilitymaskchange-event

Conversation

@chrisdavidmills
Copy link
Copy Markdown
Contributor

Description

Chrome 144 adds support for the visibilitymaskchange event/XRVisibilityMaskChange event object; see https://chromestatus.com/feature/5073760055066624.

This PR adds documentation for:

  • The XRVisibilityMaskChange event object and all its members.
  • The visibilitymaskchange event
  • The XRView.index property.

Motivation

Additional details

Related issues and pull requests

@chrisdavidmills chrisdavidmills requested a review from a team as a code owner April 30, 2026 13:54
@chrisdavidmills chrisdavidmills requested review from hamishwillee and removed request for a team April 30, 2026 13:54
@github-actions github-actions Bot added the Content:WebAPI Web API docs label Apr 30, 2026
@chrisdavidmills chrisdavidmills changed the title Document visibilitymaskchange event Technical review: Document WebXR visibilitymaskchange event Apr 30, 2026
@github-actions github-actions Bot added the size/m [PR only] 51-500 LoC changed label Apr 30, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 30, 2026

Preview URLs (11 pages)

Flaws (4)

Note! 8 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/API/XRVisibilityMaskChangeEvent/indices
Title: XRVisibilityMaskChangeEvent: indices property
Flaw count: 1

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Uint32Array which is a redirect

URL: /en-US/docs/Web/API/XRVisibilityMaskChangeEvent/vertices
Title: XRVisibilityMaskChangeEvent: vertices property
Flaw count: 1

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Float32Array which is a redirect

URL: /en-US/docs/Web/API/XRVisibilityMaskChangeEvent/XRVisibilityMaskChangeEvent
Title: XRVisibilityMaskChangeEvent: XRVisibilityMaskChangeEvent() constructor
Flaw count: 2

  • macros:
    • Macro domxref produces link /en-US/docs/Web/API/Uint32Array which is a redirect
    • Macro domxref produces link /en-US/docs/Web/API/Float32Array which is a redirect
External URLs (2)

URL: /en-US/docs/Web/API/XRSession/visibilitymaskchange_event
Title: XRSession: visibilitymaskchange event


URL: /en-US/docs/Web/API/XRVisibilityMaskChangeEvent
Title: XRVisibilityMaskChangeEvent

(comment last updated: 2026-05-01 08:21:34)


```js
xrSession.addEventListener("visibilitymaskchange", (e) => {
if (userSessionEnded) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NIT: This is a little confusing, I thought it was tracking some variable that the session had already ended at first glance/read through. maybe userRequestsSessionEnd and clear it in the block as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a fair comment. I've updated the variable name throughout to userRequestsSessionEnd in my next commit.


{{APIRef("WebXR Device API")}}{{SecureContext_Header}}

The read-only **`vertices`** property of the {{domxref("XRVisibilityMaskChangeEvent")}} interface is an array of coordinates representing the vertices required to draw the entire scene displayed in the {{domxref("XRView")}}. If this array is empty, the whole region of the `XRView` will be drawn.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe also reference here that it's intended to be referenced into by the indices property.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, makes sense. I've added the following in a new paragraph:

The {{domxref("XRVisibilityMaskChangeEvent.indices", "indices")}} array specifies the indices of the vertices array that should be drawn to display the currently visible part of the scene displayed in the XRView.

Copy link
Copy Markdown

@alcooper91 alcooper91 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@chrisdavidmills chrisdavidmills changed the title Technical review: Document WebXR visibilitymaskchange event Editorial review: Document WebXR visibilitymaskchange event May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants