Skip to content

[css-anchor-position-1] Compensating for Scroll & overflow: clip in one axis #12842

@dshin-moz

Description

@dshin-moz

Currently, we compensate for scroll if anchor() refers a default anchor, or an anchor that has the same scroll container.

However, if we have e.g.

<div class=scroller>
  <div class=default-anchor style="anchor-name: --default;"></div>
  <div class=another-scroller style="overflow-x: scroll; overflow-y: clip;">
    <div class=another-anchor style="anchor-name: --another;"></div>
  </div>
  <div class=positioned>
</div>

and .positioned has position-anchor: --default; top: anchor(--another, bottom);, no scroll compensation is currently done in that axis, I imagine because overflow-x: scroll makes .another-scroller a scroll container.

Still, seems a bit odd that we won't compensate for scroll, even if --default and --anchor would scroll together?

(Testcase attached)
anchor-scroll.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions