aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout_2020/formatting_contexts.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2024-01-19 14:20:20 +0100
committerGitHub <noreply@github.com>2024-01-19 13:20:20 +0000
commitfc31e69f79a68408fdd376a52942587a8fca9170 (patch)
tree5c294519595326791e0464b84eb987f5f1597e14 /components/layout_2020/formatting_contexts.rs
parent3d520f266800e0035c429ddf2a3b45922f502ebd (diff)
downloadservo-fc31e69f79a68408fdd376a52942587a8fca9170.tar.gz
servo-fc31e69f79a68408fdd376a52942587a8fca9170.zip
layout: Add *very* basic support for table layout (#31121)
* layout: Add *very* basic support for table layout This is the first step to proper table layout. It implements a naive layout algorithm, notably only taking into account the preferred widths of the first table row. Still, it causes some float tests to start passing, so turn on the `layout.tables.enabled` preference for those directories. Co-authored-by: Oriol Brufau <obrufau@igalia.com> * Address review comments * Fix a crash with rowspan=0 * Turn on pref and update results for `/css/css-tables` and `/css/CSS2/tables` --------- Co-authored-by: Oriol Brufau <obrufau@igalia.com>
Diffstat (limited to 'components/layout_2020/formatting_contexts.rs')
-rw-r--r--components/layout_2020/formatting_contexts.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/components/layout_2020/formatting_contexts.rs b/components/layout_2020/formatting_contexts.rs
index 8c441c98ea7..2ebbf372b37 100644
--- a/components/layout_2020/formatting_contexts.rs
+++ b/components/layout_2020/formatting_contexts.rs
@@ -155,7 +155,7 @@ impl IndependentFormattingContext {
}
}
- pub fn inline_content_sizes(&self, layout_context: &LayoutContext) -> ContentSizes {
+ pub fn inline_content_sizes(&mut self, layout_context: &LayoutContext) -> ContentSizes {
match self {
Self::NonReplaced(inner) => inner
.contents
@@ -173,7 +173,7 @@ impl IndependentFormattingContext {
Self::NonReplaced(non_replaced) => {
let style = &non_replaced.style;
let content_sizes = &mut non_replaced.content_sizes;
- let contents = &non_replaced.contents;
+ let contents = &mut non_replaced.contents;
sizing::outer_inline(&style, containing_block_writing_mode, || {
content_sizes
.get_or_insert_with(|| {
@@ -213,7 +213,7 @@ impl NonReplacedFormattingContext {
pub fn inline_content_sizes(&mut self, layout_context: &LayoutContext) -> ContentSizes {
let writing_mode = self.style.writing_mode;
- let contents = &self.contents;
+ let contents = &mut self.contents;
self.content_sizes
.get_or_insert_with(|| contents.inline_content_sizes(layout_context, writing_mode))
.clone()
@@ -222,7 +222,7 @@ impl NonReplacedFormattingContext {
impl NonReplacedFormattingContextContents {
pub fn inline_content_sizes(
- &self,
+ &mut self,
layout_context: &LayoutContext,
writing_mode: WritingMode,
) -> ContentSizes {
@@ -231,7 +231,7 @@ impl NonReplacedFormattingContextContents {
.contents
.inline_content_sizes(layout_context, writing_mode),
Self::Flex(inner) => inner.inline_content_sizes(),
- Self::Table(table) => table.inline_content_sizes(),
+ Self::Table(table) => table.inline_content_sizes(layout_context, writing_mode),
}
}
}