mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Avoid crash in PlacementAmongFloats (#30235)
PlacementAmongFloats was assuming that there would always be a FloatBand at a position smaller than or equal to the given ceiling, but this was not the case for negative ceilings. The reason is that the FloatContext initialized the FloatBandTree with a band at 0, and another at +∞. This patch changes the initial bands to −∞ and +∞. This seems more consistent and matches the expectation of PlacementAmongFloats.
This commit is contained in:
parent
70f0088986
commit
9aa3f74878
5 changed files with 109 additions and 1 deletions
|
@ -307,7 +307,7 @@ impl FloatContext {
|
|||
pub fn new(max_inline_size: Length) -> Self {
|
||||
let mut bands = FloatBandTree::new();
|
||||
bands = bands.insert(FloatBand {
|
||||
top: Length::zero(),
|
||||
top: Length::new(-f32::INFINITY),
|
||||
left: None,
|
||||
right: None,
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue