Skip to content
Merged
Show file tree
Hide file tree
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
81 changes: 27 additions & 54 deletions files/en-us/web/api/element/domactivate_event/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,71 +14,46 @@ The **`DOMActivate`** event is fired at an element when it becomes active, such

## Syntax

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

```js-nolint
addEventListener("DOMActivate", (event) => { })

onDOMActivate = (event) => { }
```

> [!NOTE]
> There is no `onDOMActivate` event handler property for this event.

## Event type

A {{domxref("MouseEvent")}}. Inherits from {{domxref("UIEvent")}} and {{domxref("Event")}}.
A {{domxref("UIEvent")}}. Inherits from {{domxref("Event")}}.

{{InheritanceDiagram("MouseEvent")}}
{{InheritanceDiagram("UIEvent")}}

## Event properties
## Examples

[...]
This example listens for `DOMActivate` on a {{HtmlElement("button")}} element and displays its {{domxref("UIEvent/detail", "detail")}}.

## Examples
### HTML

```html
<svg
xmlns="http://www.w3.org/2000/svg"
version="1.2"
baseProfile="tiny"
xmlns:ev="http://www.w3.org/2001/xml-events"
width="6cm"
height="5cm"
viewBox="0 0 600 500">
<desc>Example: invoke an JavaScript function from a DOMActivate event</desc>

<!-- JavaScript to change the radius -->
<script>
<![CDATA[
function change(evt) {
const circle = evt.target;
const currentRadius = circle.getFloatTrait("r");
if (currentRadius === 100) {
circle.setFloatTrait("r", currentRadius * 2);
} else {
circle.setFloatTrait("r", currentRadius * 0.5);
}
}
]]>
</script>

<!-- Act on each DOMActivate event -->
<circle cx="300" cy="225" r="100" fill="red">
<handler type="text/javascript" ev:event="DOMActivate">
change(evt);
</handler>
</circle>

<text
x="300"
y="480"
font-family="Verdana"
font-size="35"
text-anchor="middle">
Activate the circle to change its size
</text>
</svg>
<button>Click</button>
```

### JavaScript

```js
const button = document.querySelector("button");

button.addEventListener("DOMActivate", (event) => {
button.textContent = `Click count: ${event.detail}`;
});
```

{{EmbedLiveSample("Examples", 640, 200)}}
### Result

Note that `detail` of the `DOMActivate` event may have browser-specific behavior. It may either always be `0`, or have similar behavior as the {{domxref("Element/click_event", "click")}} event's `detail` (i.e., indicating the number of consecutive clicks).

{{EmbedLiveSample("Examples")}}

## Specifications

Expand All @@ -90,7 +65,5 @@ A {{domxref("MouseEvent")}}. Inherits from {{domxref("UIEvent")}} and {{domxref(

## See also

- {{domxref("MouseEvent")}}
- {{domxref("Element/mousedown_event", "mousedown")}}
- {{domxref("Element/mouseup_event", "mouseup")}}
- {{domxref("Element/mousemove_event", "mousemove")}}
- {{domxref("UIEvent")}}
- {{domxref("Element/click_event", "click")}}
13 changes: 9 additions & 4 deletions files/en-us/web/api/ext_color_buffer_half_float/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,22 @@ WebGL extensions are available using the {{domxref("WebGLRenderingContext.getExt
- `ext.RGBA16F_EXT`
- : RGBA 16-bit floating-point color-renderable format.
- `ext.RGB16F_EXT`
- : RGB 16-bit floating-point color-renderable format.
- : RGB 16-bit floating-point format. In WebGL 1.0, this may be color-renderable (implementation-dependent). In WebGL 2.0, this format is not color-renderable.
- `ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`
- : ?
- : Passed to {{domxref("WebGLRenderingContext.getFramebufferAttachmentParameter()")}} to get the framebuffer type.
- `ext.UNSIGNED_NORMALIZED_EXT`
- : ?
- : The framebuffer contains unsigned fixed-point components.

## Extended methods

This extension extends {{domxref("WebGLRenderingContext.renderbufferStorage()")}}:

- The `internalformat` parameter now accepts `ext.RGBA16F_EXT` and `ext.RGB16F_EXT`.
- In WebGL 1.0 contexts, the `internalFormat` parameter now accepts `ext.RGBA16F_EXT` and `ext.RGB16F_EXT`. However, `ext.RGB16F_EXT` support is optional and applications must check framebuffer completeness to determine if it's supported.
- In WebGL 2.0 contexts, the `internalFormat` parameter now accepts `ext.RGBA16F_EXT`. The `RGB16F` format is not color-renderable in WebGL 2.0.

It extends {{domxref("WebGLRenderingContext.getFramebufferAttachmentParameter()")}}:

- In WebGL 1.0 contexts, the `pname` parameter now accepts `ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`. An `INVALID_OPERATION` error is generated if `attachment` is `DEPTH_STENCIL_ATTACHMENT` and `pname` is `FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`. When `pname` is `ext.FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE_EXT`, `getFramebufferAttachmentParameter()` returns either `gl.FLOAT` or `gl.UNSIGNED_NORMALIZED_EXT` for floating-point or unsigned fixed-point components respectively.

## Examples

Expand Down