mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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:
parent
b945de4ea9
commit
bd06227a60
8 changed files with 59 additions and 24 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue