Skip to content
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

Event page: Add syntax section, remove table #10431

Merged
merged 1 commit into from
Nov 10, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 14 additions & 20 deletions files/en-us/web/api/xrlightprobe/reflectionchange_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,21 @@ browser-compat: api.XRLightProbe.reflectionchange_event
---
{{APIRef("WebXR Device API")}}

The WebXR **`reflectionchange`** event is passed to an {{domxref("XRLightProbe")}} each time the estimated reflection cube map changes. This happens in response to use movements through different lighting conditions or to direct changes to lighting itself.

<table class="properties">
<tbody>
<tr>
<th>Cancelable</th>
<td>No</td>
</tr>
<tr>
<th>Interface</th>
<td>{{domxref("Event")}}</td>
</tr>
<tr>
<th>Event handler property</th>
<td><code>onreflectionchange</code></td>
</tr>
</tbody>
</table>
The WebXR **`reflectionchange`** event fires each time the estimated reflection cube map changes. This happens in response to use movements through different lighting conditions or to direct changes to lighting itself. This event is not cancelable.

## Syntax

Use the event name in methods like {{domxref("EventTarget.addEventListener", "addEventListener()")}}, or set an event handler property.

```js
addEventListener('reflectionchange', () => { });

onreflectionchange = event => { });
```

## Event type

{{domxref("Event")}}.

## Examples

Expand All @@ -56,8 +52,6 @@ lightProbe.addEventListener('reflectionchange', () => {
The `reflectionchange` event is also available using the `onreflectionchange` event handler property.

```js
const glBinding = new XRWebGLBinding(xrSession, gl);

lightProbe.onreflectionchange = event => {
glCubeMap = glBinding.getReflectionCubeMap(lightProbe);
});
Expand Down