Skip to content

Commit

Permalink
Change space_separated_allowed into separator
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Jun 27, 2017
1 parent c03f5f1 commit da9d200
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions components/style/properties/helpers.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
`initial_value` need not be defined for these.
</%doc>
<%def name="vector_longhand(name, gecko_only=False, allow_empty=False,
delegate_animate=False, space_separated_allowed=False, **kwargs)">
delegate_animate=False, separator='Comma', **kwargs)">
<%call expr="longhand(name, vector=True, **kwargs)">
% if not gecko_only:
use smallvec::SmallVec;
Expand Down Expand Up @@ -218,20 +218,14 @@
pub fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>)
-> Result<SpecifiedValue, ParseError<'i>> {
use style_traits::Separator;
#[allow(unused_imports)]
use style_traits::{Comma, CommaWithSpace};

<%
separator = "CommaWithSpace" if space_separated_allowed else "Comma"
%>

% if allow_empty:
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
return Ok(SpecifiedValue(Vec::new()))
}
% endif

${separator}::parse(input, |parser| {
::style_traits::${separator}::parse(input, |parser| {
single_value::parse(context, parser)
}).map(SpecifiedValue)
}
Expand Down
2 changes: 1 addition & 1 deletion components/style/properties/longhand/inherited_svg.mako.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ ${helpers.predefined_type(
delegate_animate=True,
products="gecko",
animation_value_type="ComputedValue",
space_separated_allowed="True",
separator="CommaWithSpace",
spec="https://www.w3.org/TR/SVG2/painting.html#StrokeDashing",
)}

Expand Down

0 comments on commit da9d200

Please sign in to comment.