Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix explicit height edge case with absolute / relative nested divs. #7147

Merged
merged 1 commit into from Aug 11, 2015
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Fix explicit height edge case with absolute / relative nested divs.

Needed for #6643.
  • Loading branch information
gw3583 committed Aug 11, 2015
commit e83091d918d55818d41edc4ba93e1ca9f0622bce
@@ -1104,7 +1104,8 @@ impl BlockFlow {
let screen_size = LogicalSize::from_physical(self.fragment.style.writing_mode,
layout_context.shared.screen_size);
Some(screen_size.block)
} else if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
} else if self.base.flags.contains(IS_ABSOLUTELY_POSITIONED) &&
self.base.block_container_explicit_block_size.is_none() {
self.base.absolute_cb.explicit_block_containing_size(layout_context)
} else {
self.base.block_container_explicit_block_size
@@ -1329,12 +1330,7 @@ impl BlockFlow {

let mut iterator = self.base.child_iter().enumerate().peekable();
while let Some((i, kid)) = iterator.next() {
{
let kid_base = flow::mut_base(kid);
if !kid_base.flags.contains(IS_ABSOLUTELY_POSITIONED) {
kid_base.block_container_explicit_block_size = explicit_content_size;
}
}
flow::mut_base(kid).block_container_explicit_block_size = explicit_content_size;

// Determine float impaction, and update the inline size speculations if necessary.
if flow::base(kid).flags.contains(CLEARS_LEFT) {
@@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
* {
margin: 0;
}
html, body {
position: relative;
height: 100%;
}
#div0 {
position: absolute;
height: 100%;
width: 100%;
}
#div1 {
position: relative;
height: 100px;
}
#div2 {
position: absolute;
width: 100%;
height: 100%;
}
#div3 {
position: relative;
width: 100%;
height: 100%;
}
#div4 {
position: absolute;
width: 100%;
height: 100%;
background-color: green;
}
</style>
</head>
<body>
<div id="div0">
<div id="div1">
<div id="div2">
<div id="div3">
<div id="div4">
</div>
</div>
</div>
</div>
</div>
</body>
</html>
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
* {
margin: 0;
}
#div0 {
position: absolute;
height: 100px;
width: 100%;
background-color: green;
}
</style>
</head>
<body>
<div id="div0">
</div>
</body>
</html>
@@ -9,6 +9,7 @@
# Should be == with expected failure:
fragment=top != ../html/acid2.html acid2_ref.html

== abs_rel_explicit_height.html abs_rel_explicit_height_ref.html
== absolute_inline_containing_block_a.html absolute_inline_containing_block_ref.html
== acid1_a.html acid1_b.html
== acid2_noscroll.html acid2_ref_broken.html
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.