mirror of
https://github.com/servo/servo.git
synced 2025-08-12 00:45:33 +01:00
Handle BFC roots with auto width next to floats (#30057)
Co-authored-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
parent
e6c9ca207c
commit
ab0f48f8e8
13 changed files with 179 additions and 36 deletions
|
@ -364,6 +364,17 @@ impl PositioningContext {
|
|||
.len(),
|
||||
}
|
||||
}
|
||||
|
||||
/// Truncate this [PositioningContext] to the given [PositioningContextLength]. This
|
||||
/// is useful for "unhoisting" boxes in this context and returning it to the state at
|
||||
/// the time that [`len()`] was called.
|
||||
pub(crate) fn truncate(&mut self, length: &PositioningContextLength) {
|
||||
if let Some(vec) = self.for_nearest_positioned_ancestor.as_mut() {
|
||||
vec.truncate(length.for_nearest_positioned_ancestor);
|
||||
}
|
||||
self.for_nearest_containing_block_for_all_descendants
|
||||
.truncate(length.for_nearest_containing_block_for_all_descendants);
|
||||
}
|
||||
}
|
||||
|
||||
/// A data structure which stores the size of a positioning context.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue