Open
Description
If you have ::scroll-marker
pseudo-elements declared on elements within content-visibility: auto
, what should happen? Consider a simple demo (view demo page):
<style>
.scroller { scroll-marker-group: after; }
.scroller > * { content-visibility: auto; }
h1::scroll-marker { content: ""; }
</style>
<div class=scroller>
<div><h1>1</h1></div>
<div><h1>2</h1></div>
<!-- ... -->
<div><h1>n</h1></div>
</div>
We have two main options:
- Ignore them when they are skipped. This falls naturally out of the spec since skipped objects have style containment and so we shouldn't discover these markers, however this would result in the markers in the marker group changing as you scroll based on what is currently skipped. Authors could work around this by ensuring that they create markers on or above the element with
content-visibility: auto
(e.g. on the<div>
elements in the above example). - Spec that we should discover these. We could do this in a similar way to how the spec requires that content-visibility: auto is still discoverable to find in page, tab order, etc. In particular, this means we would need to:
- Always compute style within
content-visibility: auto
when the nearest ancestor scroll container is not skipped and has a non-nonescroll-marker-group
property value. - Either compute layout, or define that when computing the :target-current ::scroll-marker that we use the scroll into view position of the nearest non-skipped ancestor.
- Consider how to allow this considering the skipped content is supposed to be
contain: style layout paint size
.
- Always compute style within