Skip to content

Commit

Permalink
Add the full background shorthand
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonSapin committed Jan 13, 2020
1 parent 7c1f233 commit 2720c05
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 26 deletions.
4 changes: 2 additions & 2 deletions components/style/properties/longhands/background.mako.rs
Expand Up @@ -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",
Expand Down
25 changes: 1 addition & 24 deletions components/style/properties/shorthands/background.mako.rs
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down

0 comments on commit 2720c05

Please sign in to comment.