mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Make the serialization of the mask shorthand more compact.
This helps to preserve the old longhand form when possible (mask used to be a longhand), which will be relevant when we serialize this for the computed value. Differential Revision: https://phabricator.services.mozilla.com/D11943
This commit is contained in:
parent
0e7adcf18a
commit
60331f01d0
1 changed files with 28 additions and 15 deletions
|
@ -148,21 +148,32 @@
|
||||||
% endfor
|
% endfor
|
||||||
|
|
||||||
image.to_css(dest)?;
|
image.to_css(dest)?;
|
||||||
dest.write_str(" ")?;
|
|
||||||
mode.to_css(dest)?;
|
|
||||||
dest.write_str(" ")?;
|
|
||||||
|
|
||||||
Position {
|
if *mode != mask_mode::single_value::get_initial_specified_value() {
|
||||||
horizontal: position_x.clone(),
|
dest.write_str(" ")?;
|
||||||
vertical: position_y.clone()
|
mode.to_css(dest)?;
|
||||||
}.to_css(dest)?;
|
}
|
||||||
|
|
||||||
if *size != mask_size::single_value::get_initial_specified_value() {
|
if *position_x != PositionComponent::zero() ||
|
||||||
dest.write_str(" / ")?;
|
*position_y != PositionComponent::zero() ||
|
||||||
size.to_css(dest)?;
|
*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 *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 {
|
if *origin != Origin::BorderBox || *clip != Clip::BorderBox {
|
||||||
dest.write_str(" ")?;
|
dest.write_str(" ")?;
|
||||||
|
@ -173,8 +184,10 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
dest.write_str(" ")?;
|
if *composite != mask_composite::single_value::get_initial_specified_value() {
|
||||||
composite.to_css(dest)?;
|
dest.write_str(" ")?;
|
||||||
|
composite.to_css(dest)?;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue