From cce3f3a286e69f58b7ff567db96e663d59f5f604 Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Sat, 16 Oct 2021 20:09:24 +0000 Subject: [PATCH] Bug 1736129 - Make #[css(represents_keyword)] convert underscore in the field name to dash. r=emilio Differential Revision: https://phabricator.services.mozilla.com/D128668 --- servo/components/style_derive/to_css.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/servo/components/style_derive/to_css.rs b/servo/components/style_derive/to_css.rs index 40b7ee7cfec8..8281a82bd893 100644 --- a/servo/components/style_derive/to_css.rs +++ b/servo/components/style_derive/to_css.rs @@ -203,7 +203,7 @@ fn derive_single_field_expr( .ident .as_ref() .expect("Unnamed field with represents_keyword?"); - let ident = cg::to_css_identifier(&ident.to_string()); + let ident = cg::to_css_identifier(&ident.to_string()).replace("_", "-"); quote! { if *#field { writer.raw_item(#ident)?;