Add the full background shorthand

This commit is contained in:
Simon Sapin 2020-01-13 21:25:21 +01:00
parent 7c1f2335d4
commit 2720c05c4b
2 changed files with 3 additions and 26 deletions

View file

@ -58,8 +58,8 @@ ${helpers.predefined_type(
${helpers.single_keyword(
"background-attachment",
"scroll fixed" + (" local" if engine == "gecko" else ""),
engines="gecko servo-2013",
"scroll" + (" fixed" if engine in ["gecko", "servo-2013"] else "") + (" local" if engine == "gecko" else ""),
engines="gecko servo-2013 servo-2020",
vector=True,
gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",

View file

@ -6,7 +6,7 @@
// TODO: other background-* properties
<%helpers:shorthand name="background"
engines="gecko servo-2013"
engines="gecko servo-2013 servo-2020"
sub_properties="background-color background-position-x background-position-y background-repeat
background-attachment background-image background-size background-origin
background-clip"
@ -193,29 +193,6 @@
}
</%helpers:shorthand>
<%helpers:shorthand name="background"
engines="servo-2020"
sub_properties="background-color"
spec="https://drafts.csswg.org/css-backgrounds/#the-background">
use crate::values::specified::Color;
use crate::parser::Parse;
pub fn parse_value<'i, 't>(
context: &ParserContext,
input: &mut Parser<'i, 't>,
) -> Result<Longhands, ParseError<'i>> {
Ok(expanded! {
background_color: Color::parse(context, input)?
})
}
impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut CssWriter<W>) -> fmt::Result where W: fmt::Write {
self.background_color.to_css(dest)
}
}
</%helpers:shorthand>
<%helpers:shorthand name="background-position"
engines="gecko servo-2013 servo-2020"
flags="SHORTHAND_IN_GETCS"