Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 09f3939

Browse files
committed
removed fonts clear and factory constructor
1 parent 56044b3 commit 09f3939

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

lib/web_ui/lib/src/engine/safe_browser_api.dart

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,10 +134,6 @@ num? parseFloat(String source) {
134134
return result;
135135
}
136136

137-
final bool supportsFontsClearApi =
138-
js_util.hasProperty(domDocument, 'fonts') &&
139-
js_util.hasProperty(domDocument.fonts!, 'clear');
140-
141137
/// Used to decide if the browser tab still has the focus.
142138
///
143139
/// This information is useful for deciding on the blur behavior.

lib/web_ui/lib/src/engine/text/font_collection.dart

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,14 @@ class HtmlFontCollection implements FontCollection {
102102
void clear() {
103103
_assetFontManager = null;
104104
_testFontManager = null;
105-
if (supportsFontsClearApi) {
106-
domDocument.fonts!.clear();
107-
}
105+
domDocument.fonts!.clear();
108106
}
109107
}
110108

111109
/// Manages a collection of fonts and ensures they are loaded.
112110
class FontManager {
113-
factory FontManager() = FontManager._;
114111

115-
FontManager._();
112+
FontManager();
116113

117114
/// Fonts that started the downloading process. Once the fonts have downloaded
118115
/// without error, they are moved to [_downloadedFonts]. Those fonts

0 commit comments

Comments
 (0)