Fix containing block size for absolute root element

Fixes #16248.
This commit is contained in:
Matt Brubeck 2017-05-15 14:19:19 -07:00
parent f87e362059
commit e34cf4fba0
4 changed files with 56 additions and 1 deletions

View file

@ -657,7 +657,7 @@ impl BlockFlow {
pub fn containing_block_size(&self, viewport_size: &Size2D<Au>, descendant: OpaqueFlow)
-> LogicalSize<Au> {
debug_assert!(self.base.flags.contains(IS_ABSOLUTELY_POSITIONED));
if self.is_fixed() {
if self.is_fixed() || self.is_root() {
// Initial containing block is the CB for the root
LogicalSize::from_physical(self.base.writing_mode, *viewport_size)
} else {

View file

@ -3731,6 +3731,18 @@
{}
]
],
"css/min_width_percent_root_a.html": [
[
"/_mozilla/css/min_width_percent_root_a.html",
[
[
"/_mozilla/css/min_width_percent_root_b.html",
"=="
]
],
{}
]
],
"css/min_width_simple_a.html": [
[
"/_mozilla/css/min_width_simple_a.html",
@ -8359,6 +8371,11 @@
{}
]
],
"css/min_width_percent_root_b.html": [
[
{}
]
],
"css/min_width_simple_b.html": [
[
{}
@ -22622,6 +22639,14 @@
"e8ee634ab6350ad4c870cb1d0ce4f1a88b285581",
"support"
],
"css/min_width_percent_root_a.html": [
"e8c23bc78daed932d5b513b972582e21711ea06a",
"reftest"
],
"css/min_width_percent_root_b.html": [
"4c5b54f6b4e1bb77a15fdf7d99f9be3a47df7e8b",
"support"
],
"css/min_width_simple_a.html": [
"e709d1ab4096401ecb7b848d9297c00ef7786bf9",
"reftest"

View file

@ -0,0 +1,16 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<link rel="match" href="min_width_percent_root_b.html">
<title>absolute root element with percentage min-width</title>
<style>
html {
position: absolute;
min-width: 100%;
border: 2px solid red;
}
</style>
</head>
<body></body>
</html>

View file

@ -0,0 +1,14 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>absolute root element with percentage min-width reference</title>
<style>
html {
min-width: 100%;
border: 2px solid red;
}
</style>
</head>
<body></body>
</html>