-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
layout_2020: Only count for content size for height of non-replaced inline elements #29803
Conversation
@bors-servo try=wpt-2020 |
layout_2020: Invalidate bottom and top margins on non-replaced inline elements <!-- Please describe your changes on the following line: --> According to https://drafts.csswg.org/css2/#margin-properties, 'margin-top' and 'margin-bottom' have no effect on non-replaced inline elements. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes OR <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Test results for linux-wpt-layout-2020 from try job (#5104828618): Flaky unexpected result (2)
Stable unexpected results (4)
|
💔 Test failed - checks-github |
Although the block direction margins do not take effects, they still show up in firefox devtools. |
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 don't think this should special-case margins. https://drafts.csswg.org/css2/#inline-non-replaced says
The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the line-height. But only the line-height is used when calculating the height of the line box.
If I take /css/CSS2/margin-padding-clear/margin-inline-002.xht
replacing the margin with padding, then it's still wrong:
So can you try removing the vertical padding and borders too, and see if more tests pass or something breaks?
@bors-servo try=wpt-2020 |
layout_2020: Invalidate bottom and top margins on non-replaced inline elements <!-- Please describe your changes on the following line: --> According to https://drafts.csswg.org/css2/#margin-properties, 'margin-top' and 'margin-bottom' have no effect on non-replaced inline elements. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Either: --> - [x] There are tests for these changes OR <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
Test results for linux-wpt-layout-2020 from try job (#5127703186): Stable unexpected results (18)
|
💔 Test failed - checks-github |
More tests passed :) |
inline elements Accorinding to https://drafts.csswg.org/css2/#inline-non-replaced, The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the line-height. But only the line-height is used when calculating the height of the line box.
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.
This case is still wrong:
<!DOCTYPE html>
<style>
div {
border: blue solid 3px;
margin-top: 50px;
}
span {
background: orange;
padding-top: 20px;
padding-bottom: 20px;
height: 100px;
line-height: 100px;
}
</style>
<div><span>Filler Text</span></div>
But this patch is an improvement so I guess it's fine as-is.
that looks like is related to line height, let's deal with that later. |
@bors-servo r+ |
📌 Commit 78125ae has been approved by |
Test results for linux-wpt-layout-2020 from try job (#5161094063): Stable unexpected results that are known to be intermittent (1)
|
Test results for linux-wpt-layout-2013 from try job (#5161094063): Flaky unexpected result (12)
Stable unexpected results that are known to be intermittent (22)
|
☀️ Test successful - checks-github |
Accorinding to https://drafts.csswg.org/css2/#inline-non-replaced, The vertical padding, border and margin of an inline, non-replaced box start at the top and bottom of the content area, and has nothing to do with the line-height. But only the line-height is used when calculating the height of the line box.
./mach build -d
does not report any errors./mach test-tidy
does not report any errors