Skip to content

Commit 4add25e

Browse files
committed
find_content_slot fast path in case of no active floats
1 parent 0834734 commit 4add25e

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/compute/float.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,17 @@ impl FloatContext {
183183
clear: Clear,
184184
after: Option<usize>,
185185
) -> ContentSlot {
186-
self.placer.find_content_slot(min_y, containing_block_insets, clear, after)
186+
if !self.has_active_floats(min_y) {
187+
ContentSlot {
188+
segment_id: None,
189+
x: containing_block_insets[0],
190+
y: min_y,
191+
width: self.placer.bfc_width - containing_block_insets[0] - containing_block_insets[1],
192+
height: f32::INFINITY,
193+
}
194+
} else {
195+
self.placer.find_content_slot(min_y, containing_block_insets, clear, after)
196+
}
187197
}
188198

189199
// pub(crate) fn content_width(&self) -> f32 {

0 commit comments

Comments
 (0)