JavaScript Element contentvisibilityautostatechange Event
Beginner
⏱️ 12 min read
📚 Updated: Jul 2026
🎯 5 Examples
🚀 5 Try-it labs
DOM event
Instance event
Overview
What You’ll Learn
The contentvisibilityautostatechange event fires on elements with content-visibility: auto when the browser starts or stops skipping their contents. Learn event.skipped, how to pause canvas or timers off-screen, addEventListener vs oncontentvisibilityautostatechange, and five try-it labs.
01
Kind
Instance event
02
Type
ContentVisibilityAutoStateChangeEvent
03
When
Skip / unskip contents
04
Handler
oncontentvisibilityautostatechange
05
Key field
event.skipped
06
Status
Baseline newly available
Fundamentals
Introduction
Long pages often include heavy sections (charts, canvases, big lists) that sit far below the fold. CSS content-visibility: auto lets the browser skip layout and paint for those sections until they become relevant to the user—usually when they near the viewport.
contentvisibilityautostatechange is the JavaScript companion: when skipping starts or stops, your code can pause or resume expensive work and save CPU and battery.
💡
Beginner tip
Check event.skipped. If true, stop canvas loops / timers. If false, start them again. Do not use this to skip important accessibility / semantic DOM updates.
Concept
Understanding contentvisibilityautostatechange
An instance event that answers: “Did the browser just start or stop skipping this content-visibility: auto element’s contents?”
Requirescontent-visibility: auto on the element.
Fires when relevance changes and skipping starts or stops.
Event type — ContentVisibilityAutoStateChangeEvent.
true if the user agent is skipping the element’s contents; otherwise false
CSS partner
JavaScript
.panel {
content-visibility: auto;
contain-intrinsic-size: 300px; /* optional size hint while skipped */
}
Sequence
🔁 Skip / Resume Flow
Element has content-visibility: auto.
Browser decides contents are not relevant (for example far off-screen) and skips rendering.
contentvisibilityautostatechange fires with event.skipped === true — pause heavy JS work.
When the element becomes relevant again, the event fires with skipped === false — resume work.
Contents can still remain available to find-in-page, focus, and assistive technology even while skipped for painting—treat this as a performance signal, not a “delete the DOM” signal.
Compare
⚖️ vs IntersectionObserver
API
Role
content-visibility: auto + this event
Browser skips layout/paint; you sync JS work via skipped
IntersectionObserver
You observe viewport entry yourself; browser does not auto-skip paint
Together
Use this event when you already rely on content-visibility; fall back to IntersectionObserver on older browsers
contentvisibilityautostatechange is marked Baseline Newly available on MDN (since September 2024). Logos use the shared browser-image-sprite.png sprite from this project. Feature-detect and keep work running as a fallback on older browsers.
✓ Baseline · Newly available
Element contentvisibilityautostatechange
Works across the latest desktop and mobile browsers with content-visibility: auto when skip/unskip state changes.
NewNewly available
Google ChromeSupported · Modern Chromium
Supported
Mozilla FirefoxSupported · Recent releases
Supported
Apple SafariSupported · Recent macOS & iOS
Supported
Microsoft EdgeSupported · Chromium
Supported
OperaSupported · Modern versions
Supported
Internet ExplorerNo content-visibility / event
Unavailable
contentvisibilityautostatechangeBaseline 2024
Bottom line: Use content-visibility: auto with this event to pause expensive JS when contents are skipped; resume when skipped becomes false.
Wrap Up
Conclusion
contentvisibilityautostatechange is the “browser skipped or unskipped my contents” signal. Pair it with content-visibility: auto, read event.skipped, and pause heavy work while paint is skipped.
Attach the listener to the content-visibility: auto element
Pause canvas / timers when event.skipped is true
Consider contain-intrinsic-size to reduce scroll jumps
Feature-detect and keep a no-op fallback
❌ Don’t
Expect the event without content-visibility: auto
Skip semantic / accessibility DOM updates when skipped
Assume older browsers fire the event
Rely only on bubbling from a distant parent
Overwrite oncontentvisibilityautostatechange if you need multiple listeners
Summary
Key Takeaways
Knowledge Unlocked
Five things to remember about contentvisibilityautostatechange
Browser skip/unskip signal—pause expensive work with event.skipped.
5
Core concepts
⚡01
content-visibility
auto required
CSS
📄02
skipped
true = paused paint
API
🎨03
Pause canvas
MDN classic use
Pattern
♿️04
Keep semantics
a11y still matters
Caution
🎯05
Baseline 2024
newly available
Compat
❓ Frequently Asked Questions
It fires on an element with content-visibility: auto when the browser starts or stops skipping that element's contents because relevance to the user changed (for example the section scrolled far off-screen).
No. MDN marks it as Baseline Newly available (since September 2024). It is not Deprecated, Experimental, or Non-standard.
A ContentVisibilityAutoStateChangeEvent. The key property is skipped: true when the user agent is skipping the element's rendering, false when it is not.
Set content-visibility: auto on the element (via stylesheet or element.style.contentVisibility = "auto"). Without auto, this event does not apply.
No. MDN notes contents stay semantically relevant (for example for assistive technology). Use the signal to pause expensive rendering such as canvas loops or timers — not to drop meaningful accessibility updates.
Attach the listener directly to the element that has content-visibility: auto. Some guidance recommends capture or a direct listener because bubbling is not always reliable across implementations.
Did you know?
MDN’s classic demo pairs this event with a <canvas>: stop drawing when skipped is true, start again when it is false. That keeps fancy visuals cheap when the canvas is far off-screen.