Skip to content

Commit 2fcac20

Browse files
committed
Add ContentVisibilityAutoStateChanged event
1 parent b5cf7d9 commit 2fcac20

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

css-contain-2/Overview.bs

+46
Original file line numberDiff line numberDiff line change
@@ -1552,6 +1552,52 @@ Using ''content-visibility: auto''</h3>
15521552
will be forced to rely on the ''200px'' height estimate.
15531553
</div>
15541554

1555+
Detecting ''content-visibility: auto'' state changes: the 'ContentVisibilityAutoStateChanged' event {#content-visibility-auto-state-changed}
1556+
--------------------------------------------------------------------------------------------------------------------------------------------
1557+
1558+
<pre class='idl'>
1559+
[Exposed=Window]
1560+
interface ContentVisibilityAutoStateChangedEvent : Event {
1561+
constructor(DOMString type, optional ContentVisibilityAutoStateChangedEventInit eventInitDict = {});
1562+
readonly attribute boolean skipped;
1563+
};
1564+
dictionary ContentVisibilityAutoStateChangedEventInit : EventInit {
1565+
boolean skipped = false;
1566+
};
1567+
</pre>
1568+
1569+
<div class="attributes">
1570+
1571+
Description of ContentVisibilityAutoStateChangedEvent attributes:
1572+
1573+
: <dfn attribute for=ContentVisibilityAutoStateChangedEvent>skipped</dfn>
1574+
:: Set to true if target changed state to [=skip its contents=], and false otherwise.
1575+
1576+
</div>
1577+
1578+
<div class="members">
1579+
1580+
Description of ContentVisibilityAutoStateChangedEventInit members:
1581+
1582+
: <dfn dict-member for=ContentVisibilityAutoStateChangedEventInit>skipped</dfn>
1583+
:: See the description of the {{ContentVisibilityAutoStateChangedEvent/skipped}} attribute.
1584+
1585+
</div>
1586+
1587+
This event is fired on an element with ''content-visibility: auto'' style when
1588+
the rendering state changes and the element either becomes or stops being
1589+
[=relevant to the user=].
1590+
1591+
This event is dispatched by posting a task at the time when the state change occurs.
1592+
1593+
<p class=note>This event is a convenient way to track the state of
1594+
''content-visibility: auto'' elements. By observing the event, the developer
1595+
can to stop or start additional work within the affected subtree, such as DOM
1596+
updates or canvas redraws. It is important to remember that
1597+
''content-visibility: auto'' subtree elements are exposed to accessibility
1598+
tooling. One must take care to ensure that the content remains sufficiently
1599+
updated for assistive technology consumption.</p>
1600+
15551601
Restrictions and Clarifications {#cv-notes}
15561602
-------------------------------------------
15571603

0 commit comments

Comments
 (0)