Skip to content
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

overflow-clip-margin or overflow-clip along one axis only on root or target #518

Open
wangxianzhu opened this issue Oct 31, 2023 · 0 comments

Comments

@wangxianzhu
Copy link

The spec (root intersection rect) says "An Element is defined as having a content clip if its computed style has overflow properties that cause its content to be clipped to the element’s padding edge. ... if the intersection root has a content clip ...".

However, if there is a non-zero overflow-clip-margin, or overflow-clip along one axis only, the clip doesn't clip the content to the padding edge. According to the current spec, the cases are not "having a content clip".

If we treat the cases as "having a content clip", we have the following choices for the root intersection rectangle:

  1. the padding box
  2. the client bounding box (i.e. the border box rect if the box is not fragmented)
  3. the clipping rect (in the case of overflow-clip only along one axis, the rect has infinite bounds in the unclipped direction)
  4. intersection of 2 and 3

The definition of the target bounding box also has an issue in the cases, but perhaps it's an issue with https://drafts.csswg.org/cssom-view-1/#element-get-the-bounding-box instead of intersection observer. Currently Chrome uses the union of the border box rect and the clip rect if there is effective overflow-clip-margin.

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

No branches or pull requests

1 participant