From ba1ef5f758e359b05dbefc82ce1974798015bc91 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Mon, 16 Sep 2019 14:17:17 -0700 Subject: [PATCH] Include firefox in check to quote font families (flutter/engine#12288) --- .../lib/web_ui/lib/src/engine/text/font_collection.dart | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart b/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart index 91b30c234f2..b6daf744a92 100644 --- a/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart +++ b/engine/src/flutter/lib/web_ui/lib/src/engine/text/font_collection.dart @@ -114,11 +114,11 @@ class _FontManager { String asset, Map descriptors, ) { - // Safari crashes if you create a [html.FontFace] with a font family that - // is not correct CSS syntax. To ensure the font family is accepted on - // Safari, wrap it in quotes. + // Safari and Firefox crash if you create a [html.FontFace] with a font + // family that is not correct CSS syntax. To ensure the font family is + // accepted on these browsers, wrap it in quotes. // See: https://drafts.csswg.org/css-fonts-3/#font-family-prop - if (browserEngine == BrowserEngine.webkit) { + if (browserEngine == BrowserEngine.webkit || browserEngine == BrowserEngine.firefox) { family = "'$family'"; } // try/catch because `new FontFace` can crash with an improper font family.