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

should toggle-visibility have contain:paint or at least its z-ordering effects (stacking context) all of the time? #38

Open
dbaron opened this issue Sep 1, 2022 · 7 comments

Comments

@dbaron
Copy link
Collaborator

dbaron commented Sep 1, 2022

Right now toggle-visibility not being normal acts like content-visibility: auto is present only when the toggle is in the inactive state. This implies contain: paint, which has z-ordering effects, which means that an element with toggle-visibility != normal has a higher default z-order when its contents are hidden than when its contents are visible.

This seems like it might be undesirable.

Perhaps it would make sense to imply some of the containment, or at least the z-ordering effects of contain:paint (i.e., creating a stacking context), whenever toggle-visibility is not normal rather than only when the toggle is inactive.

@dbaron
Copy link
Collaborator Author

dbaron commented Sep 8, 2022

One possibility is that toggle-visibility != normal should work like content-visibility: auto, except connected to the toggle instead of connected to being on-screen. (Right now the spec says that it's only like content-visibility: auto when the toggle is in an inactive state.) This definition does seem to be easy to implement in an implementation that already implements content-visibility.

That said, it seems less necessary, and perhaps undesirable, to have all the containment effects when the toggle is active. However, I think the z-ordering effects are needed, and there may be other aspects of containment that I'm not thinking of that either are useful for the visible state or useful to switch states efficiently.

@dbaron
Copy link
Collaborator Author

dbaron commented Sep 8, 2022

That said, contain affects a lot of CSS properties, and having whether contain is present depend on toggle state means a ton of CSS property computed values would suddenly depend on toggle state, which is probably undesirable. So maybe it should just work like content-visibility: auto with all the containment effects.

@tabatkins
Copy link
Owner

Yeah, I think that's just badly written on my part. The intention is definitely what you suggested, where it acts like content-visiblity: auto but tied to toggle state instead.

@tabatkins
Copy link
Owner

(Like, I'm still not entirely certain I shouldn't just be using content-visibility with a new value.)

@dbaron
Copy link
Collaborator Author

dbaron commented Sep 8, 2022

"like a new value of content-visibility" was sort of how I was thinking about the implementation.

@dbaron
Copy link
Collaborator Author

dbaron commented Sep 8, 2022

(An interesting question for the case of keeping it a distinct property is what to do when both content-visibility and toggle-visibility have non-initial values. I'm inclined to follow content-visibility since most of its effects are stronger.)

@tabatkins
Copy link
Owner

Yeah, I think the behavior we want is that toggle-visibility can apply hidden-ness in addition to things like content-visibility.

chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 4, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 11, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 11, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 13, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 13, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
aarongable pushed a commit to chromium/chromium that referenced this issue Oct 13, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922815
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058772}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 13, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922815
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058772}
chromium-wpt-export-bot pushed a commit to web-platform-tests/wpt that referenced this issue Oct 13, 2022
See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922815
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058772}
moz-v2v-gh pushed a commit to mozilla/gecko-dev that referenced this issue Oct 26, 2022
…., a=testonly

Automatic update from web-platform-tests
Implement toggle-visibility CSS property.

See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922815
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058772}

--

wpt-commits: 4469e89eb413d5f44699210b736bdb98b6b3333f
wpt-pr: 36264
jamienicol pushed a commit to jamienicol/gecko that referenced this issue Oct 31, 2022
…., a=testonly

Automatic update from web-platform-tests
Implement toggle-visibility CSS property.

See specification:
https://tabatkins.github.io/css-toggle/#toggle-visibility-property
and clarifying discussion in:
tabatkins/css-toggle#38

(Support for toggles is behind the CSSToggles flag, which is currently
off.)

Bug: 1250716
Change-Id: Ib29d879b7ba81dcfe95cb59fe6e6b66f0e24e528
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3922815
Reviewed-by: Joey Arhar <jarhar@chromium.org>
Reviewed-by: Vladimir Levin <vmpstr@chromium.org>
Commit-Queue: David Baron <dbaron@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1058772}

--

wpt-commits: 4469e89eb413d5f44699210b736bdb98b6b3333f
wpt-pr: 36264
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

No branches or pull requests

2 participants