mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Limit content_inline_size_for_table
override to collapsed columns (#35209)
A box is usually sized by the formatting context in which it participates. However, tables have some special sizing behaviors that we implemented with a `content_inline_size_for_table` override. However, breaking the assumptions of the formatting context isn't great. It was also bad for performance that we could try to layout a table among floats even though it wouldn't en up fitting because of a larger min-content size. Therefore, this changes the logic so that formatting contexts use some special sizing for tables, and then tables only override that amount when there are collapsed columns. Eventually, we should try to remove that case too, see https://github.com/w3c/csswg-drafts/issues/11408 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
88d01f6303
commit
e2bb772669
6 changed files with 146 additions and 143 deletions
|
@ -533,10 +533,12 @@ impl ReplacedContents {
|
|||
.into()
|
||||
};
|
||||
let (preferred_inline, min_inline, max_inline) = sizes.inline.resolve_each(
|
||||
Direction::Inline,
|
||||
automatic_size.inline,
|
||||
Au::zero(),
|
||||
inline_stretch_size,
|
||||
get_inline_content_size,
|
||||
false, /* is_table */
|
||||
);
|
||||
let inline_size = preferred_inline.clamp_between_extremums(min_inline, max_inline);
|
||||
|
||||
|
@ -560,10 +562,12 @@ impl ReplacedContents {
|
|||
.into()
|
||||
});
|
||||
let block_size = sizes.block.resolve(
|
||||
Direction::Block,
|
||||
automatic_size.block,
|
||||
Au::zero(),
|
||||
block_stretch_size.unwrap_or_else(|| block_content_size.max_content),
|
||||
|| *block_content_size,
|
||||
false, /* is_table */
|
||||
);
|
||||
|
||||
LogicalVec2 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue