aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout
diff options
context:
space:
mode:
Diffstat (limited to 'components/layout')
-rw-r--r--components/layout/block.rs2
-rw-r--r--components/layout/flex.rs4
-rw-r--r--components/layout/flow.rs5
-rw-r--r--components/layout/inline.rs2
-rw-r--r--components/layout/list_item.rs4
-rw-r--r--components/layout/multicol.rs8
-rw-r--r--components/layout/table.rs4
-rw-r--r--components/layout/table_caption.rs4
-rw-r--r--components/layout/table_cell.rs4
-rw-r--r--components/layout/table_row.rs4
-rw-r--r--components/layout/table_rowgroup.rs4
-rw-r--r--components/layout/table_wrapper.rs4
-rw-r--r--components/layout/traversal.rs6
13 files changed, 28 insertions, 27 deletions
diff --git a/components/layout/block.rs b/components/layout/block.rs
index f42b749e7a3..9bd413a2725 100644
--- a/components/layout/block.rs
+++ b/components/layout/block.rs
@@ -1944,7 +1944,7 @@ impl Flow for BlockFlow {
}
}
- fn compute_absolute_position(&mut self, _layout_context: &LayoutContext) {
+ fn compute_stacking_relative_position(&mut self, _layout_context: &LayoutContext) {
// FIXME (mbrubeck): Get the real container size, taking the container writing mode into
// account. Must handle vertical writing modes.
let container_size = Size2D::new(self.base.block_container_inline_size, Au(0));
diff --git a/components/layout/flex.rs b/components/layout/flex.rs
index 577e9a167de..b1aa4e3dfe4 100644
--- a/components/layout/flex.rs
+++ b/components/layout/flex.rs
@@ -949,8 +949,8 @@ impl Flow for FlexFlow {
}
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn place_float_if_applicable<'a>(&mut self) {
diff --git a/components/layout/flow.rs b/components/layout/flow.rs
index a97ec1cb9ad..c6fc65407e5 100644
--- a/components/layout/flow.rs
+++ b/components/layout/flow.rs
@@ -339,8 +339,9 @@ pub trait Flow: fmt::Debug + Sync + Send + 'static {
mut_base(self).overflow = overflow
}
- /// Phase 4 of reflow: computes absolute positions.
- fn compute_absolute_position(&mut self, _: &LayoutContext) {
+ /// Phase 4 of reflow: Compute the stacking-relative position (origin of the content box,
+ /// in coordinates relative to the nearest ancestor stacking context).
+ fn compute_stacking_relative_position(&mut self, _: &LayoutContext) {
// The default implementation is a no-op.
mut_base(self).restyle_damage.remove(REPOSITION)
}
diff --git a/components/layout/inline.rs b/components/layout/inline.rs
index d5813d9bea2..d6c561de22a 100644
--- a/components/layout/inline.rs
+++ b/components/layout/inline.rs
@@ -1534,7 +1534,7 @@ impl Flow for InlineFlow {
}
}
- fn compute_absolute_position(&mut self, _: &LayoutContext) {
+ fn compute_stacking_relative_position(&mut self, _: &LayoutContext) {
// First, gather up the positions of all the containing blocks (if any).
//
// FIXME(pcwalton): This will get the absolute containing blocks inside `...` wrong in the
diff --git a/components/layout/list_item.rs b/components/layout/list_item.rs
index 007c7ab0eda..8f3f017f513 100644
--- a/components/layout/list_item.rs
+++ b/components/layout/list_item.rs
@@ -119,8 +119,8 @@ impl Flow for ListItemFlow {
}
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn place_float_if_applicable<'a>(&mut self) {
diff --git a/components/layout/multicol.rs b/components/layout/multicol.rs
index 8a1b3bee6ee..6ebe48d78d0 100644
--- a/components/layout/multicol.rs
+++ b/components/layout/multicol.rs
@@ -166,8 +166,8 @@ impl Flow for MulticolFlow {
}
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context);
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context);
let pitch = LogicalSize::new(self.block_flow.base.writing_mode, self.column_pitch, Au(0));
let pitch = pitch.to_physical(self.block_flow.base.writing_mode);
for (i, child) in self.block_flow.base.children.iter_mut().enumerate() {
@@ -254,8 +254,8 @@ impl Flow for MulticolColumnFlow {
Flow::fragment(&mut self.block_flow, layout_context, fragmentation_context)
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
diff --git a/components/layout/table.rs b/components/layout/table.rs
index dea2b590b27..db221518cf7 100644
--- a/components/layout/table.rs
+++ b/components/layout/table.rs
@@ -473,8 +473,8 @@ impl Flow for TableFlow {
self.block_flow.assign_block_size_for_table_like_flow(vertical_spacing)
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn generated_containing_block_size(&self, flow: OpaqueFlow) -> LogicalSize<Au> {
diff --git a/components/layout/table_caption.rs b/components/layout/table_caption.rs
index c421b4a8e91..6fc188ce71a 100644
--- a/components/layout/table_caption.rs
+++ b/components/layout/table_caption.rs
@@ -62,8 +62,8 @@ impl Flow for TableCaptionFlow {
self.block_flow.assign_block_size(layout_context);
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
diff --git a/components/layout/table_cell.rs b/components/layout/table_cell.rs
index 7ef02e28db6..ec1cfe5c9af 100644
--- a/components/layout/table_cell.rs
+++ b/components/layout/table_cell.rs
@@ -230,8 +230,8 @@ impl Flow for TableCellFlow {
self.assign_block_size_table_cell_base(layout_context);
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
diff --git a/components/layout/table_row.rs b/components/layout/table_row.rs
index 06040446ddc..3c2eaf25d62 100644
--- a/components/layout/table_row.rs
+++ b/components/layout/table_row.rs
@@ -452,8 +452,8 @@ impl Flow for TableRowFlow {
self.assign_block_size_table_row_base(layout_context);
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
diff --git a/components/layout/table_rowgroup.rs b/components/layout/table_rowgroup.rs
index 02c1b49da2b..2ca1862004a 100644
--- a/components/layout/table_rowgroup.rs
+++ b/components/layout/table_rowgroup.rs
@@ -165,8 +165,8 @@ impl Flow for TableRowGroupFlow {
self.block_flow.assign_block_size_for_table_like_flow(self.spacing.vertical.0)
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn update_late_computed_inline_position_if_necessary(&mut self, inline_position: Au) {
diff --git a/components/layout/table_wrapper.rs b/components/layout/table_wrapper.rs
index eec409c8e99..6d08df8d3fa 100644
--- a/components/layout/table_wrapper.rs
+++ b/components/layout/table_wrapper.rs
@@ -428,8 +428,8 @@ impl Flow for TableWrapperFlow {
debug_assert!(remaining.is_none());
}
- fn compute_absolute_position(&mut self, layout_context: &LayoutContext) {
- self.block_flow.compute_absolute_position(layout_context)
+ fn compute_stacking_relative_position(&mut self, layout_context: &LayoutContext) {
+ self.block_flow.compute_stacking_relative_position(layout_context)
}
fn place_float_if_applicable<'a>(&mut self) {
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index 7ca56d22f9a..d31be602ee8 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -201,14 +201,14 @@ impl<'a> PostorderFlowTraversal for AssignBSizes<'a> {
}
#[derive(Copy, Clone)]
-pub struct ComputeAbsolutePositions<'a> {
+pub struct ComputeStackingRelativePositions<'a> {
pub layout_context: &'a LayoutContext<'a>,
}
-impl<'a> PreorderFlowTraversal for ComputeAbsolutePositions<'a> {
+impl<'a> PreorderFlowTraversal for ComputeStackingRelativePositions<'a> {
#[inline]
fn process(&self, flow: &mut Flow) {
- flow.compute_absolute_position(self.layout_context);
+ flow.compute_stacking_relative_position(self.layout_context);
}
}