mirror of
https://github.com/servo/servo.git
synced 2025-10-17 08:49:21 +01:00
style: Serialize NaN and infinity percentages correctly
NaN and infinity percentages are now serialized as expected. Also added some new WPT tests as percentages were previously untested and added some spec comments to previous NaN/inf serialization code. Differential Revision: https://phabricator.services.mozilla.com/D176726
This commit is contained in:
parent
d44f772dc3
commit
2e713d4366
3 changed files with 18 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
|||
use crate::values::animated::ToAnimatedValue;
|
||||
use crate::values::generics::NonNegative;
|
||||
use crate::values::specified::percentage::ToPercentage;
|
||||
use crate::values::{serialize_percentage, CSSFloat};
|
||||
use crate::values::{serialize_normalized_percentage, CSSFloat};
|
||||
use crate::Zero;
|
||||
use std::fmt;
|
||||
use style_traits::{CssWriter, ToCss};
|
||||
|
@ -106,7 +106,7 @@ impl ToCss for Percentage {
|
|||
where
|
||||
W: fmt::Write,
|
||||
{
|
||||
serialize_percentage(self.0, dest)
|
||||
serialize_normalized_percentage(self.0, dest)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue