mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Make fewer PositioningContexts when descending (#30061)
When descending and we have the option, don't create new PositioningContexts just to update the static position of laid out abspos descendants. Instead, use the new PositioningContextLength to only update the newly added hoisted abspos boxes.
This commit is contained in:
parent
4c8db6af87
commit
1296ddf273
4 changed files with 75 additions and 33 deletions
|
@ -11,7 +11,7 @@ use crate::formatting_contexts::{IndependentFormattingContext, IndependentLayout
|
|||
use crate::fragment_tree::{BoxFragment, CollapsedBlockMargins, Fragment};
|
||||
use crate::geom::flow_relative::{Rect, Sides, Vec2};
|
||||
use crate::geom::LengthOrAuto;
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext};
|
||||
use crate::positioned::{AbsolutelyPositionedBox, PositioningContext, PositioningContextLength};
|
||||
use crate::sizing::ContentSizes;
|
||||
use crate::style_ext::ComputedValuesExt;
|
||||
use crate::ContainingBlock;
|
||||
|
@ -194,8 +194,10 @@ impl FlexContainer {
|
|||
let (fragment, mut child_positioning_context) =
|
||||
flex_item_fragments.next().unwrap();
|
||||
let fragment = Fragment::Box(fragment);
|
||||
child_positioning_context
|
||||
.adjust_static_position_of_hoisted_fragments(&fragment);
|
||||
child_positioning_context.adjust_static_position_of_hoisted_fragments(
|
||||
&fragment,
|
||||
PositioningContextLength::zero(),
|
||||
);
|
||||
positioning_context.append(child_positioning_context);
|
||||
fragment
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue