mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Collect both start and end baselines for fragments (#31230)
This change starts collecting the starting baseline set for fragments, which is necessary for some layout modes (flex and tables, namely) as well as being important for the implementation of `align-items`. In addition, it converts baseline measurement to use `Au` everywhere. Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
28bde741ed
commit
7f13316f24
10 changed files with 112 additions and 101 deletions
|
@ -59,6 +59,14 @@ pub(crate) enum NonReplacedFormattingContextContents {
|
|||
// Other layout modes go here
|
||||
}
|
||||
|
||||
/// The baselines of a layout or a [`BoxFragment`]. Some layout uses the first and some layout uses
|
||||
/// the last.
|
||||
#[derive(Default, Serialize)]
|
||||
pub(crate) struct Baselines {
|
||||
pub first: Option<Au>,
|
||||
pub last: Option<Au>,
|
||||
}
|
||||
|
||||
pub(crate) struct IndependentLayout {
|
||||
pub fragments: Vec<Fragment>,
|
||||
|
||||
|
@ -68,7 +76,7 @@ pub(crate) struct IndependentLayout {
|
|||
/// The offset of the last inflow baseline of this layout in the content area, if
|
||||
/// there was one. This is used to propagate baselines to the ancestors of `display:
|
||||
/// inline-block`.
|
||||
pub last_inflow_baseline_offset: Option<Au>,
|
||||
pub baselines: Baselines,
|
||||
}
|
||||
|
||||
impl IndependentFormattingContext {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue