mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Clean up text-shadow property
This commit is contained in:
parent
1e975b9833
commit
c072f3ab18
1 changed files with 25 additions and 30 deletions
|
@ -726,7 +726,7 @@ ${helpers.single_keyword("text-align-last",
|
|||
impl HasViewportPercentage for SpecifiedValue {
|
||||
fn has_viewport_percentage(&self) -> bool {
|
||||
let &SpecifiedValue(ref vec) = self;
|
||||
vec.iter().any(|ref x| x .has_viewport_percentage())
|
||||
vec.iter().any(|ref x| x.has_viewport_percentage())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -784,15 +784,13 @@ ${helpers.single_keyword("text-align-last",
|
|||
impl ToCss for computed_value::T {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
let mut iter = self.0.iter();
|
||||
if let Some(shadow) = iter.next() {
|
||||
try!(shadow.to_css(dest));
|
||||
} else {
|
||||
try!(dest.write_str("none"));
|
||||
return Ok(())
|
||||
match iter.next() {
|
||||
Some(shadow) => shadow.to_css(dest)?,
|
||||
None => return dest.write_str("none"),
|
||||
}
|
||||
for shadow in iter {
|
||||
try!(dest.write_str(", "));
|
||||
try!(shadow.to_css(dest));
|
||||
dest.write_str(", ")?;
|
||||
shadow.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -800,29 +798,26 @@ ${helpers.single_keyword("text-align-last",
|
|||
|
||||
impl ToCss for computed_value::TextShadow {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
try!(self.offset_x.to_css(dest));
|
||||
try!(dest.write_str(" "));
|
||||
try!(self.offset_y.to_css(dest));
|
||||
try!(dest.write_str(" "));
|
||||
try!(self.blur_radius.to_css(dest));
|
||||
try!(dest.write_str(" "));
|
||||
try!(self.color.to_css(dest));
|
||||
Ok(())
|
||||
self.offset_x.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.offset_y.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.blur_radius.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.color.to_css(dest)
|
||||
}
|
||||
}
|
||||
|
||||
impl ToCss for SpecifiedValue {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
let mut iter = self.0.iter();
|
||||
if let Some(shadow) = iter.next() {
|
||||
try!(shadow.to_css(dest));
|
||||
} else {
|
||||
try!(dest.write_str("none"));
|
||||
return Ok(())
|
||||
match iter.next() {
|
||||
Some(shadow) => shadow.to_css(dest)?,
|
||||
None => return dest.write_str("none"),
|
||||
}
|
||||
for shadow in iter {
|
||||
try!(dest.write_str(", "));
|
||||
try!(shadow.to_css(dest));
|
||||
dest.write_str(", ")?;
|
||||
shadow.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
@ -830,15 +825,15 @@ ${helpers.single_keyword("text-align-last",
|
|||
|
||||
impl ToCss for SpecifiedTextShadow {
|
||||
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
|
||||
try!(self.offset_x.to_css(dest));
|
||||
try!(dest.write_str(" "));
|
||||
try!(self.offset_y.to_css(dest));
|
||||
try!(dest.write_str(" "));
|
||||
try!(self.blur_radius.to_css(dest));
|
||||
self.offset_x.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.offset_y.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
self.blur_radius.to_css(dest)?;
|
||||
|
||||
if let Some(ref color) = self.color {
|
||||
try!(dest.write_str(" "));
|
||||
try!(color.to_css(dest));
|
||||
dest.write_str(" ")?;
|
||||
color.to_css(dest)?;
|
||||
}
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue