[csswg-drafts] [css-contain][css-sizing] ScrollIntoView a descendant of element with content-visibility:auto (#9337)

cathiechen has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-contain][css-sizing] ScrollIntoView a descendant of element with content-visibility:auto ==
In [1], point 5 defines the behavior of `scrollIntoView` targeting on an element with `content-visibility:auto`.
> For the purposes of scrolling operations, such as [scrollIntoView()](https://drafts.csswg.org/cssom-view-1/#dom-element-scrollintoview), an element with [content-visibility: auto](https://drafts.csswg.org/css-contain-2/#propdef-content-visibility) that is [skipping its contents](https://drafts.csswg.org/css-contain-2/#skips-its-contents) has its size and location determined with [size containment](https://drafts.csswg.org/css-contain-2/#size-containment) still active.

However, it does not mention the behavior of `scrollIntoView` targeting on a descendant with `content-visibility:auto`. Tested in Chromium and WebKit, the `content-visibility:auto` is treated as visible before scrolling, it makes sense to me. The related test cases are [content-visibility-075.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/content-visibility/content-visibility-075.html) and [content-visibility-076.html](https://github.com/web-platform-tests/wpt/blob/master/css/css-contain/content-visibility/content-visibility-076.html).
Should we make it clear in the specification?  Maybe something like this?
1. Before scrolling, if the element with c-v: auto has descendant as the target of scrolling, change the relevancy to visible, so that the element could be laid out as if it were relevancy to user. Here we could add a test with nested c-v auto, see test content-visibility-086.html in [the FireFox patch](https://phabricator.services.mozilla.com/D186943).
2. Performance scrolling.
3. After scrolling, we need to check the relevancy again in the intersection observer, if the element with c-v auto is not visible, we should hide its content again. This could happen if there is `overflow: clip`. See test case content-visibility-087.html in [the FireFox patch](https://phabricator.services.mozilla.com/D186943).

@emilio @vmpstr @rwlbuis WDYT?

[1] https://drafts.csswg.org/css-contain-2/#cv-notes

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/9337 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 11 September 2023 19:15:14 UTC