layout: Defend the block formatting context speculation against going wrong in

the presence of blocks that overflow in the inline direction.

Makes the Google search result links appear.

Closes #7298.
This commit is contained in:
Patrick Walton 2015-09-04 16:58:17 -07:00
parent 7df4ff7572
commit ded4a5793e
4 changed files with 33 additions and 4 deletions

View file

@ -1327,10 +1327,16 @@ impl BlockFlow {
let mut inline_size_of_preceding_left_floats = Au(0); let mut inline_size_of_preceding_left_floats = Au(0);
let mut inline_size_of_preceding_right_floats = Au(0); let mut inline_size_of_preceding_right_floats = Au(0);
if self.formatting_context_type() == FormattingContextType::None { if self.formatting_context_type() == FormattingContextType::None {
inline_size_of_preceding_left_floats = if inline_start_content_edge > Au(0) {
max(self.inline_size_of_preceding_left_floats - inline_start_content_edge, Au(0)); inline_size_of_preceding_left_floats =
inline_size_of_preceding_right_floats = max(self.inline_size_of_preceding_left_floats - inline_start_content_edge,
max(self.inline_size_of_preceding_right_floats - inline_end_content_edge, Au(0)); Au(0));
}
if inline_end_content_edge > Au(0) {
inline_size_of_preceding_right_floats =
max(self.inline_size_of_preceding_right_floats - inline_end_content_edge,
Au(0));
}
} }
let opaque_self = OpaqueFlow::from_flow(self); let opaque_self = OpaqueFlow::from_flow(self);

View file

@ -48,6 +48,7 @@ flaky_cpu == append_style_a.html append_style_b.html
== block_formatting_context_containing_floats_a.html block_formatting_context_containing_floats_ref.html == block_formatting_context_containing_floats_a.html block_formatting_context_containing_floats_ref.html
== block_formatting_context_float_placement_a.html block_formatting_context_float_placement_ref.html == block_formatting_context_float_placement_a.html block_formatting_context_float_placement_ref.html
== block_formatting_context_max_width_a.html block_formatting_context_max_width_ref.html == block_formatting_context_max_width_a.html block_formatting_context_max_width_ref.html
== block_formatting_context_overflow_a.html block_formatting_context_overflow_ref.html
== block_formatting_context_relative_a.html block_formatting_context_ref.html == block_formatting_context_relative_a.html block_formatting_context_ref.html
== block_formatting_context_translation_a.html block_formatting_context_translation_ref.html == block_formatting_context_translation_a.html block_formatting_context_translation_ref.html
== block_formatting_context_with_margin_a.html block_formatting_context_with_margin_ref.html == block_formatting_context_with_margin_a.html block_formatting_context_with_margin_ref.html

View file

@ -0,0 +1,19 @@
<!DOCTYPE html>
<style>
section {
display: block;
width: 0;
}
nav {
display: block;
}
aside {
display: block;
overflow: hidden;
}
main {
width: 500px;
}
</style>
<section><main><nav><aside>Hello</aside>world!</nav></main></section>

View file

@ -0,0 +1,3 @@
<!DOCTYPE html>
<div>Hello</div><div>world!</div>