ContentVisibilityAutoStateChangeEvent: skipped property
The skipped
read-only property of the ContentVisibilityAutoStateChangeEvent
interface returns true
if the user agent skips the element's contents, or false
otherwise.
Value
A boolean. Returns true
if the user agent skips the element's contents, or false
otherwise.
Examples
js
const canvasElem = document.querySelector("canvas");
canvasElem.addEventListener("contentvisibilityautostatechange", stateChanged);
canvasElem.style.contentVisibility = "auto";
function stateChanged(event) {
if (event.skipped) {
stopCanvasUpdates(canvasElem);
} else {
startCanvasUpdates(canvasElem);
}
}
// Call this when the canvas updates need to start.
function startCanvasUpdates(canvas) {
// …
}
// Call this when the canvas updates need to stop.
function stopCanvasUpdates(canvas) {
// …
}
Specifications
Specification |
---|
CSS Containment Module Level 2 # dom-contentvisibilityautostatechangeevent-skipped |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
skipped |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support
- No support
- No support
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
See also
- The
contentvisibilityautostatechange
event - CSS Containment
- The
content-visibility
property - The
contain
property