aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/table
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-10-24 10:44:30 -0700
committerGitHub <noreply@github.com>2024-10-24 17:44:30 +0000
commit52db185568ca4dc49d28211f70b29aedecffaaf0 (patch)
tree4be1e80182425b3fa51e7d440a40dc6f59ca152d /components/layout_2020/table
parent638b520186f30d66fefa5a687799093dec071306 (diff)
downloadservo-52db185568ca4dc49d28211f70b29aedecffaaf0.tar.gz
servo-52db185568ca4dc49d28211f70b29aedecffaaf0.zip
layout: Avoid layout sometimes when stretching (#33967)
This is the second flexbox caching change. It seeks to detect when a relayout can be avoided in the case of a stretching flex item. This heuristic can be combined, because currently we still do relayout sometimes when we do not need to. For instance currently we always relayout when a flex child is itself a column flex. This only needs to happen when the grandchildren themselves grow or shrink. That optimization is perhaps a lower priority as `flex-grow: 0 / flex-shrink: 1` is the default behavior for flex. Since this change means we more consistenly zero out the percentage part of `calc` expressions when they have circular dependencies, this causes one test to start failing (`/css/css-values/calc-min-height-block-1.html`). This is related to w3c/csswg-drafts#10969, which is pending on further discussion in the working group. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/table')
-rw-r--r--components/layout_2020/table/layout.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/components/layout_2020/table/layout.rs b/components/layout_2020/table/layout.rs
index c0c0a92c051..359f6fe5132 100644
--- a/components/layout_2020/table/layout.rs
+++ b/components/layout_2020/table/layout.rs
@@ -1683,11 +1683,18 @@ impl<'a> TableLayout<'a> {
let offset_from_wrapper = -table_pbm.padding - table_pbm.border;
let mut current_block_offset = offset_from_wrapper.block_start;
+ let depends_on_block_constraints = self
+ .table
+ .style
+ .content_box_sizes_and_padding_border_margin(&containing_block_for_table.into())
+ .depends_on_block_constraints;
+
let mut table_layout = IndependentLayout {
fragments: Vec::new(),
content_block_size: Zero::zero(),
content_inline_size_for_table: None,
baselines: Baselines::default(),
+ depends_on_block_constraints,
};
table_layout