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

Fixes #12802
This commit is contained in:
Michael Howell 2016-08-25 23:54:12 -07:00
parent d5913035ec
commit ede4730913
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",
@ -9375,6 +9387,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>