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

Ff122 Element.checkVisibily options #21715

Merged
merged 4 commits into from
Jan 2, 2024

Conversation

hamishwillee
Copy link
Contributor

@hamishwillee hamishwillee commented Dec 22, 2023

Element.checkVisibility has an options object parameter. In the spec this has two options, checkOpacity and checkVisibilityCSS, both of which are implemented AFAIK in Chrome (105) and Firefox (106) on first release of the method.

The spec has an unmerged PR csswg-drafts#9549 to add three more options.

  • opacityProperty and visibilityProperty are aliases for the original names with a new naming convention. The old names are not yet "deprecated" in the spec.
  • contentVisibilityAuto allows you to check if an element is being skipped for layout because it is not in the view.

Even though the spec change hasn't merged, Chrome has implemented the change in 121 and Firefox has implemented it in nightly in FF122 (https://bugzilla.mozilla.org/show_bug.cgi?id=1859852).

  • This adds all the options as subfeatures. For FF the new options are marked as preview. For Chrome as 121.
  • The new options are marked as experimental because FF is still in nightly
  • The new options are marked as standard even though the spec change has not merged. You might argue that.
  • The old options are included because at some point they are going to be deprecated. TO me it makes sense to include them here so that when it is time to remove them that becomes easy.

Note that it is not entirely clear that the new options are preview in the web IDL, however you really can't test contentVisibilityAuto except in preview because the associated CSS is nightly only.
My gut feeling is that all the options are actually "released", because I think the result of checkVisibility() is correct whether or not you are in preview (because it defaults false, and the feature isn't enabled results in false). I'm asking on the issue, but would appreciate your opinion - in which case we'd set FF release on these to 122?

Other docs work for this can be tracked in mdn/content#31107

@Elchi3 @queengooborg If you are around and able, review appreciated. Mostly because I'm around on and off over January.

@github-actions github-actions bot added the data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API label Dec 22, 2023
@nt1m
Copy link
Contributor

nt1m commented Dec 22, 2023

FWIW, Safari Technology Preview supports Element.prototype.checkVisibility including the new options, see: https://webkit.org/blog/14780/release-notes-for-safari-technology-preview-184/

@hamishwillee
Copy link
Contributor Author

@Elchi3 What's the right way of indicating browser 184 - it appear to be an option in the browser stats yet (I presume that maps to 18.4?). Would I just mark as "preview"? Note, the changes appear to match spec - WebKit/WebKit@2d9a965

@queengooborg
Copy link
Contributor

"184" refers to Safari Technology Preview v184, which does NOT map to 18.4 (we're not at that version number yet) -- "preview" is what we'd want to use here!

@hamishwillee
Copy link
Contributor Author

Thanks, Safari added as Preview

api/Element.json Outdated Show resolved Hide resolved
api/Element.json Outdated Show resolved Hide resolved
api/Element.json Outdated Show resolved Hide resolved
api/Element.json Outdated Show resolved Hide resolved
Copy link
Member

@Elchi3 Elchi3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @hamishwillee 👍

@Elchi3 Elchi3 merged commit aa632b5 into mdn:main Jan 2, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
data:api Compat data for Web APIs. https://developer.mozilla.org/docs/Web/API
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants