mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Change LengthOrPercentage to make use of NoCalcLength
This commit is contained in:
parent
377a23df50
commit
590c9579f0
10 changed files with 61 additions and 60 deletions
|
@ -299,7 +299,6 @@ impl ToComputedValue for InsetRect {
|
|||
/// the keywords are folded into the percentages
|
||||
fn serialize_basicshape_position<W>(position: &Position, dest: &mut W)
|
||||
-> fmt::Result where W: fmt::Write {
|
||||
use values::specified::Length;
|
||||
use values::specified::position::Keyword;
|
||||
|
||||
// keyword-percentage pairs can be folded into a single percentage
|
||||
|
@ -327,7 +326,7 @@ fn serialize_basicshape_position<W>(position: &Position, dest: &mut W)
|
|||
// 0 length should be replaced with 0%
|
||||
fn replace_with_percent(input: LengthOrPercentage) -> LengthOrPercentage {
|
||||
match input {
|
||||
LengthOrPercentage::Length(ref l) if l == &Length::zero() => {
|
||||
LengthOrPercentage::Length(ref l) if l.is_zero() => {
|
||||
LengthOrPercentage::Percentage(Percentage(0.0))
|
||||
}
|
||||
_ => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue