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
[LayoutNG] Fix vertical-align: top
and bottom
#18956
Conversation
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.
Already reviewed downstream.
aa031d1
to
57dd7f3
Compare
This patch fixes `vertical-align: top` and `bottom` when they are applied to a box that has children with `text-top` or `text-bottom`. In LayoutNG, `vertical-align` is handled in 3 different timings. 1. `top` and `bottom` are added to the pending list of the line box, or to the nearest ancestor box that has `top` or `bottom`. 2. `text-bop` and `text-bottom` are added to the pending list of the parent box. 3. Other values are computed when the box is closed. When a box has both 1 and 2, this patch changes to compute 1 (`top` and `bottom`) after 2. Before this patch, both 1 and 2 are computed at the same time for each box. 3 test cases out of 20 in this test fails without this patch. Bug: 1001664 Change-Id: I0e7746447f5e401837c2c28e308171f0987eba35 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792396 Reviewed-by: Emil A Eklund <eae@chromium.org> Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org> Commit-Queue: Koji Ishii <kojii@chromium.org> Cr-Commit-Position: refs/heads/master@{#695194}
57dd7f3
to
697c4b8
Compare
I came here to check on the Taskcluster failure, which is because of the test being flaky in Chrome Dev. But it looks like something has also gone quite wrong here, the PR doesn't match https://chromium.googlesource.com/chromium/src/+/cf88186a260efa4875553eb99f79bbbff8d3130a. I'll comment on the difference. @Hexcles can you take a look at how this happened? |
Oh, wait, @LukeZielinski pushed a commit that accounts for the difference. Just need to make sure the fix works then. |
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.
Changes make sense, and https://wpt.fyi/results/css/CSS2/linebox/vertical-align-top-bottom-001.html?label=pr_head&max-count=1&pr=18956 results look good.
This patch fixes
vertical-align: top
andbottom
whenthey are applied to a box that has children with
text-top
or
text-bottom
.In LayoutNG,
vertical-align
is handled in 3 differenttimings.
top
andbottom
are added to the pending list of theline box, or to the nearest ancestor box that has
top
orbottom
.text-bop
andtext-bottom
are added to the pending listof the parent box.
When a box has both 1 and 2, this patch changes to compute 1
(
top
andbottom
) after 2. Before this patch, both 1 and 2are computed at the same time for each box. 3 test cases out
of 20 in this test fails without this patch.
Bug: 1001664
Change-Id: I0e7746447f5e401837c2c28e308171f0987eba35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1792396
Reviewed-by: Emil A Eklund <eae@chromium.org>
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Koji Ishii <kojii@chromium.org>
Cr-Commit-Position: refs/heads/master@{#695194}