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

[cssom-view-1] Add more checkVisibility dictionary properties #9549

Merged
merged 2 commits into from Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 22 additions & 4 deletions cssom-view-1/Overview.bs
Expand Up @@ -1161,6 +1161,9 @@ dictionary ScrollIntoViewOptions : ScrollOptions {
dictionary CheckVisibilityOptions {
boolean checkOpacity = false;
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add a Note that says that checkVisibilityCSS and checkOpacity are deprecated.

Copy link
Member Author

Choose a reason for hiding this comment

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

We haven't resolved to deprecate these. I've added a note that says they are historical names that have aliases that match the new naming scheme. I suspect we want to revisit at CSSWG if we want to deprecate the names though.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it's fine to call them deprecated IMO. I don't feel strongly either way tho. Assuming @smfr is fine with the current wording feel free to merge.

boolean checkVisibilityCSS = false;
boolean contentVisibilityAuto = false;
boolean opacityProperty = false;
boolean visibilityProperty = false;
};

partial interface Element {
Expand All @@ -1187,6 +1190,10 @@ partial interface Element {
};
</pre>

Note: The {{CheckVisibilityOptions/checkOpacity}} and {{CheckVisibilityOptions/checkVisibilityCSS}} properties are historical names.
These properties have aliases that match the new naming scheme,
namely {{CheckVisibilityOptions/opacityProperty}} and {{CheckVisibilityOptions/visibilityProperty}}.

The <dfn method for=Element>getClientRects()</dfn> method, when invoked, must return the result of the following algorithm:

1. If the element on which it was invoked does not have an associated [=CSS/box=] return an empty {{DOMRectList}} object and stop this algorithm.
Expand Down Expand Up @@ -1246,15 +1253,25 @@ Note: The {{DOMRect}} object returned by {{Element/getBoundingClientRect()}} is
1. If an ancestor of |this| in the [=flat tree=]
has ''content-visibility: hidden'',
return false.
1. If the {{CheckVisibilityOptions/checkOpacity}} dictionary member of |options|
is true,
1. If either the {{CheckVisibilityOptions/opacityProperty}}
or the {{CheckVisibilityOptions/checkOpacity}}
dictionary members of |options|
are true,
and |this|, or an ancestor of |this| in the [=flat tree=],
has a computed 'opacity' value of ''0'',
return false.
1. If the {{CheckVisibilityOptions/checkVisibilityCSS}} dictionary member of |options|
is true,
1. If either the {{CheckVisibilityOptions/visibilityProperty}}
or the {{CheckVisibilityOptions/checkVisibilityCSS}}
dictionary members of |options|
are true,
and |this| is <l spec=css-display>[=invisible=]</l>,
return false.
1. If the {{CheckVisibilityOptions/contentVisibilityAuto}} dictionary member of |options|
is true
and an ancestor of |this| in the [=flat tree=]
[=skips its contents=]
due to ''content-visibility: auto'',
return false.
1. Return true.
</div>

Expand Down Expand Up @@ -1984,6 +2001,7 @@ generally not listed.
<h3 id='changes-from-2022-07-07' class=no-num>Changes From 07 July 2022</h3>
* Introduced the {{VisualViewport}} API and related concepts
* Pinch zoom is now renamed to <a>scale factor</a>
* Added visibilityProperty, opacityProperty, and contentVisiblityAuto properties for {{Element/checkVisibility()}} method.

<h3 id='changes-from-2022-06-22' class=no-num>Changes From 22 June 2022</h3>
* Adam Argyle moved the <a event>scrollend</a> event from <a href="https://wicg.github.io/overscroll-scrollend-events/">WICG overscroll-scrollend-events</a> to [[CSSOM-VIEW-1]]
Expand Down