mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
Reuse ToCss of Shadow types in drop-shadow filter.
This commit is contained in:
parent
e659fa6c23
commit
ccd7022457
1 changed files with 6 additions and 20 deletions
|
@ -210,15 +210,9 @@ ${helpers.predefined_type("clip",
|
||||||
computed_value::Filter::Sepia(value) => try!(write!(dest, "sepia({})", value)),
|
computed_value::Filter::Sepia(value) => try!(write!(dest, "sepia({})", value)),
|
||||||
% if product == "gecko":
|
% if product == "gecko":
|
||||||
computed_value::Filter::DropShadow(shadow) => {
|
computed_value::Filter::DropShadow(shadow) => {
|
||||||
try!(dest.write_str("drop-shadow("));
|
dest.write_str("drop-shadow(")?;
|
||||||
try!(shadow.offset_x.to_css(dest));
|
shadow.to_css(dest)?;
|
||||||
try!(dest.write_str(" "));
|
dest.write_str(")")?;
|
||||||
try!(shadow.offset_y.to_css(dest));
|
|
||||||
try!(dest.write_str(" "));
|
|
||||||
try!(shadow.blur_radius.to_css(dest));
|
|
||||||
try!(dest.write_str(" "));
|
|
||||||
try!(shadow.color.to_css(dest));
|
|
||||||
try!(dest.write_str(")"));
|
|
||||||
}
|
}
|
||||||
computed_value::Filter::Url(ref url) => {
|
computed_value::Filter::Url(ref url) => {
|
||||||
url.to_css(dest)?;
|
url.to_css(dest)?;
|
||||||
|
@ -251,17 +245,9 @@ ${helpers.predefined_type("clip",
|
||||||
SpecifiedFilter::Sepia(value) => try!(write!(dest, "sepia({})", value)),
|
SpecifiedFilter::Sepia(value) => try!(write!(dest, "sepia({})", value)),
|
||||||
% if product == "gecko":
|
% if product == "gecko":
|
||||||
SpecifiedFilter::DropShadow(ref shadow) => {
|
SpecifiedFilter::DropShadow(ref shadow) => {
|
||||||
try!(dest.write_str("drop-shadow("));
|
dest.write_str("drop-shadow(")?;
|
||||||
try!(shadow.offset_x.to_css(dest));
|
shadow.to_css(dest)?;
|
||||||
try!(dest.write_str(" "));
|
dest.write_str(")")?;
|
||||||
try!(shadow.offset_y.to_css(dest));
|
|
||||||
try!(dest.write_str(" "));
|
|
||||||
try!(shadow.blur_radius.to_css(dest));
|
|
||||||
if let Some(ref color) = shadow.color {
|
|
||||||
try!(dest.write_str(" "));
|
|
||||||
try!(color.to_css(dest));
|
|
||||||
}
|
|
||||||
try!(dest.write_str(")"));
|
|
||||||
}
|
}
|
||||||
SpecifiedFilter::Url(ref url) => {
|
SpecifiedFilter::Url(ref url) => {
|
||||||
url.to_css(dest)?;
|
url.to_css(dest)?;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue