未验证 提交 11bb2bff 编写于 作者: J Jonah Williams 提交者: GitHub

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

上级 cbec7aa2
......@@ -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.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册