Skip to content

[css-overflow-5] Should ::scroll-marker pseudo-elements within skipped content-visibility: auto elements be discovered? #11705

Open
@flackr

Description

@flackr

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:

  1. 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).
  2. 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:
    1. Always compute style within content-visibility: auto when the nearest ancestor scroll container is not skipped and has a non-none scroll-marker-group property value.
    2. 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.
    3. Consider how to allow this considering the skipped content is supposed to be contain: style layout paint size.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions