mirror of
https://github.com/servo/servo.git
synced 2025-08-01 19:50:30 +01:00
Fix percentage height calculation, absolute containing block height calculations.
It's not possible to correctly determine during the css cascade whether the container height is explicitly specified. Additionally, the spec https://drafts.csswg.org/css2/visudet.html#the-height-property says this should affect the *used* height, rather than the computed height. This significantly improves the layout in #6643.
This commit is contained in:
parent
ffe4bd25a4
commit
b9fea3deb3
10 changed files with 151 additions and 119 deletions
|
@ -390,15 +390,15 @@ impl RawLayoutElementHelpers for Element {
|
|||
match height {
|
||||
LengthOrPercentageOrAuto::Auto => {}
|
||||
LengthOrPercentageOrAuto::Percentage(percentage) => {
|
||||
let width_value = specified::LengthOrPercentageOrAuto::Percentage(percentage);
|
||||
hints.push(from_declaration(PropertyDeclaration::Height(SpecifiedValue(
|
||||
height::SpecifiedValue(width_value)))));
|
||||
let height_value = specified::LengthOrPercentageOrAuto::Percentage(percentage);
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::Height(SpecifiedValue(height_value))));
|
||||
}
|
||||
LengthOrPercentageOrAuto::Length(length) => {
|
||||
let width_value = specified::LengthOrPercentageOrAuto::Length(
|
||||
let height_value = specified::LengthOrPercentageOrAuto::Length(
|
||||
specified::Length::Absolute(length));
|
||||
hints.push(from_declaration(PropertyDeclaration::Height(SpecifiedValue(
|
||||
height::SpecifiedValue(width_value)))));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::Height(SpecifiedValue(height_value))));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -443,8 +443,7 @@ impl RawLayoutElementHelpers for Element {
|
|||
let value = specified::Length::FontRelative(specified::FontRelativeLength::Em(rows as CSSFloat));
|
||||
hints.push(from_declaration(
|
||||
PropertyDeclaration::Height(SpecifiedValue(
|
||||
longhands::height::SpecifiedValue(
|
||||
specified::LengthOrPercentageOrAuto::Length(value))))));
|
||||
specified::LengthOrPercentageOrAuto::Length(value)))));
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue