From e7dc4a47cb2ad52a9d3e40b9c47687f1f947b867 Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Thu, 8 Dec 2022 12:51:36 +0000 Subject: [PATCH] style: Serialize font-face src tech() keywords in mixed-case to match the spec; fix the associated WPT test to do case-insensitive comparisons Differential Revision: https://phabricator.services.mozilla.com/D164202 --- components/style/font_face.rs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/components/style/font_face.rs b/components/style/font_face.rs index f1b4651c769..6d6609750b5 100644 --- a/components/style/font_face.rs +++ b/components/style/font_face.rs @@ -189,14 +189,16 @@ impl ToCss for FontFaceSourceTechFlags { }; } + // Being CSS keywords, these are ASCII-case-insensitive; but we serialize + // as mixed-case to match how they're listed in the spec. write_if_flag!("features-opentype" => FEATURES_OPENTYPE); write_if_flag!("features-aat" => FEATURES_AAT); write_if_flag!("features-graphite" => FEATURES_GRAPHITE); - write_if_flag!("color-colrv0" => COLOR_COLRV0); - write_if_flag!("color-colrv1" => COLOR_COLRV1); - write_if_flag!("color-svg" => COLOR_SVG); + write_if_flag!("color-COLRv0" => COLOR_COLRV0); + write_if_flag!("color-COLRv1" => COLOR_COLRV1); + write_if_flag!("color-SVG" => COLOR_SVG); write_if_flag!("color-sbix" => COLOR_SBIX); - write_if_flag!("color-cbdt" => COLOR_CBDT); + write_if_flag!("color-CBDT" => COLOR_CBDT); write_if_flag!("variations" => VARIATIONS); write_if_flag!("palettes" => PALETTES); write_if_flag!("incremental" => INCREMENTAL);