mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
layout: Correctly take the inline size of cleared floats into account
when estimating the inline size of block formatting contexts. The speculated inline-size of the preceding floats was forced to zero at the wrong time if the float was itself cleared, causing it to overwrite the speculated value. Shuffling the code around a bit fixes the problem.
This commit is contained in:
parent
3c5c2f416b
commit
e10af4fc98
4 changed files with 67 additions and 10 deletions
|
@ -1313,6 +1313,17 @@ impl BlockFlow {
|
|||
kid_base.fixed_static_i_offset = fixed_static_i_offset;
|
||||
}
|
||||
|
||||
// Determine float impaction, and update the inline size speculations if necessary.
|
||||
if flow::base(kid).flags.contains(CLEARS_LEFT) {
|
||||
inline_start_floats_impact_child = false;
|
||||
inline_size_of_preceding_left_floats = Au(0);
|
||||
}
|
||||
if flow::base(kid).flags.contains(CLEARS_RIGHT) {
|
||||
inline_end_floats_impact_child = false;
|
||||
inline_size_of_preceding_right_floats = Au(0);
|
||||
}
|
||||
|
||||
// Update the speculated inline size if this child is floated.
|
||||
match flow::base(kid).flags.float_kind() {
|
||||
float::T::none => {}
|
||||
float::T::left => {
|
||||
|
@ -1353,16 +1364,6 @@ impl BlockFlow {
|
|||
}
|
||||
}
|
||||
|
||||
// Determine float impaction.
|
||||
if flow::base(kid).flags.contains(CLEARS_LEFT) {
|
||||
inline_start_floats_impact_child = false;
|
||||
inline_size_of_preceding_left_floats = Au(0);
|
||||
}
|
||||
if flow::base(kid).flags.contains(CLEARS_RIGHT) {
|
||||
inline_end_floats_impact_child = false;
|
||||
inline_size_of_preceding_right_floats = Au(0);
|
||||
}
|
||||
|
||||
{
|
||||
let kid_base = flow::mut_base(kid);
|
||||
inline_start_floats_impact_child = inline_start_floats_impact_child ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue