mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
layout: Improve layout of table captions (#32695)
- Instead of treating captions as a `BlockFormattingContext`, treat it as a `NonReplacedFormattingContext`, which allows reusing flow layout for captions -- fixing some issues with sizing. - Pass in the proper size of the containing block when laying out, fixing margin calculation. - Follow the unspecified rules about how various size properties on captions affect their size. - Improve linebreaking around atomics, which is tested by caption-related tests. This fixes intrinsic size calculation regarding soft wrap opportunities around atomic and also makes the code making these actual soft wrap opportunities a bit better. Signed-off-by: Martin Robinson <mrobinson@igalia.com> Co-authored-by: Mukilan Thiyagarajan <mukilan@igalia.com>
This commit is contained in:
parent
2888193cfe
commit
89944bd330
52 changed files with 225 additions and 454 deletions
|
@ -103,7 +103,7 @@ impl InlineFormattingContextBuilder {
|
|||
InlineItem::TextRun(_) => true,
|
||||
InlineItem::OutOfFlowAbsolutelyPositionedBox(_) => false,
|
||||
InlineItem::OutOfFlowFloatBox(_) => false,
|
||||
InlineItem::Atomic(_) => false,
|
||||
InlineItem::Atomic(..) => false,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -116,7 +116,10 @@ impl InlineFormattingContextBuilder {
|
|||
&mut self,
|
||||
independent_formatting_context: IndependentFormattingContext,
|
||||
) -> ArcRefCell<InlineItem> {
|
||||
let inline_level_box = ArcRefCell::new(InlineItem::Atomic(independent_formatting_context));
|
||||
let inline_level_box = ArcRefCell::new(InlineItem::Atomic(
|
||||
independent_formatting_context,
|
||||
self.current_text_offset,
|
||||
));
|
||||
self.inline_items.push(inline_level_box.clone());
|
||||
|
||||
// Push an object replacement character for this atomic, which will ensure that the line breaker
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue