diff --git a/components/style/properties/longhand/box.mako.rs b/components/style/properties/longhand/box.mako.rs index 9afcae44701..6ee6c751483 100644 --- a/components/style/properties/longhand/box.mako.rs +++ b/components/style/properties/longhand/box.mako.rs @@ -651,6 +651,23 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", dest.write_str(")") } + fn serialize_keyword(dest: &mut W, keyword: FunctionKeyword) -> fmt::Result + where W: fmt::Write, + { + match keyword { + FunctionKeyword::StepStart => { + serialize_steps(dest, specified::Integer::new(1), StartEnd::Start) + }, + FunctionKeyword::StepEnd => { + serialize_steps(dest, specified::Integer::new(1), StartEnd::End) + }, + _ => { + keyword.to_css(dest) + }, + } + } + + // https://drafts.csswg.org/css-transitions/#serializing-a-timing-function impl ToCss for SpecifiedValue { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { @@ -675,17 +692,7 @@ ${helpers.single_keyword("overflow-x", "visible hidden scroll auto", dest.write_str(")") }, SpecifiedValue::Keyword(keyword) => { - match keyword { - FunctionKeyword::StepStart => { - serialize_steps(dest, specified::Integer::new(1), StartEnd::Start) - }, - FunctionKeyword::StepEnd => { - serialize_steps(dest, specified::Integer::new(1), StartEnd::End) - }, - _ => { - keyword.to_css(dest) - }, - } + serialize_keyword(dest, keyword) }, } }