diff --git a/components/layout_2020/display_list/mod.rs b/components/layout_2020/display_list/mod.rs index 0d705590b3a..b566184b008 100644 --- a/components/layout_2020/display_list/mod.rs +++ b/components/layout_2020/display_list/mod.rs @@ -904,7 +904,7 @@ impl<'a> BuilderForBoxFragment<'a> { fn build_collapsed_table_borders(&mut self, builder: &mut DisplayListBuilder) { let Some(SpecificLayoutInfo::TableGridWithCollapsedBorders(table_info)) = - &self.fragment.detailed_layout_info + &self.fragment.specific_layout_info else { return; }; diff --git a/components/layout_2020/display_list/stacking_context.rs b/components/layout_2020/display_list/stacking_context.rs index 2af83a1ae95..ff8f0674f7c 100644 --- a/components/layout_2020/display_list/stacking_context.rs +++ b/components/layout_2020/display_list/stacking_context.rs @@ -1212,7 +1212,7 @@ impl BoxFragment { if let Fragment::Box(box_fragment) = &fragment { if matches!( - box_fragment.borrow().detailed_layout_info, + box_fragment.borrow().specific_layout_info, Some(SpecificLayoutInfo::TableGridWithCollapsedBorders(_)) ) { add_fragment(StackingContextSection::CollapsedTableBorders); diff --git a/components/layout_2020/flexbox/layout.rs b/components/layout_2020/flexbox/layout.rs index 228370ecfac..a4c7ce42733 100644 --- a/components/layout_2020/flexbox/layout.rs +++ b/components/layout_2020/flexbox/layout.rs @@ -979,7 +979,7 @@ impl FlexContainer { content_inline_size_for_table: None, baselines, depends_on_block_constraints, - detailed_layout_info: None, + specific_layout_info: None, } } diff --git a/components/layout_2020/flow/mod.rs b/components/layout_2020/flow/mod.rs index d4762700853..1f7aeccaaaa 100644 --- a/components/layout_2020/flow/mod.rs +++ b/components/layout_2020/flow/mod.rs @@ -389,7 +389,7 @@ impl BlockFormattingContext { content_inline_size_for_table: None, baselines: flow_layout.baselines, depends_on_block_constraints: flow_layout.depends_on_block_constraints, - detailed_layout_info: None, + specific_layout_info: None, } } @@ -1157,7 +1157,7 @@ impl IndependentNonReplacedContents { block_margins_collapsed_with_children, ) .with_baselines(layout.baselines) - .with_detailed_layout_info(layout.detailed_layout_info) + .with_specific_layout_info(layout.specific_layout_info) } /// Lay out a normal in flow non-replaced block that establishes an independent @@ -1469,7 +1469,7 @@ impl IndependentNonReplacedContents { CollapsedBlockMargins::from_margin(&margin), ) .with_baselines(layout.baselines) - .with_detailed_layout_info(layout.detailed_layout_info) + .with_specific_layout_info(layout.specific_layout_info) } } diff --git a/components/layout_2020/formatting_contexts.rs b/components/layout_2020/formatting_contexts.rs index 7467e7578d7..9386337689d 100644 --- a/components/layout_2020/formatting_contexts.rs +++ b/components/layout_2020/formatting_contexts.rs @@ -87,7 +87,7 @@ pub(crate) struct IndependentLayout { pub depends_on_block_constraints: bool, /// Additional information of this layout that could be used by Javascripts and devtools. - pub detailed_layout_info: Option, + pub specific_layout_info: Option, } pub(crate) struct IndependentLayoutResult { diff --git a/components/layout_2020/fragment_tree/box_fragment.rs b/components/layout_2020/fragment_tree/box_fragment.rs index 2aacb1c517b..13ca0f270ae 100644 --- a/components/layout_2020/fragment_tree/box_fragment.rs +++ b/components/layout_2020/fragment_tree/box_fragment.rs @@ -89,7 +89,7 @@ pub(crate) struct BoxFragment { pub background_mode: BackgroundMode, /// Additional information of from layout that could be used by Javascripts and devtools. - pub detailed_layout_info: Option, + pub specific_layout_info: Option, } impl BoxFragment { @@ -124,7 +124,7 @@ impl BoxFragment { scrollable_overflow_from_children, resolved_sticky_insets: AtomicRefCell::default(), background_mode: BackgroundMode::Normal, - detailed_layout_info: None, + specific_layout_info: None, } } @@ -177,8 +177,8 @@ impl BoxFragment { self.background_mode = BackgroundMode::None; } - pub fn with_detailed_layout_info(mut self, info: Option) -> Self { - self.detailed_layout_info = info; + pub fn with_specific_layout_info(mut self, info: Option) -> Self { + self.specific_layout_info = info; self } @@ -354,13 +354,13 @@ impl BoxFragment { /// pub(crate) fn is_table_wrapper(&self) -> bool { matches!( - self.detailed_layout_info, + self.specific_layout_info, Some(SpecificLayoutInfo::TableWrapper) ) } pub(crate) fn has_collapsed_borders(&self) -> bool { - match &self.detailed_layout_info { + match &self.specific_layout_info { Some(SpecificLayoutInfo::TableCellWithCollapsedBorders) => true, Some(SpecificLayoutInfo::TableGridWithCollapsedBorders(_)) => true, Some(SpecificLayoutInfo::TableWrapper) => { diff --git a/components/layout_2020/positioned.rs b/components/layout_2020/positioned.rs index 0aea0f76460..9d77c396cfc 100644 --- a/components/layout_2020/positioned.rs +++ b/components/layout_2020/positioned.rs @@ -579,7 +579,7 @@ impl HoistedAbsolutelyPositionedBox { let mut new_fragment = { let content_size: LogicalVec2; let fragments; - let mut detailed_layout_info: Option = None; + let mut specific_layout_info: Option = None; match &context.contents { IndependentFormattingContextContents::Replaced(replaced) => { // https://drafts.csswg.org/css2/visudet.html#abs-replaced-width @@ -648,7 +648,7 @@ impl HoistedAbsolutelyPositionedBox { block: block_size, }; fragments = independent_layout.fragments; - detailed_layout_info = independent_layout.detailed_layout_info; + specific_layout_info = independent_layout.specific_layout_info; }, }; @@ -696,7 +696,7 @@ impl HoistedAbsolutelyPositionedBox { // elements are not inflow. CollapsedBlockMargins::zero(), ) - .with_detailed_layout_info(detailed_layout_info) + .with_specific_layout_info(specific_layout_info) }; positioning_context.layout_collected_children(layout_context, &mut new_fragment); diff --git a/components/layout_2020/query.rs b/components/layout_2020/query.rs index a75f7fd81c2..a8cade847c5 100644 --- a/components/layout_2020/query.rs +++ b/components/layout_2020/query.rs @@ -190,7 +190,7 @@ pub fn process_resolved_style_request<'dom>( return None; } - let (content_rect, margins, padding, detailed_layout_info) = match fragment { + let (content_rect, margins, padding, specific_layout_info) = match fragment { Fragment::Box(ref box_fragment) | Fragment::Float(ref box_fragment) => { let box_fragment = box_fragment.borrow(); if style.get_box().position != Position::Static { @@ -214,8 +214,8 @@ pub fn process_resolved_style_request<'dom>( let content_rect = box_fragment.content_rect; let margins = box_fragment.margin; let padding = box_fragment.padding; - let detailed_layout_info = box_fragment.detailed_layout_info.clone(); - (content_rect, margins, padding, detailed_layout_info) + let specific_layout_info = box_fragment.specific_layout_info.clone(); + (content_rect, margins, padding, specific_layout_info) }, Fragment::Positioning(positioning_fragment) => { let content_rect = positioning_fragment.borrow().rect; @@ -235,7 +235,7 @@ pub fn process_resolved_style_request<'dom>( // // > When an element generates a grid container box... if display.inside() == DisplayInside::Grid { - if let Some(SpecificLayoutInfo::Grid(info)) = detailed_layout_info { + if let Some(SpecificLayoutInfo::Grid(info)) = specific_layout_info { if let Some(value) = resolve_grid_template(&info, style, longhand_id) { return Some(value); } diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs index 86028d22bcd..d8539953f95 100644 --- a/components/layout_2020/table/layout.rs +++ b/components/layout_2020/table/layout.rs @@ -1566,7 +1566,7 @@ impl<'a> TableLayout<'a> { content_inline_size_for_table: None, baselines: Baselines::default(), depends_on_block_constraints, - detailed_layout_info: Some(SpecificLayoutInfo::TableWrapper), + specific_layout_info: Some(SpecificLayoutInfo::TableWrapper), }; table_layout @@ -1759,7 +1759,7 @@ impl<'a> TableLayout<'a> { None, /* clearance */ CollapsedBlockMargins::zero(), ) - .with_detailed_layout_info(self.specific_layout_info_for_grid()); + .with_specific_layout_info(self.specific_layout_info_for_grid()); } let mut table_fragments = Vec::new(); @@ -1886,7 +1886,7 @@ impl<'a> TableLayout<'a> { CollapsedBlockMargins::zero(), ) .with_baselines(baselines) - .with_detailed_layout_info(self.specific_layout_info_for_grid()) + .with_specific_layout_info(self.specific_layout_info_for_grid()) } fn specific_layout_info_for_grid(&mut self) -> Option { @@ -2818,7 +2818,7 @@ impl TableSlotCell { ); positioning_context.append(layout.positioning_context); - let detailed_layout_info = (table_style.get_inherited_table().border_collapse == + let specific_layout_info = (table_style.get_inherited_table().border_collapse == BorderCollapse::Collapse) .then_some(SpecificLayoutInfo::TableCellWithCollapsedBorders); @@ -2834,7 +2834,7 @@ impl TableSlotCell { CollapsedBlockMargins::zero(), ) .with_baselines(layout.layout.baselines) - .with_detailed_layout_info(detailed_layout_info) + .with_specific_layout_info(specific_layout_info) } } diff --git a/components/layout_2020/taffy/layout.rs b/components/layout_2020/taffy/layout.rs index 2f58697eac3..e5e27ffbf59 100644 --- a/components/layout_2020/taffy/layout.rs +++ b/components/layout_2020/taffy/layout.rs @@ -65,10 +65,10 @@ struct TaffyContainerContext<'a> { positioning_context: &'a mut PositioningContext, content_box_size_override: &'a ContainingBlock<'a>, style: &'a ComputedValues, - detailed_layout_info: Option, + specific_layout_info: Option, /// Temporary location for children detailed info, which will be moved into child fragments - child_detailed_layout_infos: Vec>, + child_specific_layout_infos: Vec>, } struct ChildIter(std::ops::Range); @@ -268,8 +268,8 @@ impl taffy::LayoutPartialTree for TaffyContainerContext<'_> { }; child.child_fragments = layout.fragments; - self.child_detailed_layout_infos[usize::from(node_id)] = - layout.detailed_layout_info; + self.child_specific_layout_infos[usize::from(node_id)] = + layout.specific_layout_info; let block_size = layout.content_block_size.to_f32_px(); @@ -324,10 +324,10 @@ impl taffy::LayoutGridContainer for TaffyContainerContext<'_> { fn set_detailed_grid_info( &mut self, _node_id: taffy::NodeId, - detailed_layout_info: taffy::DetailedGridInfo, + specific_layout_info: taffy::DetailedGridInfo, ) { - self.detailed_layout_info = Some(SpecificLayoutInfo::Grid(Box::new( - SpecificTaffyGridInfo::from_detailed_grid_layout(detailed_layout_info), + self.specific_layout_info = Some(SpecificLayoutInfo::Grid(Box::new( + SpecificTaffyGridInfo::from_detailed_grid_layout(specific_layout_info), ))); } } @@ -371,8 +371,8 @@ impl ComputeInlineContentSizes for TaffyContainer { content_box_size_override: containing_block, style, source_child_nodes: &self.children, - detailed_layout_info: None, - child_detailed_layout_infos: vec![None; self.children.len()], + specific_layout_info: None, + child_specific_layout_infos: vec![None; self.children.len()], }; let (max_content_output, min_content_output) = match style.clone_display().inside() { @@ -427,8 +427,8 @@ impl TaffyContainer { content_box_size_override, style: content_box_size_override.style, source_child_nodes: &self.children, - detailed_layout_info: None, - child_detailed_layout_infos: vec![None; self.children.len()], + specific_layout_info: None, + child_specific_layout_infos: vec![None; self.children.len()], }; let container_style = &content_box_size_override.style; @@ -473,7 +473,7 @@ impl TaffyContainer { }; // Convert `taffy::Layout` into Servo `Fragment`s - // with container_ctx.child_detailed_layout_infos will also moved to the corresponding `Fragment`s + // with container_ctx.child_specific_layout_infos will also moved to the corresponding `Fragment`s let fragments: Vec = self .children .iter() @@ -541,8 +541,8 @@ impl TaffyContainer { .map(Au::from_f32_px), ); - let child_detailed_layout_info: Option = - std::mem::take(&mut container_ctx.child_detailed_layout_infos[child_id]); + let child_specific_layout_info: Option = + std::mem::take(&mut container_ctx.child_specific_layout_infos[child_id]); match &mut child.taffy_level_box { TaffyItemBoxInner::InFlowBox(independent_box) => { @@ -562,7 +562,7 @@ impl TaffyContainer { first: output.first_baselines.y.map(Au::from_f32_px), last: None, }) - .with_detailed_layout_info(child_detailed_layout_info), + .with_specific_layout_info(child_specific_layout_info), )); child @@ -628,7 +628,7 @@ impl TaffyContainer { // on the assumption that the node's size does not depend on block constraints. depends_on_block_constraints: true, - detailed_layout_info: container_ctx.detailed_layout_info, + specific_layout_info: container_ctx.specific_layout_info, } }