layout_2020: Add support for hoisting positioned fragments in inline boxes

Add support for tracking containing blocks when doing inline layout.
This requires setting up a PositioningContext for inline boxes when
necessary. Instead of using the PositioningContext helper methods
and we reuse the contexts between line breaks.

Fixes #25279.
This commit is contained in:
Martin Robinson 2020-03-18 13:14:51 +01:00
parent b945de4ea9
commit bd06227a60
8 changed files with 59 additions and 24 deletions

View file

@ -172,7 +172,7 @@ impl PositioningContext {
self.for_nearest_positioned_ancestor.is_some()
}
fn new_for_style(style: &ComputedValues) -> Option<Self> {
pub(crate) fn new_for_style(style: &ComputedValues) -> Option<Self> {
if style.establishes_containing_block_for_all_descendants() {
Some(Self::new_for_containing_block_for_all_descendants())
} else if style.establishes_containing_block() {
@ -243,7 +243,7 @@ impl PositioningContext {
// Lay out the hoisted boxes collected into this `PositioningContext` and add them
// to the given `BoxFragment`.
fn layout_collected_children(
pub fn layout_collected_children(
&mut self,
layout_context: &LayoutContext,
new_fragment: &mut BoxFragment,