mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Replace Au with CSSPixelLength in CalcLengthOrPercentage.
We replace Au with CSSPixelLength for the length part of computed::CalcLengthOrPercentage. Therefore, it would be easier to use CSSPixelLength for all other LengthOrPercentage{*} types.
This commit is contained in:
parent
a949e2a057
commit
535c1e3c6f
13 changed files with 99 additions and 117 deletions
|
@ -84,7 +84,7 @@ impl ToComputedValue for LineHeight {
|
|||
|
||||
#[inline]
|
||||
fn to_computed_value(&self, context: &Context) -> Self::ComputedValue {
|
||||
use app_units::Au;
|
||||
use values::computed::NonNegativeLength;
|
||||
use values::specified::length::FontBaseSize;
|
||||
match *self {
|
||||
GenericLineHeight::Normal => {
|
||||
|
@ -119,13 +119,13 @@ impl ToComputedValue for LineHeight {
|
|||
.to_computed_value(
|
||||
context,
|
||||
FontBaseSize::CurrentStyle,
|
||||
);
|
||||
).px();
|
||||
|
||||
let absolute_length = computed_calc.unclamped_length();
|
||||
computed_calc
|
||||
let absolute_length = computed_calc.unclamped_length().px();
|
||||
let pixel = computed_calc
|
||||
.clamping_mode
|
||||
.clamp(absolute_length + Au::from(font_relative_length))
|
||||
.into()
|
||||
.clamp(absolute_length + font_relative_length);
|
||||
NonNegativeLength::new(pixel)
|
||||
}
|
||||
};
|
||||
GenericLineHeight::Length(result)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue