mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Include firefox in check to quote font families (flutter/engine#12288)
This commit is contained in:
parent
743098bce0
commit
ba1ef5f758
@ -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.
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user