Skip to content

[css-anchor-position] anchor() definition says it uses initial scroll positions, but "Taking Scroll Into Account" does not. #12058

Open
@dshin-moz

Description

@dshin-moz

In the definition of anchor():

An anchor() function representing a valid anchor function resolves at computed value time (using style & layout interleaving) to the that would align the edge of the positioned boxes' inset-modified containing block corresponding to the property the function appears in with the specified border edge of the target anchor element, assuming that all scroll containers between the target anchor element and the positioned box’s containing block are scrolled to their initial scroll position (but see § 3.4 Taking Scroll Into Account).

But then, in "Taking Scroll Into Account":

All anchor references are calculated as if all scroll containers were at their initial scroll position, and then have their associated remembered scroll offset added to them.

Not far above, it says:

When a positioned element is first displayed, or when it changes fallbacks, its position is correctly calculated according to the up-to-date position of all anchor references.

So I'd think ultimately anchor() should reflect position of scrollers when it toggles in and out of display: none or fallback changes? Comment #10999 seems to match this as well.

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