mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Prefer length and percentage for word spacing
This commit is contained in:
parent
7ed9134e5a
commit
a04028eede
15 changed files with 135 additions and 10 deletions
|
@ -4,6 +4,7 @@
|
|||
|
||||
use app_units::Au;
|
||||
use euclid::size::Size2D;
|
||||
use ordered_float::NotNaN;
|
||||
use properties::ComputedValues;
|
||||
use std::fmt;
|
||||
use super::LocalToCss;
|
||||
|
@ -241,6 +242,15 @@ impl LengthOrPercentage {
|
|||
Length(_) | Percentage(_) | Calc(_) => false
|
||||
}
|
||||
}
|
||||
|
||||
pub fn to_hash_key(&self) -> (Au, NotNaN<f32>) {
|
||||
use self::LengthOrPercentage::*;
|
||||
match *self {
|
||||
Length(l) => (l, NotNaN::new(0.0).unwrap()),
|
||||
Percentage(p) => (Au(0), NotNaN::new(p).unwrap()),
|
||||
Calc(c) => (c.length(), NotNaN::new(c.percentage()).unwrap()),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl fmt::Debug for LengthOrPercentage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue