mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +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
|
@ -79,7 +79,9 @@ use style::properties::ComputedValues;
|
|||
use style_traits::dom::OpaqueNode;
|
||||
|
||||
use super::flow::BlockFormattingContext;
|
||||
use crate::cell::ArcRefCell;
|
||||
use crate::flow::BlockContainer;
|
||||
use crate::formatting_contexts::NonReplacedFormattingContext;
|
||||
use crate::fragment_tree::BaseFragmentInfo;
|
||||
|
||||
pub type TableSize = Size2D<usize, UnknownUnit>;
|
||||
|
@ -316,12 +318,5 @@ impl TableTrackGroup {
|
|||
#[derive(Debug, Serialize)]
|
||||
pub struct TableCaption {
|
||||
/// The contents of this cell, with its own layout.
|
||||
contents: BlockFormattingContext,
|
||||
|
||||
/// The style of this table cell.
|
||||
#[serde(skip_serializing)]
|
||||
style: Arc<ComputedValues>,
|
||||
|
||||
/// The [`BaseFragmentInfo`] of this cell.
|
||||
base_fragment_info: BaseFragmentInfo,
|
||||
context: ArcRefCell<NonReplacedFormattingContext>,
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue