diff options
author | Martin Robinson <mrobinson@igalia.com> | 2023-08-03 10:51:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-03 08:51:27 +0000 |
commit | 1296ddf2736e55e813f26aeebfdd231e761dfb3e (patch) | |
tree | 2e21ece4fdfa27f4fe1f9503113ba9b18d278051 /components/layout_2020/flexbox | |
parent | 4c8db6af8730ff0213fc08b79a2dbc78b310394b (diff) | |
download | servo-1296ddf2736e55e813f26aeebfdd231e761dfb3e.tar.gz servo-1296ddf2736e55e813f26aeebfdd231e761dfb3e.zip |
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.
Diffstat (limited to 'components/layout_2020/flexbox')
-rw-r--r-- | components/layout_2020/flexbox/layout.rs | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index 19619375b99..f4cc3e2cf4c 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -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 }, |