aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/style/values.rs11
1 files changed, 8 insertions, 3 deletions
diff --git a/components/style/values.rs b/components/style/values.rs
index a9addcae8c4..b8158059abe 100644
--- a/components/style/values.rs
+++ b/components/style/values.rs
@@ -424,6 +424,7 @@ pub mod specified {
pub vmax: Option<ViewportPercentageLength>,
pub em: Option<FontRelativeLength>,
pub ex: Option<FontRelativeLength>,
+ pub ch: Option<FontRelativeLength>,
pub rem: Option<FontRelativeLength>,
pub percentage: Option<Percentage>,
}
@@ -584,6 +585,7 @@ pub mod specified {
let mut vmin = None;
let mut em = None;
let mut ex = None;
+ let mut ch = None;
let mut rem = None;
let mut percentage = None;
let mut number = None;
@@ -611,6 +613,8 @@ pub mod specified {
em = Some(em.unwrap_or(0.) + val),
FontRelativeLength::Ex(val) =>
ex = Some(ex.unwrap_or(0.) + val),
+ FontRelativeLength::Ch(val) =>
+ ch = Some(ch.unwrap_or(0.) + val),
FontRelativeLength::Rem(val) =>
rem = Some(rem.unwrap_or(0.) + val),
},
@@ -627,6 +631,7 @@ pub mod specified {
vmin: vmin.map(ViewportPercentageLength::Vmin),
em: em.map(FontRelativeLength::Em),
ex: ex.map(FontRelativeLength::Ex),
+ ch: ex.map(FontRelativeLength::Ch),
rem: rem.map(FontRelativeLength::Rem),
percentage: percentage.map(Percentage),
})
@@ -668,14 +673,14 @@ pub mod specified {
};
}
- let count = count!(em, ex, absolute, rem, vh, vmax, vmin, vw, percentage);
+ let count = count!(em, ex, ch, absolute, rem, vh, vmax, vmin, vw, percentage);
assert!(count > 0);
if count > 1 {
try!(write!(dest, "calc("));
}
- serialize!(em, ex, absolute, rem, vh, vmax, vmin, vw, percentage);
+ serialize!(em, ex, ch, absolute, rem, vh, vmax, vmin, vw, percentage);
if count > 1 {
try!(write!(dest, ")"));
@@ -1329,7 +1334,7 @@ pub mod computed {
val.to_computed_value(context.viewport_size));
}
}
- for val in &[self.em, self.ex, self.rem] {
+ for val in &[self.em, self.ex, self.ch, self.rem] {
if let Some(val) = *val {
length = Some(length.unwrap_or(Au(0)) +
val.to_computed_value(context.font_size, context.root_font_size));