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

Specify expected behavior for overflows and containment #60

Open
wangxianzhu opened this issue Jul 24, 2020 · 4 comments
Open

Specify expected behavior for overflows and containment #60

wangxianzhu opened this issue Jul 24, 2020 · 4 comments

Comments

@wangxianzhu
Copy link

The current spec seems to imply that overflowing contents should report their own shifts, but this requires that the browser to traverse the subtree whose root is shifted.

We could define how we should detect and report shifts for ancestors and descendants. For example, can we define that we don't need to report descendants' shifts if they don't shift in the ancestor? If yes, can we define that the ancestor should also report its overflow in its shift, to avoid tree walk into the subtree if possible?

This is particular important when we deal with css contain. We don't want to traverse the subtree of css contain in particular cases.

@skobes-chromium
Copy link
Collaborator

Generally speaking, if a descendant is visible, it will be fully enclosed by its ancestor. Therefore, if ancestor and descendant shift together, there is no additional contribution to the impact region from the descendant.

Did you mean something different? Perhaps you could share a test case?

@wangxianzhu
Copy link
Author

I found I misunderstood the "box" concept. The "principle box" is defined as to contain its descendant boxes and generated content. Then the spec is precise about ancestors and descendants.

@wangxianzhu
Copy link
Author

Note that currently Chromium doesn't conform to the spec about visible overflows from descendants.

@wangxianzhu wangxianzhu reopened this Oct 7, 2020
@wangxianzhu
Copy link
Author

wangxianzhu commented Oct 7, 2020

I'm reopening this issue because there is still things to be clarified.

<div style="width: 1000px; height: 10px">
  <div stye="width: 10px; height: 1000px"></div>
</div>

When the parent moves, currently Chrome reports 1000x1000 area is moved, but the real covered area is 1000x10 + 10x990. For implementation, the former is more performance and complexity friendly.

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

2 participants