diff options
author | Oriol Brufau <obrufau@igalia.com> | 2024-11-20 17:24:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-20 16:24:00 +0000 |
commit | 138ec6d0ec5575009aa7d0c3aae3c80ceea476b7 (patch) | |
tree | 5d30070e6756995f699987fd43699c6602ece1aa | |
parent | 4451a59f883c22f38aa66c2b3e656b10362b49f9 (diff) | |
download | servo-138ec6d0ec5575009aa7d0c3aae3c80ceea476b7.tar.gz servo-138ec6d0ec5575009aa7d0c3aae3c80ceea476b7.zip |
Remove the containing_block parameter from TableLayout::layout_caption (#34297)
It was only used for the style, but the containing block of the caption
is the table wrapper box, whose style is stored in `self.table.style`.
Signed-off-by: Oriol Brufau <obrufau@igalia.com>
-rw-r--r-- | components/layout_2020/table/layout.rs | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs index 49c65c9707d..e3c9ca79233 100644 --- a/components/layout_2020/table/layout.rs +++ b/components/layout_2020/table/layout.rs @@ -1609,7 +1609,6 @@ impl<'a> TableLayout<'a> { caption: &TableCaption, table_pbm: &PaddingBorderMargin, layout_context: &LayoutContext, - containing_block: &ContainingBlock, parent_positioning_context: &mut PositioningContext, ) -> BoxFragment { let context = caption.context.borrow(); @@ -1617,7 +1616,7 @@ impl<'a> TableLayout<'a> { let containing_block = &ContainingBlock { inline_size: self.table_width + table_pbm.padding_border_sums.inline, block_size: AuOrAuto::Auto, - style: containing_block.style, + style: &self.table.style, }; let mut box_fragment = context.layout_in_flow_block_level( @@ -1716,13 +1715,8 @@ impl<'a> TableLayout<'a> { } let original_positioning_context_length = positioning_context.len(); - let mut caption_fragment = self.layout_caption( - caption, - &table_pbm, - layout_context, - containing_block_for_children, - positioning_context, - ); + let mut caption_fragment = + self.layout_caption(caption, &table_pbm, layout_context, positioning_context); // The caption is not placed yet. Construct a rectangle for it in the adjusted containing block // for the table children and only then convert the result to physical geometry. @@ -1821,13 +1815,8 @@ impl<'a> TableLayout<'a> { } let original_positioning_context_length = positioning_context.len(); - let mut caption_fragment = self.layout_caption( - caption, - &table_pbm, - layout_context, - containing_block_for_children, - positioning_context, - ); + let mut caption_fragment = + self.layout_caption(caption, &table_pbm, layout_context, positioning_context); // The caption is not placed yet. Construct a rectangle for it in the adjusted containing block // for the table children and only then convert the result to physical geometry. |