mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Implementation of baseline-source (#31904)
Updating Stylo and test expectations.
This commit is contained in:
parent
da3991c8f3
commit
2a517f786b
10 changed files with 25 additions and 244 deletions
|
@ -85,6 +85,7 @@ use style::properties::ComputedValues;
|
|||
use style::values::computed::Length;
|
||||
use style::values::generics::box_::VerticalAlignKeyword;
|
||||
use style::values::generics::font::LineHeight;
|
||||
use style::values::specified::box_::BaselineSource;
|
||||
use style::values::specified::text::{TextAlignKeyword, TextDecorationLine};
|
||||
use style::values::specified::{TextAlignLast, TextJustify};
|
||||
use style::Zero;
|
||||
|
@ -2143,13 +2144,18 @@ impl IndependentFormattingContext {
|
|||
/// Picks either the first or the last baseline, depending on `baseline-source`.
|
||||
/// <https://drafts.csswg.org/css-inline/#baseline-source>
|
||||
fn pick_baseline(&self, baselines: &Baselines) -> Option<Au> {
|
||||
// TODO: Currently this only supports the initial `baseline-source: auto`.
|
||||
if let Self::NonReplaced(non_replaced) = self {
|
||||
if let NonReplacedFormattingContextContents::Flow(_) = non_replaced.contents {
|
||||
return baselines.last;
|
||||
}
|
||||
match self.style().clone_baseline_source() {
|
||||
BaselineSource::First => baselines.first,
|
||||
BaselineSource::Last => baselines.last,
|
||||
BaselineSource::Auto => {
|
||||
if let Self::NonReplaced(non_replaced) = self {
|
||||
if let NonReplacedFormattingContextContents::Flow(_) = non_replaced.contents {
|
||||
return baselines.last;
|
||||
}
|
||||
}
|
||||
baselines.first
|
||||
},
|
||||
}
|
||||
baselines.first
|
||||
}
|
||||
|
||||
fn get_block_sizes_and_baseline_offset(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue