Include firefox in check to quote font families (flutter/engine#12288)

This commit is contained in:
Jonah Williams 2019-09-16 14:17:17 -07:00 committed by GitHub
parent 743098bce0
commit ba1ef5f758

View File

@ -114,11 +114,11 @@ class _FontManager {
String asset,
Map<String, String> 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.