mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Fix fonts.clear exception in IE11 (flutter/engine#19180)
This commit is contained in:
parent
752a8e9335
commit
771e210302
@ -98,7 +98,7 @@ class FontCollection {
|
||||
void clear() {
|
||||
_assetFontManager = null;
|
||||
_testFontManager = null;
|
||||
if (supportsFontLoadingApi) {
|
||||
if (supportsFontsClearApi) {
|
||||
html.document.fonts.clear();
|
||||
}
|
||||
}
|
||||
@ -313,4 +313,5 @@ class _PolyfillFontManager extends FontManager {
|
||||
}
|
||||
}
|
||||
|
||||
final bool supportsFontLoadingApi = html.document.fonts != null;
|
||||
final bool supportsFontLoadingApi = js_util.hasProperty(html.window, 'FontFace');
|
||||
final bool supportsFontsClearApi = html.document.fonts != null && js_util.hasProperty(html.document.fonts, 'clear');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user