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( ${helpers.single_keyword(
"background-attachment", "background-attachment",
"scroll fixed" + (" local" if engine == "gecko" else ""), "scroll" + (" fixed" if engine in ["gecko", "servo-2013"] else "") + (" local" if engine == "gecko" else ""),
engines="gecko servo-2013", engines="gecko servo-2013 servo-2020",
vector=True, vector=True,
gecko_enum_prefix="StyleImageLayerAttachment", gecko_enum_prefix="StyleImageLayerAttachment",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment", spec="https://drafts.csswg.org/css-backgrounds/#the-background-attachment",

View file

@ -6,7 +6,7 @@
// TODO: other background-* properties // TODO: other background-* properties
<%helpers:shorthand name="background" <%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 sub_properties="background-color background-position-x background-position-y background-repeat
background-attachment background-image background-size background-origin background-attachment background-image background-size background-origin
background-clip" background-clip"
@ -193,29 +193,6 @@
} }
</%helpers:shorthand> </%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" <%helpers:shorthand name="background-position"
engines="gecko servo-2013 servo-2020" engines="gecko servo-2013 servo-2020"
flags="SHORTHAND_IN_GETCS" flags="SHORTHAND_IN_GETCS"