Skip to content

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

@wangxianzhu

Description

@wangxianzhu

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions