mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Style: Do not immediately convert absolute specified lengths
The NoCalcLength::Absolute variant has been rewritten to accommodate other units than Au with the new AbsoluteLength enum. This avoids loss of precision for some operations. The conversion from floating point absolute lengths to integer application unit values adopts the same clamping limits as Gecko.
This commit is contained in:
parent
d77d752990
commit
7ecee05e4a
12 changed files with 161 additions and 51 deletions
|
@ -561,7 +561,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
}
|
||||
LengthOrPercentageOrAuto::Length(length) => {
|
||||
let width_value = specified::LengthOrPercentageOrAuto::Length(
|
||||
specified::NoCalcLength::Absolute(length));
|
||||
specified::NoCalcLength::Absolute(specified::AbsoluteLength::Px(length.to_f32_px())));
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::Width(width_value)));
|
||||
|
@ -590,7 +590,7 @@ impl LayoutElementHelpers for LayoutJS<Element> {
|
|||
}
|
||||
LengthOrPercentageOrAuto::Length(length) => {
|
||||
let height_value = specified::LengthOrPercentageOrAuto::Length(
|
||||
specified::NoCalcLength::Absolute(length));
|
||||
specified::NoCalcLength::Absolute(specified::AbsoluteLength::Px(length.to_f32_px())));
|
||||
hints.push(from_declaration(
|
||||
shared_lock,
|
||||
PropertyDeclaration::Height(height_value)));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue