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

[css-contain-2] interaction between content-visibility and overflow-clip-margin #5271

Closed
frivoal opened this issue Jun 30, 2020 · 2 comments
Closed

Comments

@frivoal
Copy link
Collaborator

frivoal commented Jun 30, 2020

Per css-contain-2 §4:

An element is relevant to the user if any of the following conditions are true:

  • The element is "on-screen": its containing box's border box intersects with the viewport, or a user-agent defined margin around the viewport.

paint containment normally clips to the padding box, which is normally smaller than the border box, so the above should be fine in general. However paint containment can be made to apply to a larger area using overflow-clip-margin. In that case, it seems that the element should also be considered relevant to the user if its overflow clip edge (i.e. padding edge + overflow-clip-margin) intersects with the viewport.

Moreover, since its only the contents of a skipped element that are not painted, rather than the element itself, it doesn't seem like the border box is the relevant one. So I don't feel we need to worry about the union of, or the larger of, the border box and the overflow clip edge, and in the sentence quoted above, we can just replace border box with overflow clip edge.

@frivoal frivoal added the css-contain-2 Current Work label Jun 30, 2020
@frivoal frivoal self-assigned this Jun 30, 2020
@chrishtr
Copy link
Contributor

I agree with these comments. Florian, would you be ok making the spec edit you just mentioned?

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed Interaction of content-visiblity and overflow-clip-margin, and agreed to the following:

  • RESOLVED: use overflow-clip edge instead of border-edge for determining whether box is onscreenTa
The full IRC log of that discussion <fantasai> Subtopic: Interaction of content-visiblity and overflow-clip-margin
<fantasai> github: https://github.com//issues/5271
<fantasai> florian: Content-visibility can hide stuff in some cases
<fantasai> florian: and there was a discussion about when box gets close enough to viewport, when do you take into account
<fantasai> florian: question is which box
<fantasai> florian: initially spec said "border box", but I think later it should have been "padding box"
<fantasai> florian: but since then we've added overflow-clip
<fantasai> florian: and this was aligning the area we care about for painting to both use overflow-clip-margin
<fantasai> florian: I believe this is fine and non-controversial
<fantasai> florian: proposed that element is considered on-screen if paint containment box [missed the rest]
<fantasai> florian: instead of overflow clip edge, previous version said border box
<fantasai> PROPOSED: use overflow-clip edge instead of border-edge for determiing whether box is onscreen
<flackr> +1
<fantasai> TabAtkins: Overflow clip edge is term of art linked to overflow-clip-margin
<fantasai> astearns: other questions?
<fantasai> astearns: objections?
<fantasai> fantasai: +1
<fantasai> RESOLVED: use overflow-clip edge instead of border-edge for determining whether box is onscreenTa

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

4 participants