mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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,10 +148,17 @@
|
|||
% endfor
|
||||
|
||||
image.to_css(dest)?;
|
||||
|
||||
if *mode != mask_mode::single_value::get_initial_specified_value() {
|
||||
dest.write_str(" ")?;
|
||||
mode.to_css(dest)?;
|
||||
dest.write_str(" ")?;
|
||||
}
|
||||
|
||||
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()
|
||||
|
@ -161,8 +168,12 @@
|
|||
dest.write_str(" / ")?;
|
||||
size.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
|
||||
if *repeat != mask_repeat::single_value::get_initial_specified_value() {
|
||||
dest.write_str(" ")?;
|
||||
repeat.to_css(dest)?;
|
||||
}
|
||||
|
||||
if *origin != Origin::BorderBox || *clip != Clip::BorderBox {
|
||||
dest.write_str(" ")?;
|
||||
|
@ -173,9 +184,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
if *composite != mask_composite::single_value::get_initial_specified_value() {
|
||||
dest.write_str(" ")?;
|
||||
composite.to_css(dest)?;
|
||||
}
|
||||
}
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue