mirror of
https://github.com/servo/servo.git
synced 2025-08-10 07:55:33 +01:00
Simplify the computation of CAPMIN (#33577)
CAPMIN is the largest min-content contribution of the table captions. In Servo, the standard way to compute min/max-content contributions is `outer_inline_content_sizes()`, so just use that instead of reinventing the wheel. This also fixes cyclic percentages to resolve consistently with normal block boxes. Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
d110d8710a
commit
5d269a9036
4 changed files with 116 additions and 45 deletions
|
@ -201,14 +201,11 @@ impl IndependentFormattingContext {
|
|||
auto_block_size_stretches_to_containing_block: bool,
|
||||
) -> ContentSizes {
|
||||
match self {
|
||||
Self::NonReplaced(non_replaced) => sizing::outer_inline(
|
||||
&non_replaced.style.clone(),
|
||||
Self::NonReplaced(non_replaced) => non_replaced.outer_inline_content_sizes(
|
||||
layout_context,
|
||||
containing_block,
|
||||
auto_minimum,
|
||||
auto_block_size_stretches_to_containing_block,
|
||||
|containing_block_for_children| {
|
||||
non_replaced.inline_content_sizes(layout_context, containing_block_for_children)
|
||||
},
|
||||
),
|
||||
Self::Replaced(replaced) => sizing::outer_inline(
|
||||
&replaced.style,
|
||||
|
@ -291,6 +288,24 @@ impl NonReplacedFormattingContext {
|
|||
))
|
||||
.1
|
||||
}
|
||||
|
||||
pub(crate) fn outer_inline_content_sizes(
|
||||
&mut self,
|
||||
layout_context: &LayoutContext,
|
||||
containing_block: &IndefiniteContainingBlock,
|
||||
auto_minimum: &LogicalVec2<Au>,
|
||||
auto_block_size_stretches_to_containing_block: bool,
|
||||
) -> ContentSizes {
|
||||
sizing::outer_inline(
|
||||
&self.style.clone(),
|
||||
containing_block,
|
||||
auto_minimum,
|
||||
auto_block_size_stretches_to_containing_block,
|
||||
|containing_block_for_children| {
|
||||
self.inline_content_sizes(layout_context, containing_block_for_children)
|
||||
},
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl NonReplacedFormattingContextContents {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue