Auto merge of #13051 - notriddle:root_flow_percent, r=glennw

Fix root flow's size at the browser window's size

When `<body>` needs to calculate its size based on `<html>`'s size, that should be the size of the browser window itself.

---

- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #12802 (github issue number if applicable).
- [X] There are tests for these changes OR

<!-- 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/13051)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-08-28 19:16:19 -05:00 committed by GitHub
commit 07b770b829
4 changed files with 44 additions and 2 deletions

View file

@ -1336,10 +1336,10 @@ impl BlockFlow {
};
let parent_container_size = self.explicit_block_containing_size(shared_context);
// https://drafts.csswg.org/css-ui-3/#box-sizing
let explicit_content_size = self
let mut explicit_content_size = self
.explicit_block_size(parent_container_size)
.map(|x| if x < box_border { Au(0) } else { x - box_border });
if self.is_root() { explicit_content_size = max(parent_container_size, explicit_content_size); }
// Calculate containing block inline size.
let containing_block_size = if flags.contains(IS_ABSOLUTELY_POSITIONED) {
self.containing_block_size(&shared_context.viewport_size, opaque_self).inline

View file

@ -71,6 +71,18 @@
"url": "/_mozilla/css/absolute_content_height.html"
}
],
"css/absolute_css_width.html": [
{
"path": "css/absolute_css_width.html",
"references": [
[
"/_mozilla/css/absolute_css_width_ref.html",
"=="
]
],
"url": "/_mozilla/css/absolute_css_width.html"
}
],
"css/absolute_hypothetical_float.html": [
{
"path": "css/absolute_hypothetical_float.html",
@ -9387,6 +9399,18 @@
"url": "/_mozilla/css/absolute_content_height.html"
}
],
"css/absolute_css_width.html": [
{
"path": "css/absolute_css_width.html",
"references": [
[
"/_mozilla/css/absolute_css_width_ref.html",
"=="
]
],
"url": "/_mozilla/css/absolute_css_width.html"
}
],
"css/absolute_hypothetical_float.html": [
{
"path": "css/absolute_hypothetical_float.html",

View file

@ -0,0 +1,13 @@
<!doctype html>
<meta charset="utf-8">
<title>HTML expands to fit 100% body</title>
<link rel="match" href="absolute_css_width_ref.html">
<style>
body {
width: 100%;
height: 100%;
overflow: hidden;
}
</style>
<div style="position:absolute">X</div>

View file

@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<title>HTML expands to fit 100% body</title>
<div>X</div>