mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Auto merge of #16428 - stshine:box-sizing, r=emilio
layout: Floor to 0 when computing intrinsic sizes with box-sizing:border-box <!-- Please describe your changes on the following line: --> Improves bitbucket. --- <!-- 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 - [ ] These changes fix #__ (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/16428) <!-- Reviewable:end -->
This commit is contained in:
commit
349ddb555a
4 changed files with 62 additions and 1 deletions
|
@ -937,7 +937,7 @@ impl Fragment {
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.style.get_position().box_sizing == box_sizing::T::border_box {
|
if self.style.get_position().box_sizing == box_sizing::T::border_box {
|
||||||
specified -= border_padding
|
specified = max(Au(0), specified - border_padding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3131,6 +3131,18 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"css/intrinsic_border_box.html": [
|
||||||
|
[
|
||||||
|
"/_mozilla/css/intrinsic_border_box.html",
|
||||||
|
[
|
||||||
|
[
|
||||||
|
"/_mozilla/css/intrinsic_border_box_ref.html",
|
||||||
|
"=="
|
||||||
|
]
|
||||||
|
],
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"css/issue-1324.html": [
|
"css/issue-1324.html": [
|
||||||
[
|
[
|
||||||
"/_mozilla/css/issue-1324.html",
|
"/_mozilla/css/issue-1324.html",
|
||||||
|
@ -8085,6 +8097,11 @@
|
||||||
{}
|
{}
|
||||||
]
|
]
|
||||||
],
|
],
|
||||||
|
"css/intrinsic_border_box_ref.html": [
|
||||||
|
[
|
||||||
|
{}
|
||||||
|
]
|
||||||
|
],
|
||||||
"css/issue-1324-ref.html": [
|
"css/issue-1324-ref.html": [
|
||||||
[
|
[
|
||||||
{}
|
{}
|
||||||
|
@ -22132,6 +22149,14 @@
|
||||||
"c78c6c992e47adb47ba00b621210ae8564d46389",
|
"c78c6c992e47adb47ba00b621210ae8564d46389",
|
||||||
"support"
|
"support"
|
||||||
],
|
],
|
||||||
|
"css/intrinsic_border_box.html": [
|
||||||
|
"261487f82f350ab020f49f362993b26711a89b5b",
|
||||||
|
"reftest"
|
||||||
|
],
|
||||||
|
"css/intrinsic_border_box_ref.html": [
|
||||||
|
"9a8f19331c748658b71c85b823b5b3db68e4b7a4",
|
||||||
|
"support"
|
||||||
|
],
|
||||||
"css/issue-1324-ref.html": [
|
"css/issue-1324-ref.html": [
|
||||||
"ef2253d5045622f54634dbfa6b6abdef6b6e00a7",
|
"ef2253d5045622f54634dbfa6b6abdef6b6e00a7",
|
||||||
"support"
|
"support"
|
||||||
|
|
19
tests/wpt/mozilla/tests/css/intrinsic_border_box.html
Normal file
19
tests/wpt/mozilla/tests/css/intrinsic_border_box.html
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title></title>
|
||||||
|
<link rel="match" href="intrinsic_border_box_ref.html">
|
||||||
|
<style>
|
||||||
|
.outer {
|
||||||
|
float: left;
|
||||||
|
box-sizing: border-box;
|
||||||
|
padding: 0 50px;
|
||||||
|
}
|
||||||
|
.inner {
|
||||||
|
float: left;
|
||||||
|
width: 100px;
|
||||||
|
height: 30px;
|
||||||
|
background: orange;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="outer"><div class="inner"></div></div>
|
||||||
|
<div class="outer"><div class="inner"></div></div>
|
17
tests/wpt/mozilla/tests/css/intrinsic_border_box_ref.html
Normal file
17
tests/wpt/mozilla/tests/css/intrinsic_border_box_ref.html
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
<!doctype html>
|
||||||
|
<meta charset="utf-8">
|
||||||
|
<title></title>
|
||||||
|
<style>
|
||||||
|
.outer {
|
||||||
|
float: left;
|
||||||
|
padding: 0 50px;
|
||||||
|
}
|
||||||
|
.inner {
|
||||||
|
float: left;
|
||||||
|
width: 100px;
|
||||||
|
height: 30px;
|
||||||
|
background: orange;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="outer"><div class="inner"></div></div>
|
||||||
|
<div class="outer"><div class="inner"></div></div>
|
Loading…
Add table
Add a link
Reference in a new issue