-
-
Notifications
You must be signed in to change notification settings - Fork 980
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
LibWeb: Compute scrollable overflow via containing block instead of children #1268
LibWeb: Compute scrollable overflow via containing block instead of children #1268
Conversation
015f664
to
dcb88f0
Compare
b7d0c87
to
44d434b
Compare
This PR causes a whole bunch of tests to break. Looking at them, it's not clear to me that the tests are correct, though. Most (all?) of the tests that break essentially look like this:
That is, the overflow is removed. I'm reasonably sure there should be no overflow though. In this test for instance, TBODY and TR and not containing blocks, so they can't have any overflow (is that right?). Also, Chrome doesn't compute any overflow for TBODY nor TR. You can verify this by adding: tbody, tr {
overflow: scroll;
} and seeing that Chrome does not display any scrollbars (whereas ladybird does). I looked at a few more of the table tests and they follow this pattern and can be verified by setting |
you are right, in this specific example you provided, removed overflow is improvement. so you would have to simply update a test expectation in that case. though I bet there might be some valid regressions, particularly when CSS transform is involved. the last time I attempted to make similar change, I discovered that if we don't also resolve this FIXME, it will cause some regression in the ref-tests. |
Most (all?) of the table tests are failing because |
db1bd62
to
df34562
Compare
df34562
to
81596b4
Compare
2f1ba7b
to
5dbd93f
Compare
34441d0
to
b2a7f40
Compare
@kalenikaliaksandr I don't see any failures in the ref-tests. That means we don't have to address that FIXME for this issue..? |
what FIXME do you mean exactly? btw please rebase your branch. |
I was responding to this part of your comment:
|
yes, if this change does not break any tests then it's fine to leave the FIXME. |
I'm not quite sure what you mean by rebase my branch. Rebase it off of..? I don't see anything that looks off. |
I mean rebase onto master branch to include latest changes from there by doing |
Instead of using child boxes to compute scrollable overflow for the box, we use descendants which have the box as their containing block.
b2a7f40
to
4df45b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested change locally and it seems good. likely it's going to result in overflow measuring being heavy in profiles because we will do full subtree traversal for each child, but that could be fixed.
ok done 👍 (btw I'm curious what you saw on the PR that led you to ask me to rebase off master) |
I seen InlinePaintable in text expectations which is gone by now, so I was a bit confused. apparently it does not introduce any conflicts so that's fine. |
What are you thinking for a fix? The most obvious one that jumps out to me is to have a box point to all the boxes for which it's the containing block (so it doesn't have to traverse the whole subtree every time to find them). |
yeah, I think it's either having a linked list of all contained abspos boxes for each paintable. Or, better idea: diverging paintable tree from layout tree by and making contained abspos boxes to be direct children of containing block. |
That sounds like a cool idea. The other case where the containing block comes into play that I came across (in addition to abspos boxes) is tables. All table sub-elements have the TableWrapper as its containing block (so a TD won't cause overflow on a TR for example). Do you imagine it working the same way for tables? That is, the TableWrapper would have TBODY, TR, TD etc. as its children in the paintable tree? |
Instead of using child boxes to compute scrollable overflow for the box, we use descendants which have the box as their containing block.
Fixes #718
Rebaselined Tests