Skip to content

[css-contain-2] Improve definition of contentvisibilityautostatechange event #7740

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
28 changes: 15 additions & 13 deletions css-contain-2/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -1690,41 +1690,43 @@ Using ''content-visibility: auto''</h3>
will be forced to rely on the ''200px'' height estimate.
</div>

Detecting ''content-visibility: auto'' state changes: the <a event>contentvisibilityautostatechanged</a> event {#content-visibility-auto-state-changed}
Detecting ''content-visibility: auto'' state changes: the <a event>contentvisibilityautostatechange</a> event {#content-visibility-auto-state-changed}
--------------------------------------------------------------------------------------------------------------------------------------------

The <dfn event dfn-for="Element">contentvisibilityautostatechanged</dfn> event is fired on an element with ''content-visibility: auto'' style when
the rendering state changes and the element either becomes or stops being
[=relevant to the user=].
When the rendering state of an element with ''content-visibility: auto'' style
changes and the element either becomes or stops being [=relevant to the user=],
the user agent must [=fire an event=] named
<dfn event dfn-for="Element">contentvisibilityautostatechange</dfn>
at the element using {{ContentVisibilityAutoStateChangeEvent}}.

This event is dispatched by posting a task at the time when the state change occurs.

<pre class='idl'>
[Exposed=Window]
interface ContentVisibilityAutoStateChangedEvent : Event {
constructor(DOMString type, optional ContentVisibilityAutoStateChangedEventInit eventInitDict = {});
interface ContentVisibilityAutoStateChangeEvent : Event {
constructor(DOMString type, optional ContentVisibilityAutoStateChangeEventInit eventInitDict = {});
readonly attribute boolean skipped;
};
dictionary ContentVisibilityAutoStateChangedEventInit : EventInit {
dictionary ContentVisibilityAutoStateChangeEventInit : EventInit {
boolean skipped = false;
};
</pre>

<div class="attributes">

Description of ContentVisibilityAutoStateChangedEvent attributes:
Description of ContentVisibilityAutoStateChangeEvent attributes:

: <dfn attribute for=ContentVisibilityAutoStateChangedEvent>skipped</dfn>
: <dfn attribute for=ContentVisibilityAutoStateChangeEvent>skipped</dfn>
:: Set to true if target changed state to [=skip its contents=], and false otherwise.

</div>

<div class="members">

Description of ContentVisibilityAutoStateChangedEventInit members:
Description of ContentVisibilityAutoStateChangeEventInit members:

: <dfn dict-member for=ContentVisibilityAutoStateChangedEventInit>skipped</dfn>
:: See the description of the {{ContentVisibilityAutoStateChangedEvent/skipped}} attribute.
: <dfn dict-member for=ContentVisibilityAutoStateChangeEventInit>skipped</dfn>
:: See the description of the {{ContentVisibilityAutoStateChangeEvent/skipped}} attribute.

</div>

Expand Down Expand Up @@ -2072,7 +2074,7 @@ Changes from <a href="https://www.w3.org/TR/2020/WD-css-contain-2-20201216/">202
* Defined that elements having an ancestor with ''content-visibility: hidden'' don't generate boxes in the top layer
* Defined that being in the top-layer makes an element relevant to the user
* Noted that paint effects with non-local effects can limit certain optimization opportunities.
* Add ContentVisibilityAutoStateChanged event
* Add ContentVisibilityAutoStateChange event

<h3 id="changes-since-2020-06-03">
Changes from <a href="https://www.w3.org/TR/2020/WD-css-contain-2-20200603/">2020-06-03 Working Draft</a>
Expand Down