mirror of
https://github.com/servo/servo.git
synced 2025-06-08 16:43:28 +00:00
layout: Ensure abs-pos elements establish block formatting contexts
This commit is contained in:
parent
df9065afb6
commit
0ea9f69ca8
4 changed files with 71 additions and 0 deletions
|
@ -1682,6 +1682,13 @@ impl BlockFlow {
|
||||||
/// Determines the type of formatting context this is. See the definition of
|
/// Determines the type of formatting context this is. See the definition of
|
||||||
/// `FormattingContextType`.
|
/// `FormattingContextType`.
|
||||||
pub fn formatting_context_type(&self) -> 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() {
|
if self.is_inline_flex_item() || self.is_block_flex_item() {
|
||||||
return FormattingContextType::Other;
|
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": [
|
||||||
[
|
[
|
||||||
"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/abs_rel_explicit_height_ref.html": [
|
||||||
[]
|
[]
|
||||||
],
|
],
|
||||||
|
"css/absolute_block_format_ctx_ref.html": [
|
||||||
|
[]
|
||||||
|
],
|
||||||
"css/absolute_clipping_of_own_contents_ref.html": [
|
"css/absolute_clipping_of_own_contents_ref.html": [
|
||||||
[]
|
[]
|
||||||
],
|
],
|
||||||
|
@ -13461,6 +13476,14 @@
|
||||||
"4e9833c29529e58690f5f26e546e0d66a22ca369",
|
"4e9833c29529e58690f5f26e546e0d66a22ca369",
|
||||||
"support"
|
"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": [
|
"css/absolute_clipping_of_own_contents.html": [
|
||||||
"19919ff89c72d3425d188c49c27916a9eb885359",
|
"19919ff89c72d3425d188c49c27916a9eb885359",
|
||||||
"reftest"
|
"reftest"
|
||||||
|
|
25
tests/wpt/mozilla/tests/css/absolute_block_format_ctx.html
Normal file
25
tests/wpt/mozilla/tests/css/absolute_block_format_ctx.html
Normal file
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue