File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ class GUI extends React.Component {
5050
5151 const getFontPromises = ( ) => {
5252 const fontPromises = [ ] ;
53+ // Browsers that support the font loader interface have an iterable document.fonts.values()
54+ // Firefox has a mocked out object that doesn't actually implement iterable, which is why
55+ // the deep safety check is necessary.
5356 if ( document . fonts &&
5457 typeof document . fonts . values === 'function' &&
5558 typeof document . fonts . values ( ) [ Symbol . iterator ] === 'function' ) {
@@ -61,6 +64,8 @@ class GUI extends React.Component {
6164 return fontPromises ;
6265 } ;
6366
67+ // Font promises must be gathered after the document is loaded, because on Mac Chrome, the promise
68+ // objects get replaced and the old ones never resolve.
6469 if ( document . readyState === 'complete' ) {
6570 Promise . all ( getFontPromises ( ) ) . then ( this . loadProject ) ;
6671 } else {
You can’t perform that action at this time.
0 commit comments