Skip to content

[css-anchor-position] position-visibility: no-overflow does not support Top Layers elements #10454

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
pont1s opened this issue Jun 17, 2024 · 1 comment

Comments

@pont1s
Copy link

pont1s commented Jun 17, 2024

According to the specification, the anchor element is "clipping", if anchor’s ink overflow rectangle is fully clipped by an element which is an ancestor of anchor but a descendant of abspos’s containing block.

If the anchor element is in the top layer (such as a Popover), then the block containing it is the viewport.

As a result, the anchor element is in the top layer overflowed the container when the position-visibility: no-overflow property is set.

When the anchor element is a simple <div></div> element (can be seen by removing the popover="auto" attribute), the element is clipped correctly

Example of this case: https://codepen.io/pont1s/pen/zYQdPoo (Chrome >= 125)

I think this is a common use case, is there any way to implement the expected behavior?

@tabatkins
Copy link
Member

Given the functionality currently in the spec, no. As you say, the no-overflow value depends on it overflowing its CB, and when it's in the top layer that's very high. (Not necessarily the viewport; if it's an abspos top layer it's just using the ICB.)

The plan is that we'll have a new positioning property, provisionally called position-container, which points to some arbitrary element and causes the abpos to generate its CB from that element (plus clip the same as that element, etc, so it looks like it's contained by the scrollers, etc.) See #9868

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants