Skip to content
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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

tidoust
Copy link
Member

@tidoust tidoust commented Sep 14, 2022

A recent commit improved the definition of the event somehow but the link between the contentvisibilityautostatechanged event and the ContentVisibilityAutoStateChanged is not specified anywhere. This update switches to the usual phrasing used across specs for firing events to make the link between the event type and the interface explicit.

Also, Apart from a few exceptions in old specs, events are always named with verbs in the present tense. Accordingly, this update switches the event type to contentvisibilityautostatechange instead of contentvisibilityautostatechanged and also renames the IDL interfaces. For what it's worth, this guidance does not yet appear in the TAG's API design principles but is considered for inclusion in w3ctag/design-principles#280

This partially addresses concerns raised in #7603. The spec would still need to define an oncontentvisibilityautostatechange event handler IDL attribute, which could perhaps be done by extending the GlobalEventHandlers mixin (to target HTMLElement, MathMLElement and SVGElement all at once) or by working with the WHATWG to integrate the change in HTML directly.

A [recent commit](w3c@c3d88b2)
improved the definition of the event somehow but the link between the
`contentvisibilityautostatechanged` event and the
`ContentVisibilityAutoStateChanged` is not specified anywhere. This update
switches to the usual phrasing used across specs for firing events to make the
link between the event type and the interface explicit.

Also, Apart from a few exceptions in old specs, events are always named with
verbs in the present tense. Accordingly, this update switches the event type to
`contentvisibilityautostatechange` instead of
`contentvisibilityautostatechanged` and also renames the IDL interfaces. For
what it's worth, this guidance does not yet appear in the TAG's API design
principles but is considered for inclusion in:
  w3ctag/design-principles#280

This partially addresses concerns raised in w3c#7603. The spec would still need to
to define an `oncontentvisibilityautostatechange` event handler IDL attribute,
which could perhaps be done by extending the `GlobalEventHandlers` mixin (to
target `HTMLElement`, `MathMLElement` and `SVGElement` all at once) or by
working with the WHATWG to integrate the change in HTML directly.
@paulirish
Copy link
Member

+1 This name change went under the radar. And Chrome 108 shipped with contentvisibilityautostatechange.

@svgeesus
Copy link
Contributor

(kicking the bots)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants