mirror of
https://github.com/servo/servo.git
synced 2025-08-05 21:50:18 +01:00
Serialize text-decoration-line to none if nothing specified
This commit is contained in:
parent
6fc0d2f927
commit
b0f5f20290
1 changed files with 16 additions and 22 deletions
|
@ -122,30 +122,24 @@ ${helpers.single_keyword("unicode-bidi",
|
|||
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
let mut space = false;
|
||||
if self.underline {
|
||||
try!(dest.write_str("underline"));
|
||||
space = true;
|
||||
}
|
||||
if self.overline {
|
||||
if space {
|
||||
try!(dest.write_str(" "));
|
||||
let mut has_any = false;
|
||||
macro_rules! write_value {
|
||||
($line:ident => $css:expr) => {
|
||||
if self.$line {
|
||||
if has_any {
|
||||
dest.write_str(" ")?;
|
||||
}
|
||||
dest.write_str($css)?;
|
||||
has_any = true;
|
||||
}
|
||||
}
|
||||
try!(dest.write_str("overline"));
|
||||
space = true;
|
||||
}
|
||||
if self.line_through {
|
||||
if space {
|
||||
try!(dest.write_str(" "));
|
||||
}
|
||||
try!(dest.write_str("line-through"));
|
||||
space = true;
|
||||
}
|
||||
if self.blink {
|
||||
if space {
|
||||
try!(dest.write_str(" "));
|
||||
}
|
||||
try!(dest.write_str("blink"));
|
||||
write_value!(underline => "underline");
|
||||
write_value!(overline => "overline");
|
||||
write_value!(line_through => "line-through");
|
||||
write_value!(blink => "blink");
|
||||
if !has_any {
|
||||
dest.write_str("none")?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue