diff options
-rw-r--r-- | components/style/properties/shorthands/svg.mako.rs | 41 |
1 files changed, 27 insertions, 14 deletions
diff --git a/components/style/properties/shorthands/svg.mako.rs b/components/style/properties/shorthands/svg.mako.rs index e814a0404c4..b5888948cf8 100644 --- a/components/style/properties/shorthands/svg.mako.rs +++ b/components/style/properties/shorthands/svg.mako.rs @@ -148,21 +148,32 @@ % endfor image.to_css(dest)?; - dest.write_str(" ")?; - mode.to_css(dest)?; - dest.write_str(" ")?; - Position { - horizontal: position_x.clone(), - vertical: position_y.clone() - }.to_css(dest)?; + if *mode != mask_mode::single_value::get_initial_specified_value() { + dest.write_str(" ")?; + mode.to_css(dest)?; + } + + if *position_x != PositionComponent::zero() || + *position_y != PositionComponent::zero() || + *size != mask_size::single_value::get_initial_specified_value() + { + dest.write_str(" ")?; + Position { + horizontal: position_x.clone(), + vertical: position_y.clone() + }.to_css(dest)?; - if *size != mask_size::single_value::get_initial_specified_value() { - dest.write_str(" / ")?; - size.to_css(dest)?; + if *size != mask_size::single_value::get_initial_specified_value() { + dest.write_str(" / ")?; + size.to_css(dest)?; + } + } + + if *repeat != mask_repeat::single_value::get_initial_specified_value() { + dest.write_str(" ")?; + repeat.to_css(dest)?; } - dest.write_str(" ")?; - repeat.to_css(dest)?; if *origin != Origin::BorderBox || *clip != Clip::BorderBox { dest.write_str(" ")?; @@ -173,8 +184,10 @@ } } - dest.write_str(" ")?; - composite.to_css(dest)?; + if *composite != mask_composite::single_value::get_initial_specified_value() { + dest.write_str(" ")?; + composite.to_css(dest)?; + } } Ok(()) |