mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Add the full background shorthand
This commit is contained in:
parent
7c1f2335d4
commit
2720c05c4b
2 changed files with 3 additions and 26 deletions
|
@ -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",
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue