aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/flow
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout/flow')
-rw-r--r--components/layout/flow/float.rs3
-rw-r--r--components/layout/flow/inline/line.rs3
-rw-r--r--components/layout/flow/inline/mod.rs3
-rw-r--r--components/layout/flow/mod.rs9
-rw-r--r--components/layout/flow/root.rs3
5 files changed, 7 insertions, 14 deletions
diff --git a/components/layout/flow/float.rs b/components/layout/flow/float.rs
index 0570ce0d0f4..dbc50c07603 100644
--- a/components/layout/flow/float.rs
+++ b/components/layout/flow/float.rs
@@ -913,11 +913,10 @@ impl FloatBox {
positioning_context: &mut PositioningContext,
containing_block: &ContainingBlock,
) -> BoxFragment {
- let style = self.contents.style().clone();
positioning_context.layout_maybe_position_relative_fragment(
layout_context,
containing_block,
- &style,
+ &self.contents.base,
|positioning_context| {
self.contents
.layout_float_or_atomic_inline(
diff --git a/components/layout/flow/inline/line.rs b/components/layout/flow/inline/line.rs
index c42f32c9242..80bab1080ed 100644
--- a/components/layout/flow/inline/line.rs
+++ b/components/layout/flow/inline/line.rs
@@ -326,13 +326,12 @@ impl LineItemLayout<'_, '_> {
let inline_box = self.layout.ifc.inline_boxes.get(identifier);
let inline_box = &*(inline_box.borrow());
- let style = &inline_box.base.style;
let space_above_baseline = inline_box_state.calculate_space_above_baseline();
let block_start_offset =
self.calculate_inline_box_block_start(inline_box_state, space_above_baseline);
let positioning_context_or_start_offset_in_parent =
- match PositioningContext::new_for_style(style) {
+ match PositioningContext::new_for_layout_box_base(&inline_box.base) {
Some(positioning_context) => Either::Left(positioning_context),
None => Either::Right(self.current_positioning_context_mut().len()),
};
diff --git a/components/layout/flow/inline/mod.rs b/components/layout/flow/inline/mod.rs
index dabb9773410..2023f4e7174 100644
--- a/components/layout/flow/inline/mod.rs
+++ b/components/layout/flow/inline/mod.rs
@@ -2004,8 +2004,7 @@ impl IndependentFormattingContext {
bidi_level: Level,
) {
// We need to know the inline size of the atomic before deciding whether to do the line break.
- let mut child_positioning_context = PositioningContext::new_for_style(self.style())
- .unwrap_or_else(|| PositioningContext::new_for_subtree(true));
+ let mut child_positioning_context = PositioningContext::default();
let IndependentFloatOrAtomicLayoutResult {
mut fragment,
baselines,
diff --git a/components/layout/flow/mod.rs b/components/layout/flow/mod.rs
index d983e8592c4..772b150ae1c 100644
--- a/components/layout/flow/mod.rs
+++ b/components/layout/flow/mod.rs
@@ -689,16 +689,13 @@ fn layout_block_level_children_in_parallel(
placement_state: &mut PlacementState,
ignore_block_margins_for_stretch: LogicalSides1D<bool>,
) -> Vec<Fragment> {
- let collects_for_nearest_positioned_ancestor =
- positioning_context.collects_for_nearest_positioned_ancestor();
let mut layout_results: Vec<(Fragment, PositioningContext)> =
Vec::with_capacity(child_boxes.len());
child_boxes
.par_iter()
.map(|child_box| {
- let mut child_positioning_context =
- PositioningContext::new_for_subtree(collects_for_nearest_positioned_ancestor);
+ let mut child_positioning_context = PositioningContext::default();
let fragment = child_box.borrow().layout(
layout_context,
&mut child_positioning_context,
@@ -779,7 +776,7 @@ impl BlockLevelBox {
ArcRefCell::new(positioning_context.layout_maybe_position_relative_fragment(
layout_context,
containing_block,
- &base.style,
+ base,
|positioning_context| {
layout_in_flow_non_replaced_block_level_same_formatting_context(
layout_context,
@@ -798,7 +795,7 @@ impl BlockLevelBox {
positioning_context.layout_maybe_position_relative_fragment(
layout_context,
containing_block,
- independent.style(),
+ &independent.base,
|positioning_context| {
independent.layout_in_flow_block_level(
layout_context,
diff --git a/components/layout/flow/root.rs b/components/layout/flow/root.rs
index c6498eeed63..bb9ff1d337a 100644
--- a/components/layout/flow/root.rs
+++ b/components/layout/flow/root.rs
@@ -385,8 +385,7 @@ impl BoxTree {
style,
};
- let mut positioning_context =
- PositioningContext::new_for_containing_block_for_all_descendants();
+ let mut positioning_context = PositioningContext::default();
let independent_layout = self.root.layout(
layout_context,
&mut positioning_context,