Skip to content
Permalink
Browse files

layout: Ensure abs-pos elements establish block formatting contexts

  • Loading branch information
paulrouget committed Nov 14, 2019
1 parent df9065a commit 0ea9f69ca87249386151946919807ccad6fd9f2c
@@ -1682,6 +1682,13 @@ impl BlockFlow {
/// Determines the type of formatting context this is. See the definition of
/// `FormattingContextType`.
pub fn formatting_context_type(&self) -> FormattingContextType {
if self
.base
.flags
.contains(FlowFlags::IS_ABSOLUTELY_POSITIONED)
{
return FormattingContextType::Other;
}
if self.is_inline_flex_item() || self.is_block_flex_item() {
return FormattingContextType::Other;
}
@@ -43,6 +43,18 @@
{}
]
],
"css/absolute_block_format_ctx.html": [
[
"css/absolute_block_format_ctx.html",
[
[
"/_mozilla/css/absolute_block_format_ctx_ref.html",
"=="
]
],
{}
]
],
"css/absolute_clipping_of_own_contents.html": [
[
"css/absolute_clipping_of_own_contents.html",
@@ -7692,6 +7704,9 @@
"css/abs_rel_explicit_height_ref.html": [
[]
],
"css/absolute_block_format_ctx_ref.html": [
[]
],
"css/absolute_clipping_of_own_contents_ref.html": [
[]
],
@@ -13461,6 +13476,14 @@
"4e9833c29529e58690f5f26e546e0d66a22ca369",
"support"
],
"css/absolute_block_format_ctx.html": [
"e7540c1cfe8eaab06e9c3b87214263d2c3abec34",
"reftest"
],
"css/absolute_block_format_ctx_ref.html": [
"42420061724718702f611abd2ff4c61774fc4b86",
"support"
],
"css/absolute_clipping_of_own_contents.html": [
"19919ff89c72d3425d188c49c27916a9eb885359",
"reftest"
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<link rel=match href=absolute_block_format_ctx_ref.html>
<style>
div {
display: inline;
position: absolute;
}
span {
float: left;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div>
<span style="background:red"></span>
<span style="background:blue"></span>
</div>
</body>
</html>


@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<style>
div {
float: left;
width: 50px;
height: 50px;
}
</style>
</head>
<body>
<div style="background:red"></div>
<div style="background:blue"></div>
</body>
</html>

0 comments on commit 0ea9f69

Please sign in to comment.
You can’t perform that action at this time.